DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbe: add TX queue number check
@ 2016-03-22  8:08 Wenzhuo Lu
  2016-03-22  8:42 ` Qiu, Michael
  2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
  0 siblings, 2 replies; 18+ messages in thread
From: Wenzhuo Lu @ 2016-03-22  8:08 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Ixgbe supports at most 128 TX queues. But in none VT nor DCB mode
the queues 64 ~ 127 should not be used. Ixgbe doesn't do any check
about that. If a queue larger than 64 is used, the TX packets will
be dropped silently. It's hard to debug.
This check is added to forbid using queue number larger than 64
during device configuration, so the user can know the problem as
early as possible.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Reported-by: Antonio Fischetti <antonio.fischetti@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 ++++++++++-
 drivers/net/ixgbe/ixgbe_ethdev.h |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 5371720..dd6d00e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1862,7 +1862,7 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 {
 	struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
 	uint16_t nb_rx_q = dev->data->nb_rx_queues;
-	uint16_t nb_tx_q = dev->data->nb_rx_queues;
+	uint16_t nb_tx_q = dev->data->nb_tx_queues;
 
 	if (RTE_ETH_DEV_SRIOV(dev).active != 0) {
 		/* check multi-queue mode */
@@ -2002,6 +2002,15 @@ ixgbe_check_mq_mode(struct rte_eth_dev *dev)
 				return -EINVAL;
 			}
 		}
+
+		if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE) {
+			if (nb_tx_q > IXGBE_NONE_VT_DCB_MAX_TXQ_NB) {
+				PMD_INIT_LOG(ERR,
+					     "None VT nor DCB, nb_tx_q > %d.",
+					     IXGBE_NONE_VT_DCB_MAX_TXQ_NB);
+				return -EINVAL;
+			}
+		}
 	}
 	return 0;
 }
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h
index 5c3aa16..50ee73f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/ixgbe/ixgbe_ethdev.h
@@ -61,6 +61,7 @@
 #define IXGBE_MAX_RX_QUEUE_NUM	128
 #define IXGBE_VMDQ_DCB_NB_QUEUES     IXGBE_MAX_RX_QUEUE_NUM
 #define IXGBE_DCB_NB_QUEUES          IXGBE_MAX_RX_QUEUE_NUM
+#define IXGBE_NONE_VT_DCB_MAX_TXQ_NB 64
 
 #ifndef NBBY
 #define NBBY	8	/* number of bits in a byte */
-- 
1.9.3

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

end of thread, other threads:[~2016-03-26  9:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-22  8:08 [dpdk-dev] [PATCH] ixgbe: add TX queue number check Wenzhuo Lu
2016-03-22  8:42 ` Qiu, Michael
2016-03-23 15:28 ` [dpdk-dev] [PATCH v2] ixgbe: add check for tx queue number Pablo de Lara
2016-03-24  8:09   ` Fischetti, Antonio
2016-03-24  8:40   ` Fischetti, Antonio
2016-03-24 10:27     ` De Lara Guarch, Pablo
2016-03-24 15:17   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
2016-03-24 15:22     ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Pablo de Lara
2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: fix incorrect tx queue number assignment Pablo de Lara
2016-03-24 16:57         ` Mcnamara, John
2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 2/3] ethdev: copy device configuration earlier Pablo de Lara
2016-03-24 16:57         ` Mcnamara, John
2016-03-24 15:22       ` [dpdk-dev] [PATCH v4 3/3] ixgbe: fix incorrect max tx queue number Pablo de Lara
2016-03-24 16:58         ` Mcnamara, John
2016-03-26  9:10           ` Fischetti, Antonio
2016-03-24 17:44       ` [dpdk-dev] [PATCH v4 0/3] Fix incorrect max TX queue numbers for ixgbe Bruce Richardson
2016-03-24 17:46         ` Bruce Richardson
2016-03-26  9:17     ` [dpdk-dev] [PATCH v3] ixgbe: add check for tx queue number Fischetti, Antonio

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