Skip to contentSkip to conversation

net/mlx5: update speed capabilities parsing on Linux

PATCH In review Thomas Monjalon 3 participants 5 messages Mar 5, 2024 – Mar 13, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net/mlx5: update speed capabilities parsing on Linux

Ease maintenance of speed capabilities parsing from ethtool by using rte_eth_link_speed_g*().
Functions in ethdev library are simpler, more complete, and easier to maintain.

---
 drivers/common/mlx5/linux/meson.build   |  22 ----
 drivers/net/mlx5/linux/mlx5_ethdev_os.c | 150 ++----------------------
 2 files changed, 7 insertions(+), 165 deletions(-)
drivers/common/mlx5/linux/meson.build +0 -22
index b3a64547c5..cdee40c553 100644
@@ -146,28 +146,6 @@ has_sym_args = [
             'MLX5_OPCODE_WAIT' ],
         [ 'HAVE_MLX5_OPCODE_ACCESS_ASO', 'infiniband/mlx5dv.h',
             'MLX5_OPCODE_ACCESS_ASO' ],
-        [ 'HAVE_SUPPORTED_40000baseKR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_40000baseKR4_Full' ],
-        [ 'HAVE_SUPPORTED_40000baseCR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_40000baseCR4_Full' ],
-        [ 'HAVE_SUPPORTED_40000baseSR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_40000baseSR4_Full' ],
-        [ 'HAVE_SUPPORTED_40000baseLR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_40000baseLR4_Full' ],
-        [ 'HAVE_SUPPORTED_56000baseKR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_56000baseKR4_Full' ],
-        [ 'HAVE_SUPPORTED_56000baseCR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_56000baseCR4_Full' ],
-        [ 'HAVE_SUPPORTED_56000baseSR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_56000baseSR4_Full' ],
-        [ 'HAVE_SUPPORTED_56000baseLR4_Full', 'linux/ethtool.h',
-            'SUPPORTED_56000baseLR4_Full' ],
-        [ 'HAVE_ETHTOOL_LINK_MODE_25G', 'linux/ethtool.h',
-            'ETHTOOL_LINK_MODE_25000baseCR_Full_BIT' ],
-        [ 'HAVE_ETHTOOL_LINK_MODE_50G', 'linux/ethtool.h',
-            'ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT' ],
-        [ 'HAVE_ETHTOOL_LINK_MODE_100G', 'linux/ethtool.h',
-            'ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT' ],
         [ 'HAVE_IFLA_NUM_VF', 'linux/if_link.h',
             'IFLA_NUM_VF' ],
         [ 'HAVE_IFLA_EXT_MASK', 'linux/if_link.h',
drivers/net/mlx5/linux/mlx5_ethdev_os.c +7 -143

192 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw

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

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).

---
 drivers/net/mlx5/mlx5_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_ethdev.c +2 -2
index fb6d9d28ba..aea799341c 100644
@@ -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 ||
Signature · 1 line
2.43.0
Acked-by on v1 2/2
#2 lore raw

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

Quoted 12 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, March 5, 2024 14:13
To: [email protected]
Cc: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Subject: [PATCH 2/2] net/mlx5: apply default tuning to future speeds

External email: Use caution opening links or attachments

Quoted 7 lines

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).

Best regards,
Dariusz Sosnowski

Acked-by on v1 1/2
#3 lore raw
In reply to Thomas Monjalon
Quoted 9 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, March 5, 2024 14:13
To: [email protected]
Cc: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Subject: [PATCH 1/2] net/mlx5: update speed capabilities parsing on Linux

Quoted 8 lines

External email: Use caution opening links or attachments

Ease maintenance of speed capabilities parsing from ethtool by using rte_eth_link_speed_g*().
Functions in ethdev library are simpler, more complete, and easier to maintain.

Best regards,
Dariusz Sosnowski

#4 lore raw
In reply to Thomas Monjalon

Hi,

Quoted 9 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, March 5, 2024 3:13 PM
To: [email protected]
Cc: Dariusz Sosnowski <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Subject: [PATCH 1/2] net/mlx5: update speed capabilities parsing on Linux

Quoted 6 lines

Ease maintenance of speed capabilities parsing from ethtool by using rte_eth_link_speed_g*().
Functions in ethdev library are simpler, more complete, and easier to maintain.

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh