]> git.droids-corp.org - dpdk.git/commitdiff
net/netvsc: set lower host latency
authorStephen Hemminger <sthemmin@microsoft.com>
Thu, 9 Aug 2018 17:50:07 +0000 (10:50 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 28 Aug 2018 13:27:39 +0000 (15:27 +0200)
Tune the vmbus connection so the host scans faster. This improves
transmit performance. The host default value is 100us but setting
to 50us reduces packet loss significantly.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
drivers/net/netvsc/hn_ethdev.c
drivers/net/netvsc/hn_var.h

index 78b842ba2d684c7fa16ab208499d8f149f4c9438..148e6a33d6824e6146e66c4cad68c79dae25bb80 100644 (file)
@@ -264,6 +264,9 @@ static int hn_subchan_configure(struct hn_data *hv,
                        return err;
                }
 
+               rte_vmbus_set_latency(hv->vmbus, new_sc,
+                                     HN_CHAN_LATENCY_NS);
+
                retry = 0;
                chn_index = rte_vmbus_sub_channel_index(new_sc);
                if (chn_index == 0 || chn_index > hv->max_queues) {
@@ -629,6 +632,9 @@ eth_hn_dev_init(struct rte_eth_dev *eth_dev)
        if (err)
                return err;
 
+       rte_vmbus_set_latency(hv->vmbus, hv->channels[0],
+                             HN_CHAN_LATENCY_NS);
+
        hv->primary = hn_rx_queue_alloc(hv, 0,
                                        eth_dev->device->numa_node);
 
index f7ff8585bc1c77f1fea1e847b7ee7f14eb0c2f33..b3e0a93d45df1dfecfd73de8ad68c0d1a21170fd 100644 (file)
@@ -20,6 +20,9 @@
 /* Retry interval */
 #define HN_CHAN_INTERVAL_US    100
 
+/* Host monitor interval */
+#define HN_CHAN_LATENCY_NS     50000
+
 /* Buffers need to be aligned */
 #ifndef PAGE_SIZE
 #define PAGE_SIZE 4096