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 1/4] netvsc: change rx descriptor setup and sizing
Date: Tue, 24 Jul 2018 14:08:50 -0700	[thread overview]
Message-ID: <20180724210853.22767-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20180724210853.22767-1-stephen@networkplumber.org>

Increase the size of the ring used to hold mbuf's received
but not processed.  The default is now based off the size
of thw receive mbuf pool not the number of sections from the host.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 drivers/net/netvsc/hn_rxtx.c | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 6d2f41c4c011..9a2dd9cb1beb 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -728,18 +728,12 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		      struct rte_mempool *mp)
 {
 	struct hn_data *hv = dev->data->dev_private;
-	uint32_t qmax = hv->rxbuf_section_cnt;
 	char ring_name[RTE_RING_NAMESIZE];
 	struct hn_rx_queue *rxq;
 	unsigned int count;
-	size_t size;
-	int err = -ENOMEM;
 
 	PMD_INIT_FUNC_TRACE();
 
-	if (nb_desc == 0 || nb_desc > qmax)
-		nb_desc = qmax;
-
 	if (queue_idx == 0) {
 		rxq = hv->primary;
 	} else {
@@ -749,14 +743,9 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	rxq->mb_pool = mp;
-
-	count = rte_align32pow2(nb_desc);
-	size = sizeof(struct rte_ring) + count * sizeof(void *);
-	rxq->rx_ring = rte_malloc_socket("RX_RING", size,
-					 RTE_CACHE_LINE_SIZE,
-					 socket_id);
-	if (!rxq->rx_ring)
-		goto fail;
+	count = rte_mempool_avail_count(mp) / dev->data->nb_rx_queues;
+	if (nb_desc == 0 || nb_desc > count)
+		nb_desc = count;
 
 	/*
 	 * Staging ring from receive event logic to rx_pkts.
@@ -765,9 +754,10 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	snprintf(ring_name, sizeof(ring_name),
 		 "hn_rx_%u_%u", dev->data->port_id, queue_idx);
-	err = rte_ring_init(rxq->rx_ring, ring_name,
-			    count, 0);
-	if (err)
+	rxq->rx_ring = rte_ring_create(ring_name,
+				       rte_align32pow2(nb_desc),
+				       socket_id, 0);
+	if (!rxq->rx_ring)
 		goto fail;
 
 	dev->data->rx_queues[queue_idx] = rxq;
-- 
2.18.0

  reply	other threads:[~2018-07-24 21:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 21:08 [dpdk-dev] [PATCH 0/4] netvsc PMD performance fixes Stephen Hemminger
2018-07-24 21:08 ` Stephen Hemminger [this message]
2018-07-24 21:08 ` [dpdk-dev] [PATCH 2/4] netvsc: avoid over filling receive descriptor ring Stephen Hemminger
2018-07-24 21:08 ` [dpdk-dev] [PATCH 3/4] netvsc: implement queue info get handles Stephen Hemminger
2018-07-24 21:08 ` [dpdk-dev] [PATCH 4/4] netvsc/vmbus: avoid signalling host on read Stephen Hemminger
2018-08-05  9:14 ` [dpdk-dev] [PATCH 0/4] netvsc PMD performance fixes Thomas Monjalon

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=20180724210853.22767-2-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).