Skip to content

Commit 8974aa9

Browse files
Amir TzinSaeed Mahameed
authored andcommitted
net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode
Moving to switchdev mode with rx-vlan-filter on and then setting it off causes the kernel to crash since fs->vlan is freed during nic profile cleanup flow. RX VLAN filtering is not supported in switchdev mode so unset it when changing to switchdev and restore its value when switching back to legacy. trace: [] RIP: 0010:mlx5e_disable_cvlan_filter+0x43/0x70 [] set_feature_cvlan_filter+0x37/0x40 [mlx5_core] [] mlx5e_handle_feature+0x3a/0x60 [mlx5_core] [] mlx5e_set_features+0x6d/0x160 [mlx5_core] [] __netdev_update_features+0x288/0xa70 [] ethnl_set_features+0x309/0x380 [] ? __nla_parse+0x21/0x30 [] genl_family_rcv_msg_doit.isra.17+0x110/0x150 [] genl_rcv_msg+0x112/0x260 [] ? features_reply_size+0xe0/0xe0 [] ? genl_family_rcv_msg_doit.isra.17+0x150/0x150 [] netlink_rcv_skb+0x4e/0x100 [] genl_rcv+0x24/0x40 [] netlink_unicast+0x1ab/0x290 [] netlink_sendmsg+0x257/0x4f0 [] sock_sendmsg+0x5c/0x70 Fixes: cb67b83 ("net/mlx5e: Introduce SRIOV VF representors") Signed-off-by: Amir Tzin <[email protected]> Reviewed-by: Maor Dickman <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent da0c524 commit 8974aa9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ void mlx5e_enable_cvlan_filter(struct mlx5e_flow_steering *fs, bool promisc)
443443

444444
void mlx5e_disable_cvlan_filter(struct mlx5e_flow_steering *fs, bool promisc)
445445
{
446-
if (fs->vlan->cvlan_filter_disabled)
446+
if (!fs->vlan || fs->vlan->cvlan_filter_disabled)
447447
return;
448448

449449
fs->vlan->cvlan_filter_disabled = true;

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4018,6 +4018,10 @@ static netdev_features_t mlx5e_fix_uplink_rep_features(struct net_device *netdev
40184018
if (netdev->features & NETIF_F_GRO_HW)
40194019
netdev_warn(netdev, "Disabling HW_GRO, not supported in switchdev mode\n");
40204020

4021+
features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
4022+
if (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER)
4023+
netdev_warn(netdev, "Disabling HW_VLAN CTAG FILTERING, not supported in switchdev mode\n");
4024+
40214025
return features;
40224026
}
40234027

0 commit comments

Comments
 (0)