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: sta...@dpdk.org Signed-off-by: Jiawen Wu <jiawe...@trustnetic.com> --- drivers/net/txgbe/txgbe_ethdev.c | 13 +++++++++++++ drivers/net/txgbe/txgbe_ethdev.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 15911a3621..479cd810f8 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -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; } diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h index 6b296d6fd1..7feb45d0cf 100644 --- a/drivers/net/txgbe/txgbe_ethdev.h +++ b/drivers/net/txgbe/txgbe_ethdev.h @@ -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 */ -- 2.27.0