net/mlx5: fix the validation of the sample encap action

Message ID 20231107150820.30805-1-jiaweiw@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix the validation of the sample encap action |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Jiawei Wang Nov. 7, 2023, 3:08 p.m. UTC
  The flow sample/mirror action includes sub-actions for the
duplicated packet.
In SW steering case, dv_flow_en=1, there is a FW limitation
that forces configuring also encap action when port action
for the wire port is configured in the duplicated packet's
sub-actions.

The driver did a wrong validation for the above limitation
and forced other actions instead of encap for the wire port.
Force only encap action in case of wire port.

This patch fixes the wrongly checking for the sample encap action.

Fixes: a8697f50f50f ("net/mlx5: fix E-Switch mirror flow rule validation")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Raslan Darawsheh Nov. 12, 2023, 2:23 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Tuesday, November 7, 2023 5:08 PM
> To: Suanming Mou <suanmingm@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Ori Kam
> <orika@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix the validation of the sample encap action
> 
> The flow sample/mirror action includes sub-actions for the
> duplicated packet.
> In SW steering case, dv_flow_en=1, there is a FW limitation
> that forces configuring also encap action when port action
> for the wire port is configured in the duplicated packet's
> sub-actions.
> 
> The driver did a wrong validation for the above limitation
> and forced other actions instead of encap for the wire port.
> Force only encap action in case of wire port.
> 
> This patch fixes the wrongly checking for the sample encap action.
> 
> Fixes: a8697f50f50f ("net/mlx5: fix E-Switch mirror flow rule validation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 154e509707..9753af2cb1 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -8721,7 +8721,7 @@  flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 								RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 								"mirror to rep port with encap is not supported");
 			} else {
-				if ((sub_action_flags & ~MLX5_FLOW_ACTION_ENCAP) &&
+				if (!(sub_action_flags & MLX5_FLOW_ACTION_ENCAP) &&
 				    (action_flags & MLX5_FLOW_ACTION_JUMP))
 					return rte_flow_error_set(error, ENOTSUP,
 								RTE_FLOW_ERROR_TYPE_ACTION, NULL,