net/mlx5: fix VLAN/DECAP actions not work in mirror flow
Checks
Commit Message
Due to hardware limitations the VLAN push/pop and Decap actions following
the sample action are supported in the FDB Tx steering domain only, the
flows with incorrect action order for other domains are rejected by
rdma-core.
To provide the action order requested in RTE flow this patch checks for
the VLAN or Decap precedence to the sample action and moves the VLAN or
Decap actions into the next flow in the new table and adds the jump
action in the prefix sample flow.
This patch also adds the validation for these combination actions.
Fixes: 255b8f86eb6e ("net/mlx5: fix E-Switch egress mirror flow validation")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 8 ++++++++
drivers/net/mlx5/mlx5_flow_dv.c | 15 +++++++++++++++
2 files changed, 23 insertions(+)
Comments
> -----Original Message-----
> From: Jiawei Wang <jiaweiw@nvidia.com>
> Sent: Friday, April 9, 2021 15:37
> To: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>;
> Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix VLAN/DECAP actions not work in mirror flow
>
> Due to hardware limitations the VLAN push/pop and Decap actions following
> the sample action are supported in the FDB Tx steering domain only, the
> flows with incorrect action order for other domains are rejected by rdma-
> core.
>
> To provide the action order requested in RTE flow this patch checks for the
> VLAN or Decap precedence to the sample action and moves the VLAN or
> Decap actions into the next flow in the new table and adds the jump action in
> the prefix sample flow.
>
> This patch also adds the validation for these combination actions.
>
> Fixes: 255b8f86eb6e ("net/mlx5: fix E-Switch egress mirror flow validation")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Hi,
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Jiawei Wang
> Sent: Friday, April 9, 2021 3:37 PM
> To: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>;
> Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix VLAN/DECAP actions not work in
> mirror flow
>
> Due to hardware limitations the VLAN push/pop and Decap actions following
> the sample action are supported in the FDB Tx steering domain only, the
> flows with incorrect action order for other domains are rejected by
> rdma-core.
>
> To provide the action order requested in RTE flow this patch checks for
> the VLAN or Decap precedence to the sample action and moves the VLAN or
> Decap actions into the next flow in the new table and adds the jump
> action in the prefix sample flow.
>
> This patch also adds the validation for these combination actions.
>
> Fixes: 255b8f86eb6e ("net/mlx5: fix E-Switch egress mirror flow validation")
> Cc: stable@dpdk.org
>
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> ---
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
@@ -4759,6 +4759,14 @@ struct mlx5_hlist_entry *
case RTE_FLOW_ACTION_TYPE_MARK:
case RTE_FLOW_ACTION_TYPE_SET_META:
case RTE_FLOW_ACTION_TYPE_SET_TAG:
+ case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:
+ case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
+ case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
+ case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP:
+ case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:
+ case RTE_FLOW_ACTION_TYPE_NVGRE_DECAP:
+ case RTE_FLOW_ACTION_TYPE_RAW_DECAP:
+ case RTE_FLOW_ACTION_TYPE_MODIFY_FIELD:
if (fdb_mirror)
*modify_after_mirror = 1;
break;
@@ -6589,6 +6589,8 @@ struct mlx5_hlist_entry *
item_flags, attr,
error))
return -rte_errno;
+ if (action_flags & MLX5_FLOW_ACTION_SAMPLE)
+ modify_after_mirror = 1;
action_flags |= MLX5_FLOW_ACTION_OF_POP_VLAN;
++actions_n;
break;
@@ -6600,6 +6602,8 @@ struct mlx5_hlist_entry *
error);
if (ret < 0)
return ret;
+ if (action_flags & MLX5_FLOW_ACTION_SAMPLE)
+ modify_after_mirror = 1;
action_flags |= MLX5_FLOW_ACTION_OF_PUSH_VLAN;
++actions_n;
break;
@@ -6608,6 +6612,8 @@ struct mlx5_hlist_entry *
(action_flags, actions, error);
if (ret < 0)
return ret;
+ if (action_flags & MLX5_FLOW_ACTION_SAMPLE)
+ modify_after_mirror = 1;
/* Count PCP with push_vlan command. */
action_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_PCP;
break;
@@ -6617,6 +6623,8 @@ struct mlx5_hlist_entry *
actions, error);
if (ret < 0)
return ret;
+ if (action_flags & MLX5_FLOW_ACTION_SAMPLE)
+ modify_after_mirror = 1;
/* Count VID with push_vlan command. */
action_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_VID;
rw_act_num += MLX5_ACT_NUM_MDF_VID;
@@ -6639,6 +6647,8 @@ struct mlx5_hlist_entry *
attr, error);
if (ret < 0)
return ret;
+ if (action_flags & MLX5_FLOW_ACTION_SAMPLE)
+ modify_after_mirror = 1;
action_flags |= MLX5_FLOW_ACTION_DECAP;
++actions_n;
break;
@@ -6666,6 +6676,9 @@ struct mlx5_hlist_entry *
actions, item_flags, error);
if (ret < 0)
return ret;
+ if ((action_flags & MLX5_FLOW_ACTION_SAMPLE) &&
+ (action_flags & MLX5_FLOW_ACTION_DECAP))
+ modify_after_mirror = 1;
break;
case RTE_FLOW_ACTION_TYPE_SET_MAC_SRC:
case RTE_FLOW_ACTION_TYPE_SET_MAC_DST:
@@ -6949,6 +6962,8 @@ struct mlx5_hlist_entry *
error);
if (ret < 0)
return ret;
+ if (action_flags & MLX5_FLOW_ACTION_SAMPLE)
+ modify_after_mirror = 1;
/* Count all modify-header actions as one action. */
if (!(action_flags & MLX5_FLOW_ACTION_MODIFY_FIELD))
++actions_n;