net/mlx5: E-Switch, Set the actions for offloaded rules properly
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 3 Nov 2016 23:48:46 +0000 (01:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2016 18:59:37 +0000 (14:59 -0400)
As for the current generation of the mlx5 HW (CX4/CX4-Lx) per flow vlan
push/pop actions are emulated, we must not program them to the firmware.

Fixes: f5f82476090f ('net/mlx5: E-Switch, Support VLAN actions in the offloads mode')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index c55ad8d00c05714710b36b568ed57ab1026bd8cb..d239f5d0ea3683d886a7e21dc9d7d6274e15a65e 100644 (file)
@@ -57,7 +57,8 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
        if (esw->mode != SRIOV_OFFLOADS)
                return ERR_PTR(-EOPNOTSUPP);
 
-       action = attr->action;
+       /* per flow vlan pop/push is emulated, don't set that into the firmware */
+       action = attr->action & ~(MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH | MLX5_FLOW_CONTEXT_ACTION_VLAN_POP);
 
        if (action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
                dest.type = MLX5_FLOW_DESTINATION_TYPE_VPORT;