DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/thunderx: fix start/stop with different queue size
@ 2016-07-04  7:16 Jerin Jacob
  2016-07-05  9:25 ` Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: Jerin Jacob @ 2016-07-04  7:16 UTC (permalink / raw)
  To: dev
  Cc: thomas.monjalon, bruce.richardson, Kamil Rytarowski, Zyta Szpak,
	Jerin Jacob

From: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>

Allocate maximum supported hardware ring hardware descriptors
memory on the first rte_eth_dma_zone_reserve call in-order to
get sufficient hardware ring buffer space on subsequent queue
setup request with different queue size.

Fixes: aa0d976e501d ("net/thunderx: add Rx queue setup and release")
Fixes: 3f3c6f9724a8 ("net/thunderx: add Tx queue setup and release")
Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")

Signed-off-by: Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
Signed-off-by: Zyta Szpak <zyta.szpak@semihalf.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 drivers/net/thunderx/base/nicvf_hw_defs.h | 3 +++
 drivers/net/thunderx/nicvf_ethdev.c       | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/thunderx/base/nicvf_hw_defs.h b/drivers/net/thunderx/base/nicvf_hw_defs.h
index 88ecd17..2f2b225 100644
--- a/drivers/net/thunderx/base/nicvf_hw_defs.h
+++ b/drivers/net/thunderx/base/nicvf_hw_defs.h
@@ -164,6 +164,7 @@
 #define RBDR_QUEUE_SZ_128K              (128 * 1024)
 #define RBDR_QUEUE_SZ_256K              (256 * 1024)
 #define RBDR_QUEUE_SZ_512K              (512 * 1024)
+#define RBDR_QUEUE_SZ_MAX               RBDR_QUEUE_SZ_512K
 
 #define RBDR_SIZE_SHIFT                 (13) /* 8k */
 
@@ -174,6 +175,7 @@
 #define SND_QUEUE_SZ_16K                (16 * 1024)
 #define SND_QUEUE_SZ_32K                (32 * 1024)
 #define SND_QUEUE_SZ_64K                (64 * 1024)
+#define SND_QUEUE_SZ_MAX                SND_QUEUE_SZ_64K
 
 #define SND_QSIZE_SHIFT                 (10) /* 1k */
 
@@ -184,6 +186,7 @@
 #define CMP_QUEUE_SZ_16K                (16 * 1024)
 #define CMP_QUEUE_SZ_32K                (32 * 1024)
 #define CMP_QUEUE_SZ_64K                (64 * 1024)
+#define CMP_QUEUE_SZ_MAX                CMP_QUEUE_SZ_64K
 
 #define CMP_QSIZE_SHIFT                 (10) /* 1k */
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 48ed381..f42de4b 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -495,7 +495,7 @@ nicvf_qset_cq_alloc(struct nicvf *nic, struct nicvf_rxq *rxq, uint16_t qidx,
 		    uint32_t desc_cnt)
 {
 	const struct rte_memzone *rz;
-	uint32_t ring_size = desc_cnt * sizeof(union cq_entry_t);
+	uint32_t ring_size = CMP_QUEUE_SZ_MAX * sizeof(union cq_entry_t);
 
 	rz = rte_eth_dma_zone_reserve(nic->eth_dev, "cq_ring", qidx, ring_size,
 					NICVF_CQ_BASE_ALIGN_BYTES, nic->node);
@@ -518,7 +518,7 @@ nicvf_qset_sq_alloc(struct nicvf *nic,  struct nicvf_txq *sq, uint16_t qidx,
 		    uint32_t desc_cnt)
 {
 	const struct rte_memzone *rz;
-	uint32_t ring_size = desc_cnt * sizeof(union sq_entry_t);
+	uint32_t ring_size = SND_QUEUE_SZ_MAX * sizeof(union sq_entry_t);
 
 	rz = rte_eth_dma_zone_reserve(nic->eth_dev, "sq", qidx, ring_size,
 				NICVF_SQ_BASE_ALIGN_BYTES, nic->node);
@@ -551,7 +551,7 @@ nicvf_qset_rbdr_alloc(struct nicvf *nic, uint32_t desc_cnt, uint32_t buffsz)
 		return -ENOMEM;
 	}
 
-	ring_size = sizeof(struct rbdr_entry_t) * desc_cnt;
+	ring_size = sizeof(struct rbdr_entry_t) * RBDR_QUEUE_SZ_MAX;
 	rz = rte_eth_dma_zone_reserve(nic->eth_dev, "rbdr", 0, ring_size,
 				   NICVF_RBDR_BASE_ALIGN_BYTES, nic->node);
 	if (rz == NULL) {
-- 
2.5.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-05  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-04  7:16 [dpdk-dev] [PATCH] net/thunderx: fix start/stop with different queue size Jerin Jacob
2016-07-05  9:25 ` Bruce Richardson

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).