Mellanox, mlx5 updates 2019-02-19
Subsystems (6)
Hi Dave,
This series provides some updates to mlx5 driver.
In addition, there is one patch that defines new 50Gbps per lane link modes in include/uapi/linux/ethtool.h:
("ethtool: Added support for 50Gbps per lane link modes")
For more information please see tag log below.
Please pull and let me know if there is any problem.
Thanks,
Saeed.
---
The following changes since commit 5770117186f018479b44e7d17fb2501c865c0c84:
Merge branch 'bnxt_en-Update-for-net-next' (2019-02-19 10:45:14 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-updates-2019-02-19
for you to fetch changes up to 1c50d369f560809d45e75fa9d7d6b3901192c18b:
net/mlx5: E-Switch, Disable esw manager vport correctly (2019-02-19 14:15:04 -0800)
----------------------------------------------------------------
mlx5-updates-2019-02-19
This series includes misc updates to mlx5 drivers and one ethtool update.
1) From Aya Levin:
- ethtool: Define 50Gbps per lane link modes
- add support for 50Gbps per lane link modes in mlx5 driver
2) From Tariq Toukan,
- Add a helper function to unify mlx5 resource reloading
3) From Vlad Buslov,
- Remove wrong and superfluous tc pedit header type check
4) From Tonghao Zhang,
- Some refactoring in en_tc.c to simplify the mlx5e_tc_add_fdb_flow
5) From Leon Romanovsky & Saeed,
- Compilation warning fixes
6) From Bodong wang,
- E-Switch fixes that are related to the SmarNIC series
----------------------------------------------------------------
Aya Levin (2):
ethtool: Added support for 50Gbps per lane link modes net/mlx5: ethtool, Add ethtool support for 50Gbps per lane link modes
Bodong Wang (2):
net/mlx5: E-Switch, Fix the warning on vport index out of range net/mlx5: E-Switch, Disable esw manager vport correctly
Leon Romanovsky (2):
net/mlx5e: Add missing static function annotation net/mlx5: Delete unused FPGA QPN variable
Saeed Mahameed (1):
net/mlx5e: Remove unused variable ‘esw’
Tariq Toukan (1):
net/mlx5e: Wrap the open and apply of channels in one fail-safe function
Tonghao Zhang (2):
net/mlx5e: Introduce mlx5e_flow_esw_attr_init() helper net/mlx5e: Remove 'parse_attr' argument in mlx5e_tc_add_fdb_flow()
Vlad Buslov (1):
net/mlx5e: Remove wrong and superfluous tc pedit header type check
drivers/net/ethernet/mellanox/mlx5/core/en.h | 6 +- .../ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 297 +++++++++++++-------- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 33 ++- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 51 ++-- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 5 +- .../net/ethernet/mellanox/mlx5/core/fpga/core.c | 2 - .../net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 4 +- include/uapi/linux/ethtool.h | 18 +- 10 files changed, 273 insertions(+), 149 deletions(-)
PATCH 1/11 ethtool: Added support for 50Gbps per lane link modes
From: Aya Levin <[email protected]>
Added support for 50Gbps per lane link modes. Define various 50G, 100G and 200G link modes using it.
--- include/uapi/linux/ethtool.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
include/uapi/linux/ethtool.h +17 -1
@@ -1453,6 +1453,21 @@ enum ethtool_link_mode_bit_indices {ETHTOOL_LINK_MODE_FEC_NONE_BIT =49 ,ETHTOOL_LINK_MODE_FEC_RS_BIT =50 ,ETHTOOL_LINK_MODE_FEC_BASER_BIT =51 , + ETHTOOL_LINK_MODE_50000baseKR_Full_BIT =52 , + ETHTOOL_LINK_MODE_50000baseSR_Full_BIT =53 , + ETHTOOL_LINK_MODE_50000baseCR_Full_BIT =54 , + ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT =55 , + ETHTOOL_LINK_MODE_50000baseDR_Full_BIT =56 , + ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT =57 , + ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT =58 , + ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT =59 , + ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT =60 , + ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT =61 , + ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT =62 , + ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT =63 , + ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT =64 , + ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT =65 , + ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT =66 ,/* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
@@ -1461,7 +1476,7 @@ enum ethtool_link_mode_bit_indices {*/ __ETHTOOL_LINK_MODE_LAST - = ETHTOOL_LINK_MODE_FEC_BASER_BIT, + = ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT, };#define __ETHTOOL_LINK_MODE_LEGACY_MASK (base_name) \
@@ -1569,6 +1584,7 @@ enum ethtool_link_mode_bit_indices {#define SPEED_50000 50000#define SPEED_56000 56000#define SPEED_100000 100000 +#define SPEED_200000 200000#define SPEED_UNKNOWN -1
Signature · 1 line
2.20.1
PATCH 2/11 net/mlx5: ethtool, Add ethtool support for 50Gbps per lane link modes
In reply to Saeed MahameedFrom: Aya Levin <[email protected]>
In previous patch, driver added new speed modes: 50Gbps per lane support for 50G/100G/200G. This patch modifies mlx5e_get_link_ksettings and mlx5e_set_link_ksettings to set and get these link modes via ethtool. In order to do so, added mapping of new HW bits to ethtool bitmap and enforce mutual exclusion between extended link modes and previously defined link modes.
--- .../ethernet/mellanox/mlx5/core/en_ethtool.c | 243 +++++++++++++----- 1 file changed, 181 insertions(+), 62 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +181 -62
@@ -63,76 +63,147 @@ struct ptys2ethtool_config {__ETHTOOL_DECLARE_LINK_MODE_MASK (advertised); }; -static struct ptys2ethtool_config ptys2ethtool_table[MLX5E_LINK_MODES_NUMBER ]; +static +struct ptys2ethtool_config ptys2legacy_ethtool_table[MLX5E_LINK_MODES_NUMBER ]; +static +struct ptys2ethtool_config ptys2ext_ethtool_table[MLX5E_EXT_LINK_MODES_NUMBER ]; -#define MLX5_BUILD_PTYS2ETHTOOL_CONFIG (reg_, ...) \ +#define MLX5_BUILD_PTYS2ETHTOOL_CONFIG (reg_, table, ...) \ ({ \ struct ptys2ethtool_config *cfg; \ const unsigned int modes[] = { __VA_ARGS__ }; \ - unsigned int i; \ - cfg = &ptys2ethtool_table[reg_]; \ + unsigned int i, bit, idx; \ + cfg = &ptys2##table##_ethtool_table[reg_]; \ bitmap_zero(cfg->supported, \ __ETHTOOL_LINK_MODE_MASK_NBITS); \ bitmap_zero(cfg->advertised, \ __ETHTOOL_LINK_MODE_MASK_NBITS); \ for (i = 0 ; i < ARRAY_SIZE(modes) ; ++i) { \ - __set_bit(modes[i], cfg->supported); \ - __set_bit(modes[i], cfg->advertised); \ + bit = modes[i] % 64; \ + idx = modes[i] / 64; \ + __set_bit(bit, &cfg->supported[idx]); \ + __set_bit(bit, &cfg->advertised[idx]); \ } \ })void mlx5e_build_ptys2ethtool_map (void ) { -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_1000BASE_CX_SGMII , +memset (ptys2legacy_ethtool_table,0 ,sizeof (ptys2legacy_ethtool_table)); +memset (ptys2ext_ethtool_table,0 ,sizeof (ptys2ext_ethtool_table)); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_1000BASE_CX_SGMII , legacy, ETHTOOL_LINK_MODE_1000baseKX_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_1000BASE_KX , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_1000BASE_KX , legacy, ETHTOOL_LINK_MODE_1000baseKX_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_CX4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_CX4 , legacy, ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_KX4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_KX4 , legacy, ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_KR , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_KR , legacy, ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_20GBASE_KR2 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_20GBASE_KR2 , legacy, ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_CR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_CR4 , legacy, ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_KR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_KR4 , legacy, ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_56GBASE_R4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_56GBASE_R4 , legacy, ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_CR , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_CR , legacy, ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_SR , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_SR , legacy, ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_ER , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_ER , legacy, ETHTOOL_LINK_MODE_10000baseKR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_SR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_SR4 , legacy, ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_LR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_LR4 , legacy, ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GBASE_SR2 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GBASE_SR2 , legacy, ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_CR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_CR4 , legacy, ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_SR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_SR4 , legacy, ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_KR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_KR4 , legacy, ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_LR4 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GBASE_LR4 , legacy, ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_T , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_T , legacy, ETHTOOL_LINK_MODE_10000baseT_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GBASE_CR , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GBASE_CR , legacy, ETHTOOL_LINK_MODE_25000baseCR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GBASE_KR , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GBASE_KR , legacy, ETHTOOL_LINK_MODE_25000baseKR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GBASE_SR , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GBASE_SR , legacy, ETHTOOL_LINK_MODE_25000baseSR_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GBASE_CR2 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GBASE_CR2 , legacy, ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT); -MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GBASE_KR2 , +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GBASE_KR2 , legacy, ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_SGMII_100M , ext, + ETHTOOL_LINK_MODE_100baseT_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_1000BASE_X_SGMII , ext, + ETHTOOL_LINK_MODE_1000baseT_Full_BIT, + ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, + ETHTOOL_LINK_MODE_1000baseX_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_5GBASE_R , ext, + ETHTOOL_LINK_MODE_5000baseT_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_10GBASE_XFI_XAUI_1 , ext, + ETHTOOL_LINK_MODE_10000baseT_Full_BIT, + ETHTOOL_LINK_MODE_10000baseKR_Full_BIT, + ETHTOOL_LINK_MODE_10000baseR_FEC_BIT, + ETHTOOL_LINK_MODE_10000baseCR_Full_BIT, + ETHTOOL_LINK_MODE_10000baseSR_Full_BIT, + ETHTOOL_LINK_MODE_10000baseLR_Full_BIT, + ETHTOOL_LINK_MODE_10000baseER_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_40GBASE_XLAUI_4_XLPPI_4 , ext, + ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT, + ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT, + ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT, + ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_25GAUI_1_25GBASE_CR_KR , ext, + ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, + ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, + ETHTOOL_LINK_MODE_25000baseSR_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2 , + ext, + ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT, + ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT, + ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_50GAUI_1_LAUI_1_50GBASE_CR_KR , ext, + ETHTOOL_LINK_MODE_50000baseKR_Full_BIT, + ETHTOOL_LINK_MODE_50000baseSR_Full_BIT, + ETHTOOL_LINK_MODE_50000baseCR_Full_BIT, + ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, + ETHTOOL_LINK_MODE_50000baseDR_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_CAUI_4_100GBASE_CR4_KR4 , ext, + ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, + ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT, + ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, + ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_100GAUI_2_100GBASE_CR2_KR2 , ext, + ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT, + ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT, + ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT, + ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT, + ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT); +MLX5_BUILD_PTYS2ETHTOOL_CONFIG (MLX5E_200GAUI_4_200GBASE_CR4_KR4 , ext, + ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT, + ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT, + ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT, + ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT, + ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT); +} + +static void mlx5e_ethtool_get_speed_arr (struct mlx5_core_dev *mdev, +struct ptys2ethtool_config **arr, +u32 *size) +{ +bool ext =MLX5_CAP_PCAM_FEATURE (mdev, ptys_extended_ethernet); + + *arr = ext ? ptys2ext_ethtool_table : ptys2legacy_ethtool_table; + *size = ext ?ARRAY_SIZE (ptys2ext_ethtool_table) : +ARRAY_SIZE (ptys2legacy_ethtool_table); }typedef int (*mlx5e_pflag_handler )(struct net_device *netdev,bool enable);
@@ -526,27 +597,35 @@ static int mlx5e_set_coalesce(struct net_device *netdev,return mlx5e_ethtool_set_coalesce (priv, coal); } -static void ptys2ethtool_supported_link (unsigned long *supported_modes, +static void ptys2ethtool_supported_link (struct mlx5_core_dev *mdev, +unsigned long *supported_modes,u32 eth_proto_cap) {unsigned long proto_cap = eth_proto_cap; +struct ptys2ethtool_config *table; +u32 max_size;int proto; -for_each_set_bit (proto, &proto_cap,MLX5E_LINK_MODES_NUMBER ) +mlx5e_ethtool_get_speed_arr (mdev, &table, &max_size); +for_each_set_bit (proto, &proto_cap, max_size)bitmap_or (supported_modes, supported_modes, - ptys2ethtool_table[proto].supported, + table[proto].supported, __ETHTOOL_LINK_MODE_MASK_NBITS); } -static void ptys2ethtool_adver_link (unsigned long *advertising_modes, +static void ptys2ethtool_adver_link (struct mlx5_core_dev *mdev, +unsigned long *advertising_modes,u32 eth_proto_cap) {unsigned long proto_cap = eth_proto_cap; +struct ptys2ethtool_config *table; +u32 max_size;int proto; -for_each_set_bit (proto, &proto_cap,MLX5E_LINK_MODES_NUMBER ) +mlx5e_ethtool_get_speed_arr (mdev, &table, &max_size); +for_each_set_bit (proto, &proto_cap, max_size)bitmap_or (advertising_modes, advertising_modes, - ptys2ethtool_table[proto].advertised, + table[proto].advertised, __ETHTOOL_LINK_MODE_MASK_NBITS); }
@@ -716,22 +795,22 @@ static void get_speed_duplex(struct net_device *netdev, link_ksettings->base.duplex = duplex; } -static void get_supported (u32 eth_proto_cap, +static void get_supported (struct mlx5_core_dev *mdev,u32 eth_proto_cap,struct ethtool_link_ksettings *link_ksettings) {unsigned long *supported = link_ksettings->link_modes.supported; +ptys2ethtool_supported_link (mdev, supported, eth_proto_cap); -ptys2ethtool_supported_link (supported, eth_proto_cap);ethtool_link_ksettings_add_link_mode (link_ksettings, supported, Pause); } -static void get_advertising (u32 eth_proto_cap,u8 tx_pause, -u8 rx_pause, +static void get_advertising (struct mlx5_core_dev *mdev,u32 eth_proto_cap, +u8 tx_pause,u8 rx_pause,struct ethtool_link_ksettings *link_ksettings) {unsigned long *advertising = link_ksettings->link_modes.advertising; +ptys2ethtool_adver_link (mdev, advertising, eth_proto_cap); -ptys2ethtool_adver_link (advertising, eth_proto_cap);if (rx_pause)ethtool_link_ksettings_add_link_mode (link_ksettings, advertising, Pause);if (tx_pause ^ rx_pause)
@@ -781,12 +860,12 @@ static u8 get_connector_port(u32 eth_proto, u8 connector_type)return PORT_OTHER ; } -static void get_lp_advertising (u32 eth_proto_lp, +static void get_lp_advertising (struct mlx5_core_dev *mdev,u32 eth_proto_lp,struct ethtool_link_ksettings *link_ksettings) {unsigned long *lp_advertising = link_ksettings->link_modes.lp_advertising; -ptys2ethtool_adver_link (lp_advertising, eth_proto_lp); +ptys2ethtool_adver_link (mdev, lp_advertising, eth_proto_lp); } int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,
@@ -803,6 +882,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv,u8 an_disable_admin;u8 an_status;u8 connector_type; +bool ext;int err; err =mlx5_query_port_ptys (mdev, out,sizeof (out),MLX5_PTYS_EN ,1 );
@@ -811,22 +891,25 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, __func__, err); goto err_query_regs; } - - eth_proto_cap =MLX5_GET (ptys_reg, out, eth_proto_capability); - eth_proto_admin =MLX5_GET (ptys_reg, out, eth_proto_admin); - eth_proto_oper =MLX5_GET (ptys_reg, out, eth_proto_oper); - eth_proto_lp =MLX5_GET (ptys_reg, out, eth_proto_lp_advertise); - an_disable_admin =MLX5_GET (ptys_reg, out, an_disable_admin); - an_status =MLX5_GET (ptys_reg, out, an_status); - connector_type =MLX5_GET (ptys_reg, out, connector_type); + ext =MLX5_CAP_PCAM_FEATURE (mdev, ptys_extended_ethernet); + eth_proto_cap =MLX5_GET_ETH_PROTO (ptys_reg, out, ext, + eth_proto_capability); + eth_proto_admin =MLX5_GET_ETH_PROTO (ptys_reg, out, ext, + eth_proto_admin); + eth_proto_oper =MLX5_GET_ETH_PROTO (ptys_reg, out, ext, + eth_proto_oper); + eth_proto_lp =MLX5_GET (ptys_reg, out, eth_proto_lp_advertise); + an_disable_admin =MLX5_GET (ptys_reg, out, an_disable_admin); + an_status =MLX5_GET (ptys_reg, out, an_status); + connector_type =MLX5_GET (ptys_reg, out, connector_type);mlx5_query_port_pause (mdev, &rx_pause, &tx_pause);ethtool_link_ksettings_zero_link_mode (link_ksettings, supported);ethtool_link_ksettings_zero_link_mode (link_ksettings, advertising); -get_supported (eth_proto_cap, link_ksettings); -get_advertising (eth_proto_admin, tx_pause, rx_pause, link_ksettings); +get_supported (mdev, eth_proto_cap, link_ksettings); +get_advertising (mdev, eth_proto_admin, tx_pause, rx_pause, link_ksettings);get_speed_duplex (priv->netdev, eth_proto_oper, link_ksettings); eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
@@ -835,7 +918,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, connector_type);ptys2ethtool_supported_advertised_port (link_ksettings, eth_proto_admin, connector_type); -get_lp_advertising (eth_proto_lp, link_ksettings); +get_lp_advertising (mdev, eth_proto_lp, link_ksettings);if (an_status ==MLX5_AN_COMPLETE ) ethtool_link_ksettings_add_link_mode(link_ksettings,
@@ -874,7 +957,9 @@ static u32 mlx5e_ethtool2ptys_adver_link(const unsigned long *link_modes)u32 i, ptys_modes =0 ;for (i =0 ; i <MLX5E_LINK_MODES_NUMBER ; ++i) { -if (bitmap_intersects (ptys2ethtool_table[i].advertised, +if (*ptys2legacy_ethtool_table[i].advertised ==0 ) +continue ; +if (bitmap_intersects (ptys2legacy_ethtool_table[i].advertised, link_modes, __ETHTOOL_LINK_MODE_MASK_NBITS)) ptys_modes |=MLX5E_PROT_MASK (i);
@@ -883,6 +968,25 @@ static u32 mlx5e_ethtool2ptys_adver_link(const unsigned long *link_modes)return ptys_modes; } +static u32 mlx5e_ethtool2ptys_ext_adver_link (const unsigned long *link_modes) +{ +u32 i, ptys_modes =0 ; +unsigned long modes[2 ]; + +for (i =0 ; i <MLX5E_EXT_LINK_MODES_NUMBER ; ++i) { +if (*ptys2ext_ethtool_table[i].advertised ==0 ) +continue ; +memset (modes,0 ,sizeof (modes)); +bitmap_and (modes, ptys2ext_ethtool_table[i].advertised, + link_modes, __ETHTOOL_LINK_MODE_MASK_NBITS); + +if (modes[0 ] == ptys2ext_ethtool_table[i].advertised[0 ] && + modes[1 ] == ptys2ext_ethtool_table[i].advertised[1 ]) + ptys_modes |=MLX5E_PROT_MASK (i); + } +return ptys_modes; +} +int mlx5e_ethtool_set_link_ksettings (struct mlx5e_priv *priv,const struct ethtool_link_ksettings *link_ksettings) {
@@ -890,6 +994,8 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,struct mlx5e_port_eth_proto eproto;bool an_changes = false;u8 an_disable_admin; +bool ext_supported; +bool ext_requested;u8 an_disable_cap;bool an_disable;u32 link_modes;
@@ -897,18 +1003,31 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,u32 speed;int err; - speed = link_ksettings->base.speed; +u32 (*ethtool2ptys_adver_func)(const unsigned long *adver); - link_modes = link_ksettings->base.autoneg ==AUTONEG_ENABLE ? -mlx5e_ethtool2ptys_adver_link (link_ksettings->link_modes.advertising) : -mlx5e_port_speed2linkmodes (mdev, speed); +#define MLX5E_PTYS_EXT ((1ULL << ETHTOOL_LINK_MODE_50000baseKR_Full_BIT) - 1) + + ext_requested = (link_ksettings->link_modes.advertising[0 ] > +MLX5E_PTYS_EXT ); + ext_supported =MLX5_CAP_PCAM_FEATURE (mdev, ptys_extended_ethernet); + +/*when ptys_extended_ethernet is set legacy link modes are deprecated */ +if (ext_requested != ext_supported) +return -EPROTONOSUPPORT ; - err =mlx5_port_query_eth_proto (mdev,1 , false, &eproto); + speed = link_ksettings->base.speed; + ethtool2ptys_adver_func = ext_requested ? + mlx5e_ethtool2ptys_ext_adver_link : + mlx5e_ethtool2ptys_adver_link; + err =mlx5_port_query_eth_proto (mdev,1 , ext_supported, &eproto);if (err) {netdev_err (priv->netdev,"%s: query port eth proto failed: %d\n" , __func__, err); goto out; } + link_modes = link_ksettings->base.autoneg ==AUTONEG_ENABLE ? +ethtool2ptys_adver_func (link_ksettings->link_modes.advertising) : +mlx5e_port_speed2linkmodes (mdev, speed); link_modes = link_modes & eproto.cap;if (!link_modes) {
@@ -928,7 +1047,7 @@ int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,if (!an_changes && link_modes == eproto.admin) goto out; -mlx5_port_set_eth_ptys (mdev, an_disable, link_modes, false); +mlx5_port_set_eth_ptys (mdev, an_disable, link_modes, ext_supported);mlx5_toggle_port_link (mdev); out:
Signature · 1 line
2.20.1
PATCH 3/11 net/mlx5e: Wrap the open and apply of channels in one fail-safe function
In reply to Saeed MahameedFrom: Tariq Toukan <[email protected]>
Take into a function the common code structure of opening a side set of channels followed by a call to apply them.
--- drivers/net/ethernet/mellanox/mlx5/core/en.h | 6 +-- .../ethernet/mellanox/mlx5/core/en_dcbnl.c | 4 +- .../ethernet/mellanox/mlx5/core/en_ethtool.c | 54 +++++-------------- .../net/ethernet/mellanox/mlx5/core/en_main.c | 33 +++++++----- .../ethernet/mellanox/mlx5/core/ipoib/ipoib.c | 4 +- 5 files changed, 39 insertions(+), 62 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en.h +3 -3
@@ -858,9 +858,9 @@ void mlx5e_close_channels(struct mlx5e_channels *chs);* switching channels */ typedef int (*mlx5e_fp_hw_modify )(struct mlx5e_priv *priv); -void mlx5e_switch_priv_channels (struct mlx5e_priv *priv, -struct mlx5e_channels *new_chs, -mlx5e_fp_hw_modify hw_modify); +int mlx5e_safe_switch_channels (struct mlx5e_priv *priv, +struct mlx5e_channels *new_chs, +mlx5e_fp_hw_modify hw_modify);void mlx5e_activate_priv_channels (struct mlx5e_priv *priv);void mlx5e_deactivate_priv_channels (struct mlx5e_priv *priv);
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +1 -3
@@ -1126,9 +1126,7 @@ static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv) priv->channels.params.tx_min_inline_mode) goto out; -if (mlx5e_open_channels (priv, &new_channels)) - goto out; -mlx5e_switch_priv_channels (priv, &new_channels,NULL ); +mlx5e_safe_switch_channels (priv, &new_channels,NULL ); out:mutex_unlock (&priv->state_lock);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +12 -42
120 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +21 -12
@@ -2885,13 +2885,14 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv)mlx5e_deactivate_channels (&priv->channels); } -void mlx5e_switch_priv_channels (struct mlx5e_priv *priv, -struct mlx5e_channels *new_chs, -mlx5e_fp_hw_modify hw_modify) +static void mlx5e_switch_priv_channels (struct mlx5e_priv *priv, +struct mlx5e_channels *new_chs, +mlx5e_fp_hw_modify hw_modify) {struct net_device *netdev = priv->netdev;int new_num_txqs;int carrier_ok; + new_num_txqs = new_chs->num * new_chs->params.num_tc; carrier_ok =netif_carrier_ok (netdev);
@@ -2917,6 +2918,20 @@ void mlx5e_switch_priv_channels(struct mlx5e_priv *priv,netif_carrier_on (netdev); } +int mlx5e_safe_switch_channels (struct mlx5e_priv *priv, +struct mlx5e_channels *new_chs, +mlx5e_fp_hw_modify hw_modify) +{ +int err; + + err =mlx5e_open_channels (priv, new_chs); +if (err) +return err; + +mlx5e_switch_priv_channels (priv, new_chs, hw_modify); +return 0 ; +} +void mlx5e_timestamp_init (struct mlx5e_priv *priv) { priv->tstamp.tx_type =HWTSTAMP_TX_OFF ;
@@ -3333,13 +3348,12 @@ static int mlx5e_setup_tc_mqprio(struct net_device *netdev, goto out; } - err =mlx5e_open_channels (priv, &new_channels); + err =mlx5e_safe_switch_channels (priv, &new_channels,NULL );if (err) goto out; priv->max_opened_tc =max_t (u8, priv->max_opened_tc, new_channels.params.num_tc); -mlx5e_switch_priv_channels (priv, &new_channels,NULL ); out:mutex_unlock (&priv->state_lock);return err;
@@ -3549,11 +3563,7 @@ static int set_feature_lro(struct net_device *netdev, bool enable) goto out; } - err =mlx5e_open_channels (priv, &new_channels); -if (err) - goto out; - -mlx5e_switch_priv_channels (priv, &new_channels, mlx5e_modify_tirs_lro); + err =mlx5e_safe_switch_channels (priv, &new_channels, mlx5e_modify_tirs_lro); out:mutex_unlock (&priv->state_lock);return err;
@@ -3771,11 +3781,10 @@ int mlx5e_change_mtu(struct net_device *netdev, int new_mtu, goto out; } - err =mlx5e_open_channels (priv, &new_channels); + err =mlx5e_safe_switch_channels (priv, &new_channels, set_mtu_cb);if (err) goto out; -mlx5e_switch_priv_channels (priv, &new_channels, set_mtu_cb); netdev->mtu = new_channels.params.sw_mtu; out:
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +2 -2
@@ -446,11 +446,11 @@ static int mlx5i_change_mtu(struct net_device *netdev, int new_mtu) new_channels.params = *params; new_channels.params.sw_mtu = new_mtu; - err =mlx5e_open_channels (priv, &new_channels); + + err =mlx5e_safe_switch_channels (priv, &new_channels,NULL );if (err) goto out; -mlx5e_switch_priv_channels (priv, &new_channels,NULL ); netdev->mtu = new_channels.params.sw_mtu; out:
Signature · 1 line
2.20.1
PATCH 4/11 net/mlx5e: Remove wrong and superfluous tc pedit header type check
In reply to Saeed MahameedFrom: Vlad Buslov <[email protected]>
With recent introduction of flow_rule infrastructure drivers no longer directly include action headers, so it is no longer possible to use constants defined in them. Instead, one of flow_rule patches substituted pedit action header constant with hardcoded value '2' in mlx5 set_pedit_val() function conditional which verifies that header type is in range of values allowed by pedit action. That conditional is now both wrong (hardcoded value is '2' but __PEDIT_HDR_TYPE_MAX is 6 in current version) and superfluous (pedit action already verifies that header type is in allowed range during init). Remove the described check from mlx5 code.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +0 -3
@@ -1827,9 +1827,6 @@ static int set_pedit_val(u8 hdr_type, u32 mask, u32 val, u32 offset, {u32 *curr_pmask, *curr_pval; -if (hdr_type >=2 ) - goto out_err; - curr_pmask = (u32 *)(pedit_header (&hdrs->masks, hdr_type) + offset); curr_pval = (u32 *)(pedit_header (&hdrs->vals, hdr_type) + offset);
Signature · 1 line
2.20.1
PATCH 5/11 net/mlx5e: Introduce mlx5e_flow_esw_attr_init() helper
In reply to Saeed MahameedFrom: Tonghao Zhang <[email protected]>
Introduce the mlx5e_flow_esw_attr_init() helper
for simplifying codes.
--- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +29 -12
@@ -2733,6 +2733,30 @@ mlx5e_alloc_flow(struct mlx5e_priv *priv, int attr_size,return err; } +static void +mlx5e_flow_esw_attr_init (struct mlx5_esw_flow_attr *esw_attr, +struct mlx5e_priv *priv, +struct mlx5e_tc_flow_parse_attr *parse_attr, +struct tc_cls_flower_offload *f, +struct mlx5_eswitch_rep *in_rep, +struct mlx5_core_dev *in_mdev) +{ +struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; + + esw_attr->parse_attr = parse_attr; + esw_attr->chain = f->common.chain_index; + esw_attr->prio =TC_H_MAJ (f->common.prio) >>16 ; + + esw_attr->in_rep = in_rep; + esw_attr->in_mdev = in_mdev; + +if (MLX5_CAP_ESW (esw->dev, counter_eswitch_affinity) == +MLX5_COUNTER_SOURCE_ESWITCH ) + esw_attr->counter_dev = in_mdev; +else + esw_attr->counter_dev = priv->mdev; +} +static struct mlx5e_tc_flow * __mlx5e_add_fdb_flow(struct mlx5e_priv *priv, struct tc_cls_flower_offload *f,
@@ -2754,28 +2778,21 @@ __mlx5e_add_fdb_flow(struct mlx5e_priv *priv, &parse_attr, &flow);if (err) goto out; + parse_attr->filter_dev = filter_dev; - flow->esw_attr->parse_attr = parse_attr; +mlx5e_flow_esw_attr_init (flow->esw_attr, + priv, parse_attr, + f, in_rep, in_mdev); + err =parse_cls_flower (flow->priv, flow, &parse_attr->spec, f, filter_dev);if (err) goto err_free; - flow->esw_attr->chain = f->common.chain_index; - flow->esw_attr->prio =TC_H_MAJ (f->common.prio) >>16 ; err =parse_tc_fdb_actions (priv, &rule->action, parse_attr, flow, extack);if (err) goto err_free; - flow->esw_attr->in_rep = in_rep; - flow->esw_attr->in_mdev = in_mdev; - -if (MLX5_CAP_ESW (esw->dev, counter_eswitch_affinity) == -MLX5_COUNTER_SOURCE_ESWITCH ) - flow->esw_attr->counter_dev = in_mdev; -else - flow->esw_attr->counter_dev = priv->mdev; - err =mlx5e_tc_add_fdb_flow (priv, parse_attr, flow, extack);if (err) goto err_free;
Signature · 1 line
2.20.1
PATCH 6/11 net/mlx5e: Remove 'parse_attr' argument in mlx5e_tc_add_fdb_flow()
In reply to Saeed MahameedFrom: Tonghao Zhang <[email protected]>
This patch is a little improvement. Simplify the mlx5e_tc_add_fdb_flow().
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +3 -3
@@ -929,13 +929,13 @@ mlx5e_tc_unoffload_from_slow_path(struct mlx5_eswitch *esw,static int mlx5e_tc_add_fdb_flow (struct mlx5e_priv *priv, -struct mlx5e_tc_flow_parse_attr *parse_attr,struct mlx5e_tc_flow *flow,struct netlink_ext_ack *extack) {struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;u32 max_chain =mlx5_eswitch_get_chain_range (esw);struct mlx5_esw_flow_attr *attr = flow->esw_attr; +struct mlx5e_tc_flow_parse_attr *parse_attr = attr->parse_attr;u16 max_prio =mlx5_eswitch_get_prio_range (esw);struct net_device *out_dev, *encap_dev =NULL ;struct mlx5_fc *counter =NULL ;
@@ -967,7 +967,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,if (!(attr->dests[out_index].flags &MLX5_ESW_DEST_ENCAP ))continue ; - mirred_ifindex = attr->parse_attr->mirred_ifindex[out_index]; + mirred_ifindex = parse_attr->mirred_ifindex[out_index]; out_dev =__dev_get_by_index (dev_net (priv->netdev), mirred_ifindex); err = mlx5e_attach_encap(priv,
@@ -2793,7 +2793,7 @@ __mlx5e_add_fdb_flow(struct mlx5e_priv *priv,if (err) goto err_free; - err =mlx5e_tc_add_fdb_flow (priv, parse_attr, flow, extack); + err =mlx5e_tc_add_fdb_flow (priv, flow, extack);if (err) goto err_free;
Signature · 1 line
2.20.1
PATCH 7/11 net/mlx5e: Add missing static function annotation
In reply to Saeed MahameedFrom: Leon Romanovsky <[email protected]>
Compilation with W=1 produces following warning:
drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c:69:6:
warning: no previous prototype for _mlx5e_monitor_counter_start_ [-Wmissing-prototypes]
void mlx5e_monitor_counter_start(struct mlx5e_priv *priv)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Avoid it by declaring mlx5e_monitor_counter_start() as a static function.
--- drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c +1 -1
@@ -66,7 +66,7 @@ static int mlx5e_monitor_event_handler(struct notifier_block *nb,return NOTIFY_OK ; } -void mlx5e_monitor_counter_start (struct mlx5e_priv *priv) +static void mlx5e_monitor_counter_start (struct mlx5e_priv *priv) {MLX5_NB_INIT (&priv->monitor_counters_nb, mlx5e_monitor_event_handler,MONITOR_COUNTER );
Signature · 1 line
2.20.1
PATCH 8/11 net/mlx5: Delete unused FPGA QPN variable
In reply to Saeed MahameedFrom: Leon Romanovsky <[email protected]>
fpga_qpn was assigned but never used and compilation with W=1 produced the following warning:
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c: In function _mlx5_fpga_event_:drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c:320:6: warning:
variable _fpga_qpn_ set but not used [-Wunused-but-set-variable]
u32 fpga_qpn;
^~~~~~~~--- drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +0 -2
@@ -317,7 +317,6 @@ static int mlx5_fpga_event(struct mlx5_fpga_device *fdev,const char *event_name;bool teardown = false;unsigned long flags; -u32 fpga_qpn;u8 syndrome;switch (event) {
@@ -328,7 +327,6 @@ static int mlx5_fpga_event(struct mlx5_fpga_device *fdev,case MLX5_EVENT_TYPE_FPGA_QP_ERROR : syndrome =MLX5_GET (fpga_qp_error_event, data, syndrome); event_name =mlx5_fpga_qp_syndrome_to_string (syndrome); - fpga_qpn =MLX5_GET (fpga_qp_error_event, data, fpga_qpn);break ;default :return NOTIFY_DONE ;
Signature · 1 line
2.20.1
PATCH 9/11 net/mlx5e: Remove unused variable ‘esw’
In reply to Saeed MahameedFix the following compiler warning:
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:2770:
warning: unused variable ‘esw’ [-Wunused-variable]
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +0 -1
@@ -2767,7 +2767,6 @@ __mlx5e_add_fdb_flow(struct mlx5e_priv *priv, {struct flow_rule *rule =tc_cls_flower_offload_flow_rule (f);struct netlink_ext_ack *extack = f->common.extack; -struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;struct mlx5e_tc_flow_parse_attr *parse_attr;struct mlx5e_tc_flow *flow;int attr_size, err;
Signature · 1 line
2.20.1
PATCH 10/11 net/mlx5: E-Switch, Fix the warning on vport index out of range
In reply to Saeed MahameedFrom: Bodong Wang <[email protected]>
When eswitch gets vport data structure, the index should not be out of the range of the vport array. Driver mistakenly used vport number to check the range.
--- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +1 -1
@@ -87,7 +87,7 @@ static struct mlx5_vport *mlx5_eswitch_get_vport(struct mlx5_eswitch *esw, {u16 idx =mlx5_eswitch_vport_num_to_index (esw, vport_num); -WARN_ON (vport_num > esw->total_vports -1 ); +WARN_ON (idx > esw->total_vports -1 );return &esw->vports[idx]; }
Signature · 1 line
2.20.1
PATCH 11/11 net/mlx5: E-Switch, Disable esw manager vport correctly
In reply to Saeed MahameedFrom: Bodong Wang <[email protected]>
When disabling vport, relevant vport configurations will be cleaned up. These cleanups should be done to the vports which had these configs applied at vport enablement. As esw manager vport didn't have such vport config applied, cleanup should not touch it.
--- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +2 -1
@@ -1606,7 +1606,8 @@ static void esw_disable_vport(struct mlx5_eswitch *esw,esw_vport_change_handle_locked (vport); vport->enabled_events =0 ;esw_vport_disable_qos (esw, vport_num); -if (esw->mode ==SRIOV_LEGACY ) { +if (esw->manager_vport != vport_num && + esw->mode ==SRIOV_LEGACY ) { mlx5_modify_vport_admin_state(esw->dev, MLX5_VPORT_STATE_OP_MOD_ESW_VPORT, vport_num, 1,
Signature · 1 line
2.20.1
David Miller
maintainerFrom: Saeed Mahameed <[email protected]>
Date: Tue, 19 Feb 2019 14:19:46 -0800
Quoted 8 lines
This series provides some updates to mlx5 driver.
In addition, there is one patch that defines new 50Gbps per lane link modes ininclude/uapi/linux/ethtool.h:
("ethtool: Added support for 50Gbps per lane link modes")For more information please see tag log below.
Please pull and let me know if there is any problem.
Pulled, thanks Saeed.