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 bluca committed Oct 18, 2023
1 parent fec23fd commit f3d6cc7
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 @@ -1277,6 +1277,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 == 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 @@ -28,6 +28,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 f3d6cc7

Please sign in to comment.