Skip to content

Commit

Permalink
net/txgbe: add Tx queue maximum limit
Browse files Browse the repository at this point in the history
[ upstream commit afcba8586daa5abc3868180e96601babfef3cfc1 ]

Limit TX queue maximum to 64 when neither VT nor DCB are enabled,
since hardware doesn't support it.

Fixes: 75cbb1f ("net/txgbe: add device configuration")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and kevintraynor committed Oct 31, 2023
1 parent eb6a3e4 commit 2a45502
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/net/txgbe/txgbe_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,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;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/net/txgbe/txgbe_ethdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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 */
Expand Down

0 comments on commit 2a45502

Please sign in to comment.