[01/11] net/txgbe: add Tx queue maximum limit
Checks
Commit Message
Limit TX queue maximum to 64 when neither VT nor DCB are enabled,
since hardware doesn't support it.
Fixes: 75cbb1f0e8a6 ("net/txgbe: add device configuration")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/txgbe_ethdev.c | 13 +++++++++++++
drivers/net/txgbe/txgbe_ethdev.h | 1 +
2 files changed, 14 insertions(+)
@@ -1499,6 +1499,19 @@ txgbe_check_mq_mode(struct rte_eth_dev *dev)
return -EINVAL;
}
}
+
+ /*
+ * When DCB/VT is off, maximum number of queues changes
+ */
+ if (dev_conf->txmode.mq_mode == RTE_ETH_MQ_TX_NONE) {
+ if (nb_tx_q > TXGBE_NONE_MODE_TX_NB_QUEUES) {
+ PMD_INIT_LOG(ERR,
+ "Neither VT nor DCB are enabled, "
+ "nb_tx_q > %d.",
+ TXGBE_NONE_MODE_TX_NB_QUEUES);
+ return -EINVAL;
+ }
+ }
}
return 0;
}
@@ -41,6 +41,7 @@
/*Default value of Max Rx Queue*/
#define TXGBE_MAX_RX_QUEUE_NUM 128
#define TXGBE_VMDQ_DCB_NB_QUEUES TXGBE_MAX_RX_QUEUE_NUM
+#define TXGBE_NONE_MODE_TX_NB_QUEUES 64
#ifndef NBBY
#define NBBY 8 /* number of bits in a byte */