Skip to content

Commit d4a1605

Browse files
ayalevinSaeed Mahameed
authored andcommitted
net/mlx5e: Fix VLAN create flow
When interface is attached while in promiscuous mode and with VLAN filtering turned off, both configurations are not respected and VLAN filtering is performed. There are 2 flows which add the any-vid rules during interface attach: VLAN creation table and set rx mode. Each is relaying on the other to add any-vid rules, eventually non of them does. Fix this by adding any-vid rules on VLAN creation regardless of promiscuous mode. Fixes: 9df3060 ("net/mlx5e: Restore vlan filter after seamless reset") Signed-off-by: Aya Levin <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8c7353b commit d4a1605

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ static int __mlx5e_add_vlan_rule(struct mlx5e_priv *priv,
217217
break;
218218
}
219219

220+
if (WARN_ONCE(*rule_p, "VLAN rule already exists type %d", rule_type))
221+
return 0;
222+
220223
*rule_p = mlx5_add_flow_rules(ft, spec, &flow_act, &dest, 1);
221224

222225
if (IS_ERR(*rule_p)) {
@@ -397,8 +400,7 @@ static void mlx5e_add_vlan_rules(struct mlx5e_priv *priv)
397400
for_each_set_bit(i, priv->fs.vlan.active_svlans, VLAN_N_VID)
398401
mlx5e_add_vlan_rule(priv, MLX5E_VLAN_RULE_TYPE_MATCH_STAG_VID, i);
399402

400-
if (priv->fs.vlan.cvlan_filter_disabled &&
401-
!(priv->netdev->flags & IFF_PROMISC))
403+
if (priv->fs.vlan.cvlan_filter_disabled)
402404
mlx5e_add_any_vid_rules(priv);
403405
}
404406

0 commit comments

Comments
 (0)