[v2] net/mlx5: fix modify action attributes detection

Message ID 20220901021156.15920-1-jiaweiw@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series [v2] net/mlx5: fix modify action attributes detection |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS

Commit Message

Jiawei Wang Sept. 1, 2022, 2:11 a.m. UTC
  The driver splits the flow with sample action into two sub-flows,
sub prefix flow and sub suffix flow.

In the case of tunnel flow including a decap action, the driver should
translate the inner as outer for actions coming after the decap action.
In the case of flow splitting, the packet layers, used to detect the
attributes, are inherited from the prefix flow to the suffix flow but
the driver wrongly didn't handle the decap adjustment and the inner
layers didn't shift to the outer.

This patch adjusts the inherited layers in case of decap.

Fixes: 6e77151286b2 ("net/mlx5: fix match information in meter")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
v2: fix the style warning
---
 drivers/net/mlx5/mlx5_flow_dv.c | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Raslan Darawsheh Sept. 5, 2022, 9:24 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Jiawei(Jonny) Wang <jiaweiw@nvidia.com>
> Sent: Thursday, September 1, 2022 5:12 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/mlx5: fix modify action attributes detection
> 
> The driver splits the flow with sample action into two sub-flows,
> sub prefix flow and sub suffix flow.
> 
> In the case of tunnel flow including a decap action, the driver should
> translate the inner as outer for actions coming after the decap action.
> In the case of flow splitting, the packet layers, used to detect the
> attributes, are inherited from the prefix flow to the suffix flow but
> the driver wrongly didn't handle the decap adjustment and the inner
> layers didn't shift to the outer.
> 
> This patch adjusts the inherited layers in case of decap.
> 
> Fixes: 6e77151286b2 ("net/mlx5: fix match information in meter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
> v2: fix the style warning
> ---

Patch applied to next-net-mlx,
Concerning this failure:
http://mails.dpdk.org/archives/test-report/2022-September/304146.html
Please note to send always in reply to your previous version,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index bee9363515..76113785ea 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -121,6 +121,13 @@  flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr,
 	 * have the user defined items as the flow is split.
 	 */
 	if (layers) {
+		if (tunnel_decap) {
+			/*
+			 * If decap action before modify, it means the driver
+			 * should take the inner as outer for the modify actions.
+			 */
+			layers = ((layers >> 6) & MLX5_FLOW_LAYER_OUTER);
+		}
 		if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV4)
 			attr->ipv4 = 1;
 		else if (layers & MLX5_FLOW_LAYER_OUTER_L3_IPV6)