mlx5 fixes 2021-04-14
From: Saeed Mahameed <[email protected]>
Hi Dave, Jakub,
This series provides 3 small fixes to mlx5 driver. Please pull and let me know if there is any problem.
Thanks,
Saeed.
---
The following changes since commit 2afeec08ab5c86ae21952151f726bfe184f6b23d:
xen-netback: Check for hotplug-status existence before watching (2021-04-13 15:24:14 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2021-04-14
for you to fetch changes up to e3e0f9b279705154b951d579dc3d8b7041710e24:
net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta (2021-04-14 16:13:00 -0700)
----------------------------------------------------------------
mlx5-fixes-2021-04-14
----------------------------------------------------------------
Aya Levin (2):
net/mlx5: Fix setting of devlink traps in switchdev mode net/mlx5e: Fix setting of RS FEC mode
wenxu (1):
net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta
drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 5 +++++ drivers/net/ethernet/mellanox/mlx5/core/en/port.c | 23 ++++------------------- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 +++ 3 files changed, 12 insertions(+), 19 deletions(-)
PATCH 1/3 net/mlx5: Fix setting of devlink traps in switchdev mode
From: Aya Levin <[email protected]>
Prevent setting of devlink traps on the uplink while in switchdev mode. In this mode, it is the SW switch responsibility to handle both packets with a mismatch in destination MAC or VLAN ID. Therefore, there are no flow steering tables to trap undesirable packets and driver crashes upon setting a trap.
--- drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/devlink.c +5 -0
@@ -246,6 +246,11 @@ static int mlx5_devlink_trap_action_set(struct devlink *devlink,struct mlx5_devlink_trap *dl_trap;int err =0 ; +if (is_mdev_switchdev_mode (dev)) { +NL_SET_ERR_MSG_MOD (extack,"Devlink traps can't be set in switchdev mode" ); +return -EOPNOTSUPP ; + } + dl_trap =mlx5_find_trap_by_id (dev, trap->id);if (!dl_trap) {mlx5_core_err (dev,"Devlink trap: Set action on invalid trap id 0x%x" , trap->id);
Signature · 1 line
2.30.2
PATCH 2/3 net/mlx5e: Fix setting of RS FEC mode
In reply to Saeed MahameedFrom: Aya Levin <[email protected]>
Change register setting from bit number to bit mask.
--- .../net/ethernet/mellanox/mlx5/core/en/port.c | 23 ++++--------------- 1 file changed, 4 insertions(+), 19 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/port.c +4 -19
@@ -387,21 +387,6 @@ enum mlx5e_fec_supported_link_mode { *_policy = MLX5_GET(pplm_reg, _buf, fec_override_admin_##link); \ }while (0 ) -#define MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY (buf, policy, write, link) \ - do { \ - unsigned long policy_long; \ - u16 *__policy = &(policy); \ - bool _write = (write); \ - \ - policy_long = *__policy; \ - if (_write && *__policy) \ - *__policy = find_first_bit(&policy_long, \ - sizeof(policy_long) * BITS_PER_BYTE);\ - MLX5E_FEC_OVERRIDE_ADMIN_POLICY(buf, *__policy, _write, link); \ - if (!_write && *__policy) \ - *__policy = 1 << *__policy; \ - } while (0) -/* get/set FEC admin field for a given speed */ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write,enum mlx5e_fec_supported_link_mode link_mode)
@@ -423,16 +408,16 @@ static int mlx5e_fec_admin_field(u32 *pplm, u16 *fec_policy, bool write, MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g);break ;case MLX5E_FEC_SUPPORTED_LINK_MODE_50G_1X : - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 50g_1x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 50g_1x);break ;case MLX5E_FEC_SUPPORTED_LINK_MODE_100G_2X : - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 100g_2x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 100g_2x);break ;case MLX5E_FEC_SUPPORTED_LINK_MODE_200G_4X : - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 200g_4x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 200g_4x);break ;case MLX5E_FEC_SUPPORTED_LINK_MODE_400G_8X : - MLX5E_FEC_OVERRIDE_ADMIN_50G_POLICY(pplm, *fec_policy, write, 400g_8x); + MLX5E_FEC_OVERRIDE_ADMIN_POLICY(pplm, *fec_policy, write, 400g_8x);break ;default :return -EINVAL ;
Signature · 1 line
2.30.2
PATCH 3/3 net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta
In reply to Saeed MahameedFrom: wenxu <[email protected]>
In the nft_offload there is the mate flow_dissector with no ingress_ifindex but with ingress_iftype that only be used in the software. So if the mask of ingress_ifindex in meta is 0, this meta check should be bypass.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +3 -0
@@ -1895,6 +1895,9 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev,return 0 ;flow_rule_match_meta (rule, &match); +if (!match.mask->ingress_ifindex) +return 0 ; +if (match.mask->ingress_ifindex !=0xFFFFFFFF ) {NL_SET_ERR_MSG_MOD (extack,"Unsupported ingress ifindex mask" );return -EOPNOTSUPP ;
Signature · 1 line
2.30.2
Quoted 2 lines · On Wed, 14 Apr 2021 16:16:07 -0700 Saeed Mahameed wrote:
This series provides 3 small fixes to mlx5 driver. Please pull and let me know if there is any problem.
FWIW a little more info on user-visible misbehavior on patch 2 would have helped.
Re: [net 1/3] net/mlx5: Fix setting of devlink traps in switchdev mode
In reply to Saeed MahameedThis series was applied to netdev/net.git (refs/heads/master):
Hello:
This series was applied to netdev/net.git (refs/heads/master):
Quoted 9 lines · On Wed, 14 Apr 2021 16:16:08 -0700 you wrote:
From: Aya Levin <[email protected]>
Prevent setting of devlink traps on the uplink while in switchdev mode. In this mode, it is the SW switch responsibility to handle both packets with a mismatch in destination MAC or VLAN ID. Therefore, there are no flow steering tables to trap undesirable packets and driver crashes upon setting a trap.
[...]
Here is the summary with links:
- [net,1/3] net/mlx5: Fix setting of devlink traps in switchdev mode
https://git.kernel.org/netdev/net/c/41bafb31dcd5 - [net,2/3] net/mlx5e: Fix setting of RS FEC mode https://git.kernel.org/netdev/net/c/7a320c9db3e7 - [net,3/3] net/mlx5e: fix ingress_ifindex check in mlx5e_flower_parse_meta https://git.kernel.org/netdev/net/c/e3e0f9b27970
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html