Commit 70f478ca authored by Dmytro Linkin's avatar Dmytro Linkin Committed by Saeed Mahameed

net/mlx5e: Fix nest_level for vlan pop action

Current value of nest_level, assigned from net_device lower_level value,
does not reflect the actual number of vlan headers, needed to pop.
For ex., if we have untagged ingress traffic sended over vlan devices,
instead of one pop action, driver will perform two pop actions.
To fix that, calculate nest_level as difference between vlan device and
parent device lower_levels.

Fixes: f3b0a18b ("net: remove unnecessary variables and callback")
Signed-off-by: default avatarDmytro Linkin <dmitrolin@mellanox.com>
Signed-off-by: default avatarRoi Dayan <roid@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent d19987cc
...@@ -3558,12 +3558,13 @@ static int add_vlan_pop_action(struct mlx5e_priv *priv, ...@@ -3558,12 +3558,13 @@ static int add_vlan_pop_action(struct mlx5e_priv *priv,
struct mlx5_esw_flow_attr *attr, struct mlx5_esw_flow_attr *attr,
u32 *action) u32 *action)
{ {
int nest_level = attr->parse_attr->filter_dev->lower_level;
struct flow_action_entry vlan_act = { struct flow_action_entry vlan_act = {
.id = FLOW_ACTION_VLAN_POP, .id = FLOW_ACTION_VLAN_POP,
}; };
int err = 0; int nest_level, err = 0;
nest_level = attr->parse_attr->filter_dev->lower_level -
priv->netdev->lower_level;
while (nest_level--) { while (nest_level--) {
err = parse_tc_vlan_action(priv, &vlan_act, attr, action); err = parse_tc_vlan_action(priv, &vlan_act, attr, action);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment