diff options
author | Eli Britstein | 2019-03-21 23:51:42 +0100 |
---|---|---|
committer | Saeed Mahameed | 2019-03-22 20:09:32 +0100 |
commit | 76b496b1bd79bcd669cd7411e80e09512dc6707f (patch) | |
tree | edbd2d8f66921a9a7593f15a4e60872a5e8f5e7d /drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |
parent | net/mlx5e: Support VLAN modify action (diff) | |
download | kernel-qcow2-linux-76b496b1bd79bcd669cd7411e80e09512dc6707f.tar.gz kernel-qcow2-linux-76b496b1bd79bcd669cd7411e80e09512dc6707f.tar.xz kernel-qcow2-linux-76b496b1bd79bcd669cd7411e80e09512dc6707f.zip |
net/mlx5e: Replace TC VLAN pop and push actions with VLAN modify
Changing the VLAN header may be implemented by pop the existing header
and push a new one. Translate those operations as VLAN modify.
Applicable for use cases such as OVS where the controller translates a
vlan modify meta (OF) rule to DP pop+push actions rule.
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_tc.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 0f4e9615f666..c68edcc84af8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2664,7 +2664,17 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, break; case FLOW_ACTION_VLAN_PUSH: case FLOW_ACTION_VLAN_POP: - err = parse_tc_vlan_action(priv, act, attr, &action); + if (act->id == FLOW_ACTION_VLAN_PUSH && + (action & MLX5_FLOW_CONTEXT_ACTION_VLAN_POP)) { + /* Replace vlan pop+push with vlan modify */ + action &= ~MLX5_FLOW_CONTEXT_ACTION_VLAN_POP; + err = add_vlan_rewrite_action(priv, + MLX5_FLOW_NAMESPACE_FDB, + act, parse_attr, hdrs, + &action, extack); + } else { + err = parse_tc_vlan_action(priv, act, attr, &action); + } if (err) return err; |