patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Chas Williams <ciwillia@brocade.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>,
	Jan Blunck <jblunck@infradead.org>,
	Shrikrishna Khare <skhare@vmware.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/vmxnet3: fix queue size changes' has been queued to LTS release 16.11.2
Date: Fri,  7 Apr 2017 16:12:02 +0800	[thread overview]
Message-ID: <1491552724-3034-45-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1491552724-3034-1-git-send-email-yuanhan.liu@linux.intel.com>

Hi,

FYI, your patch has been queued to LTS release 16.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 04/11/17.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From 94aa7049c47d4f7ab321a129d7db858cf21b5d04 Mon Sep 17 00:00:00 2001
From: Chas Williams <ciwillia@brocade.com>
Date: Wed, 15 Mar 2017 08:35:10 -0400
Subject: [PATCH] net/vmxnet3: fix queue size changes

[ upstream commit 04df93d1edac6e240911ac4210920b58d1c27dcd ]

If the user reconfigures the queue size, then the previously allocated
memzone may potentially be too small.  Release the memzone when a queue
is released and allocate a new one each time a queue is setup.

While here convert to rte_eth_dma_zone_reserve() which does basically
the same things as the private function.

Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation")

Signed-off-by: Chas Williams <ciwillia@brocade.com>
Acked-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_ring.h |  2 ++
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 37 +++++++++++--------------------------
 2 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ring.h b/drivers/net/vmxnet3/vmxnet3_ring.h
index b50d2b0..a3d330c 100644
--- a/drivers/net/vmxnet3/vmxnet3_ring.h
+++ b/drivers/net/vmxnet3/vmxnet3_ring.h
@@ -138,6 +138,7 @@ typedef struct vmxnet3_tx_queue {
 	uint32_t                     qid;
 	struct Vmxnet3_TxQueueDesc   *shared;
 	struct vmxnet3_txq_stats     stats;
+	const struct rte_memzone     *mz;
 	bool                         stopped;
 	uint16_t                     queue_id;      /**< Device TX queue index. */
 	uint8_t                      port_id;       /**< Device port identifier. */
@@ -161,6 +162,7 @@ typedef struct vmxnet3_rx_queue {
 	struct rte_mbuf             *start_seg;
 	struct rte_mbuf             *last_seg;
 	struct vmxnet3_rxq_stats    stats;
+	const struct rte_memzone    *mz;
 	bool                        stopped;
 	uint16_t                    queue_id;      /**< Device RX queue index. */
 	uint8_t                     port_id;       /**< Device port identifier. */
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 93db10f..3ded18e 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -192,6 +192,8 @@ vmxnet3_dev_tx_queue_release(void *txq)
 		vmxnet3_tx_cmd_ring_release_mbufs(&tq->cmd_ring);
 		/* Release the cmd_ring */
 		vmxnet3_cmd_ring_release(&tq->cmd_ring);
+		/* Release the memzone */
+		rte_memzone_free(tq->mz);
 	}
 }
 
@@ -209,6 +211,9 @@ vmxnet3_dev_rx_queue_release(void *rxq)
 		/* Release both the cmd_rings */
 		for (i = 0; i < VMXNET3_RX_CMDRING_SIZE; i++)
 			vmxnet3_cmd_ring_release(&rq->cmd_ring[i]);
+
+		/* Release the memzone */
+		rte_memzone_free(rq->mz);
 	}
 }
 
@@ -816,30 +821,6 @@ rcd_done:
 	return nb_rx;
 }
 
-/*
- * Create memzone for device rings. malloc can't be used as the physical address is
- * needed. If the memzone is already created, then this function returns a ptr
- * to the old one.
- */
-static const struct rte_memzone *
-ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
-		      uint16_t queue_id, uint32_t ring_size, int socket_id)
-{
-	char z_name[RTE_MEMZONE_NAMESIZE];
-	const struct rte_memzone *mz;
-
-	snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-		 dev->driver->pci_drv.driver.name, ring_name,
-		 dev->data->port_id, queue_id);
-
-	mz = rte_memzone_lookup(z_name);
-	if (mz)
-		return mz;
-
-	return rte_memzone_reserve_aligned(z_name, ring_size,
-					   socket_id, 0, VMXNET3_RING_BA_ALIGN);
-}
-
 int
 vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			   uint16_t queue_idx,
@@ -907,11 +888,13 @@ vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	size += sizeof(struct Vmxnet3_TxCompDesc) * comp_ring->size;
 	size += sizeof(struct Vmxnet3_TxDataDesc) * data_ring->size;
 
-	mz = ring_dma_zone_reserve(dev, "txdesc", queue_idx, size, socket_id);
+	mz = rte_eth_dma_zone_reserve(dev, "txdesc", queue_idx, size,
+				      VMXNET3_RING_BA_ALIGN, socket_id);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone");
 		return -ENOMEM;
 	}
+	txq->mz = mz;
 	memset(mz->addr, 0, mz->len);
 
 	/* cmd_ring initialization */
@@ -1009,11 +992,13 @@ vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	size = sizeof(struct Vmxnet3_RxDesc) * (ring0->size + ring1->size);
 	size += sizeof(struct Vmxnet3_RxCompDesc) * comp_ring->size;
 
-	mz = ring_dma_zone_reserve(dev, "rxdesc", queue_idx, size, socket_id);
+	mz = rte_eth_dma_zone_reserve(dev, "rxdesc", queue_idx, size,
+				      VMXNET3_RING_BA_ALIGN, socket_id);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "ERROR: Creating queue descriptors zone");
 		return -ENOMEM;
 	}
+	rxq->mz = mz;
 	memset(mz->addr, 0, mz->len);
 
 	/* cmd_ring0 initialization */
-- 
1.9.0

  parent reply	other threads:[~2017-04-07  8:15 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07  8:11 [dpdk-stable] patch 'pci: fix device registration on FreeBSD' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'kni: fix build with kernel 4.11' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vfio: fix disabling INTx' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vfio: fix secondary process start' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'nic_uio: fix device binding at boot' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'eal/linux: fix build with glibc 2.25' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'examples/ip_fragmentation: fix check of packet type' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'kni: fix build on Suse 12 SP3' " Yuanhan Liu
2017-04-10 10:01   ` Nirmoy Das
2017-04-11 12:38     ` Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e: fix TC bitmap of VEB' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix VLAN stripping indication' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e: fix compile error' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/bnx2x: fix transmit queue free threshold' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/e1000/base: fix multicast setting in VF' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix supported packets types' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe/base: fix build error' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix Rx queue blocking issue' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix all queues drop setting of DCB' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix multi-queue mode check in SRIOV mode' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'app/testpmd: fix init config for multi-queue " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'app/testpmd: fix TC mapping in DCB init config' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e: fix incorrect packet index reference' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbevf: set xstats id values' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/pcap: fix using mbuf after freeing it' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ena: fix return of hash control flushing' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/thunderx: fix 32-bit build' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/thunderx: fix build on FreeBSD' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx4: update link status upon probing with LSC' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/i40e/base: fix potential out of bound array access' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix reusing Rx/Tx queues' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/ixgbe: fix TC bandwidth setting' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx4: fix returned values upon failed probing' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/fm10k: fix pointer cast' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/qede: fix missing UDP protocol in RSS offload types' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix Tx when first segment size is too short' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: change log levels in client mode' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix multiple queue not enabled for old kernels' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix max queues' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix false sharing' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'vhost: fix fd leaks for vhost-user server mode' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'net/mlx5: fix an uninitialized variable' " Yuanhan Liu
2017-04-07  8:11 ` [dpdk-stable] patch 'mk: fix shell errors when building with clang' " Yuanhan Liu
2017-04-07  8:12 ` [dpdk-stable] patch 'mk: fix lib filtering when linking app' " Yuanhan Liu
2017-04-07  8:12 ` [dpdk-stable] patch 'examples/quota_watermark: fix requirement for 2M pages' " Yuanhan Liu
2017-04-07  8:12 ` Yuanhan Liu [this message]
2017-04-07  8:12 ` [dpdk-stable] patch 'net/virtio-user: fix overflow' " Yuanhan Liu
2017-04-07  8:12 ` [dpdk-stable] patch 'net/virtio: disable LSC interrupt if MSIX not enabled' " Yuanhan Liu

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=1491552724-3034-45-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=ciwillia@brocade.com \
    --cc=jblunck@infradead.org \
    --cc=skhare@vmware.com \
    --cc=stable@dpdk.org \
    /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).