[PATCH 2/2] net/mlx5: apply default tuning to future speeds

Thomas Monjalon thomas at monjalon.net
Tue Mar 5 14:12:41 CET 2024


Some default parameters for number of queues and ring size
are different starting with 100G speed capability.

Instead of checking all speed above 100G, make sure it is applied
for any speed capability newer than 100G (including 400G for instance).

Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
 drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index fb6d9d28ba..aea799341c 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -242,8 +242,8 @@ mlx5_set_default_params(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 	info->default_txportconf.ring_size = 256;
 	info->default_rxportconf.burst_size = MLX5_RX_DEFAULT_BURST;
 	info->default_txportconf.burst_size = MLX5_TX_DEFAULT_BURST;
-	if ((priv->link_speed_capa & RTE_ETH_LINK_SPEED_200G) |
-		(priv->link_speed_capa & RTE_ETH_LINK_SPEED_100G)) {
+	if (priv->link_speed_capa >> rte_bsf32(RTE_ETH_LINK_SPEED_100G)) {
+		/* if supports at least 100G */
 		info->default_rxportconf.nb_queues = 16;
 		info->default_txportconf.nb_queues = 16;
 		if (dev->data->nb_rx_queues > 2 ||
-- 
2.43.0



More information about the dev mailing list