DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Stephen Hemminger <sthemmin@microsoft.com>
Subject: [dpdk-dev] [PATCH 3/4] netvsc: set lower host latency
Date: Thu,  9 Aug 2018 10:50:07 -0700	[thread overview]
Message-ID: <20180809175008.5787-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20180809175008.5787-1-stephen@networkplumber.org>

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 | 6 ++++++
 drivers/net/netvsc/hn_var.h    | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 78b842ba2d68..148e6a33d682 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -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);
 
diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
index f7ff8585bc1c..b3e0a93d45df 100644
--- a/drivers/net/netvsc/hn_var.h
+++ b/drivers/net/netvsc/hn_var.h
@@ -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
-- 
2.18.0

  parent reply	other threads:[~2018-08-09 17:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 17:50 [dpdk-dev] [PATCH 0/4] netvsc performance enhancements Stephen Hemminger
2018-08-09 17:50 ` [dpdk-dev] [PATCH 1/4] netvsc: chimney buffer size error handling Stephen Hemminger
2018-08-23 14:45   ` Ferruh Yigit
2018-08-23 15:38     ` Stephen Hemminger
2018-08-09 17:50 ` [dpdk-dev] [PATCH 2/4] bus/vmbus: add host latency tuning function Stephen Hemminger
2018-08-23 14:45   ` Ferruh Yigit
2018-08-23 15:40     ` Stephen Hemminger
2018-08-09 17:50 ` Stephen Hemminger [this message]
2018-08-09 17:50 ` [dpdk-dev] [PATCH 4/4] netvsc: implement tx_done_cleanup Stephen Hemminger
2018-08-23 14:46   ` Ferruh Yigit
2018-08-23 14:47 ` [dpdk-dev] [PATCH 0/4] netvsc performance enhancements Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180809175008.5787-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).