Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'mlx5-misc-enhancements-2025-02-19'

Tariq Toukan says:

====================
mlx5 misc enhancements 2025-02-19

This small series enhances the mlx5 ethtool link speed code (no
functional change), in addition to a Kconfig description enhancement.
====================

Link: https://patch.msgid.link/20250219114112.403808-1-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+21 -45
+2 -2
drivers/net/ethernet/mellanox/mlx5/core/Kconfig
··· 80 80 default y 81 81 help 82 82 mlx5 ConnectX offloads support for Ethernet Bridging (BRIDGE). 83 - Enable adding representors of mlx5 uplink and VF ports to Bridge and 84 - offloading rules for traffic between such ports. Supports VLANs (trunk and 83 + Enable offloading FDB rules from a bridge device containing 84 + representors of mlx5 uplink and VF ports. Supports VLANs (trunk and 85 85 access modes). 86 86 87 87 config MLX5_CLS_ACT
+19 -43
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
··· 260 260 ETHTOOL_LINK_MODE_800000baseVR4_Full_BIT); 261 261 } 262 262 263 - static void mlx5e_ethtool_get_speed_arr(struct mlx5_core_dev *mdev, 263 + static void mlx5e_ethtool_get_speed_arr(bool ext, 264 264 struct ptys2ethtool_config **arr, 265 265 u32 *size) 266 266 { 267 - bool ext = mlx5_ptys_ext_supported(mdev); 268 - 269 267 *arr = ext ? ptys2ext_ethtool_table : ptys2legacy_ethtool_table; 270 268 *size = ext ? ARRAY_SIZE(ptys2ext_ethtool_table) : 271 269 ARRAY_SIZE(ptys2legacy_ethtool_table); ··· 910 912 return mlx5e_ethtool_set_per_queue_coalesce(priv, queue, coal); 911 913 } 912 914 913 - static void ptys2ethtool_supported_link(struct mlx5_core_dev *mdev, 914 - unsigned long *supported_modes, 915 - u32 eth_proto_cap) 915 + static void ptys2ethtool_process_link(u32 eth_eproto, bool ext, bool advertised, 916 + unsigned long *modes) 916 917 { 917 - unsigned long proto_cap = eth_proto_cap; 918 + unsigned long eproto = eth_eproto; 918 919 struct ptys2ethtool_config *table; 919 920 u32 max_size; 920 921 int proto; 921 922 922 - mlx5e_ethtool_get_speed_arr(mdev, &table, &max_size); 923 - for_each_set_bit(proto, &proto_cap, max_size) 924 - bitmap_or(supported_modes, supported_modes, 925 - table[proto].supported, 926 - __ETHTOOL_LINK_MODE_MASK_NBITS); 927 - } 928 - 929 - static void ptys2ethtool_adver_link(unsigned long *advertising_modes, 930 - u32 eth_proto_cap, bool ext) 931 - { 932 - unsigned long proto_cap = eth_proto_cap; 933 - struct ptys2ethtool_config *table; 934 - u32 max_size; 935 - int proto; 936 - 937 - table = ext ? ptys2ext_ethtool_table : ptys2legacy_ethtool_table; 938 - max_size = ext ? ARRAY_SIZE(ptys2ext_ethtool_table) : 939 - ARRAY_SIZE(ptys2legacy_ethtool_table); 940 - 941 - for_each_set_bit(proto, &proto_cap, max_size) 942 - bitmap_or(advertising_modes, advertising_modes, 943 - table[proto].advertised, 923 + mlx5e_ethtool_get_speed_arr(ext, &table, &max_size); 924 + for_each_set_bit(proto, &eproto, max_size) 925 + bitmap_or(modes, modes, 926 + advertised ? 927 + table[proto].advertised : table[proto].supported, 944 928 __ETHTOOL_LINK_MODE_MASK_NBITS); 945 929 } 946 930 ··· 1108 1128 struct ethtool_link_ksettings *link_ksettings) 1109 1129 { 1110 1130 unsigned long *supported = link_ksettings->link_modes.supported; 1111 - ptys2ethtool_supported_link(mdev, supported, eth_proto_cap); 1131 + bool ext = mlx5_ptys_ext_supported(mdev); 1132 + 1133 + ptys2ethtool_process_link(eth_proto_cap, ext, false, supported); 1112 1134 1113 1135 ethtool_link_ksettings_add_link_mode(link_ksettings, supported, Pause); 1114 1136 } 1115 1137 1116 - static void get_advertising(u32 eth_proto_cap, u8 tx_pause, u8 rx_pause, 1138 + static void get_advertising(u32 eth_proto_admin, u8 tx_pause, u8 rx_pause, 1117 1139 struct ethtool_link_ksettings *link_ksettings, 1118 1140 bool ext) 1119 1141 { 1120 1142 unsigned long *advertising = link_ksettings->link_modes.advertising; 1121 - ptys2ethtool_adver_link(advertising, eth_proto_cap, ext); 1122 - 1143 + ptys2ethtool_process_link(eth_proto_admin, ext, true, advertising); 1123 1144 if (rx_pause) 1124 1145 ethtool_link_ksettings_add_link_mode(link_ksettings, advertising, Pause); 1125 1146 if (tx_pause ^ rx_pause) ··· 1176 1195 unsigned long *lp_advertising = link_ksettings->link_modes.lp_advertising; 1177 1196 bool ext = mlx5_ptys_ext_supported(mdev); 1178 1197 1179 - ptys2ethtool_adver_link(lp_advertising, eth_proto_lp, ext); 1198 + ptys2ethtool_process_link(eth_proto_lp, ext, true, lp_advertising); 1180 1199 } 1181 1200 1182 1201 static int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, ··· 1344 1363 return bitmap_intersects(modes, adver, __ETHTOOL_LINK_MODE_MASK_NBITS); 1345 1364 } 1346 1365 1347 - static bool ext_requested(u8 autoneg, const unsigned long *adver, bool ext_supported) 1348 - { 1349 - bool ext_link_mode = ext_link_mode_requested(adver); 1350 - 1351 - return autoneg == AUTONEG_ENABLE ? ext_link_mode : ext_supported; 1352 - } 1353 - 1354 1366 static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, 1355 1367 const struct ethtool_link_ksettings *link_ksettings) 1356 1368 { ··· 1353 1379 bool an_changes = false; 1354 1380 u8 an_disable_admin; 1355 1381 bool ext_supported; 1382 + bool ext_requested; 1356 1383 u8 an_disable_cap; 1357 1384 bool an_disable; 1358 1385 u32 link_modes; ··· 1370 1395 speed = link_ksettings->base.speed; 1371 1396 1372 1397 ext_supported = mlx5_ptys_ext_supported(mdev); 1373 - ext = ext_requested(autoneg, adver, ext_supported); 1374 - if (!ext_supported && ext) 1398 + ext_requested = ext_link_mode_requested(adver); 1399 + if (!ext_supported && ext_requested) 1375 1400 return -EOPNOTSUPP; 1376 1401 1402 + ext = autoneg == AUTONEG_ENABLE ? ext_requested : ext_supported; 1377 1403 ethtool2ptys_adver_func = ext ? mlx5e_ethtool2ptys_ext_adver_link : 1378 1404 mlx5e_ethtool2ptys_adver_link; 1379 1405 err = mlx5_port_query_eth_proto(mdev, 1, ext, &eproto);