DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix L3 encapsulation flow validation
@ 2019-11-19 15:32 Matan Azrad
  2019-11-20  9:44 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Matan Azrad @ 2019-11-19 15:32 UTC (permalink / raw)
  To: dev; +Cc: Viacheslav Ovsiienko, dekelp, stable

In order to configure L3 encapsulation\decapsulation flow to mlx5
devices, 2 actions should be added to the flow actions list:
RTE_FLOW_ACTION_TYPE_RAW_DECAP and RTE_FLOW_ACTION_TYPE_RAW_ENCAP.

One of the validations for this scenario is to check that modify actions
is not done before the L3 decapsulation, because it doesn't make sense
to decapsulate a modified data.

Wrongly, this check was done for the case of L3 encapsulation what
causes a validation failure in modify + L3 encapsulation flow.

Ignore this check in case of L3 encapsulation.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
Cc: dekelp@mellanox.com
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c9dbd89..9d883df 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2185,11 +2185,6 @@ struct field_modify_info modify_tcp[] = {
 					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 					  "can only have a single decap"
 					  " action in a flow");
-	if (action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS)
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
-					  "can't have decap action after"
-					  " modify action");
 	/* decap action is valid on egress only if it is followed by encap */
 	if (attr->egress) {
 		for (; action->type != RTE_FLOW_ACTION_TYPE_END &&
@@ -2202,6 +2197,11 @@ struct field_modify_info modify_tcp[] = {
 					 RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
 					 NULL, "decap action not supported"
 					 " for egress");
+	} else if (action_flags & MLX5_FLOW_MODIFY_HDR_ACTIONS) {
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
+					  "can't have decap action after"
+					  " modify action");
 	}
 	return 0;
 }
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix L3 encapsulation flow validation
  2019-11-19 15:32 [dpdk-dev] [PATCH] net/mlx5: fix L3 encapsulation flow validation Matan Azrad
@ 2019-11-20  9:44 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2019-11-20  9:44 UTC (permalink / raw)
  To: Matan Azrad, dev; +Cc: Slava Ovsiienko, Dekel Peled, stable

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Matan Azrad
> Sent: Tuesday, November 19, 2019 5:32 PM
> To: dev@dpdk.org
> Cc: Slava Ovsiienko <viacheslavo@mellanox.com>; Dekel Peled
> <dekelp@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix L3 encapsulation flow validation
> 
> In order to configure L3 encapsulation\decapsulation flow to mlx5
> devices, 2 actions should be added to the flow actions list:
> RTE_FLOW_ACTION_TYPE_RAW_DECAP and
> RTE_FLOW_ACTION_TYPE_RAW_ENCAP.
> 
> One of the validations for this scenario is to check that modify actions
> is not done before the L3 decapsulation, because it doesn't make sense
> to decapsulate a modified data.
> 
> Wrongly, this check was done for the case of L3 encapsulation what
> causes a validation failure in modify + L3 encapsulation flow.
> 
> Ignore this check in case of L3 encapsulation.
> 
> Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
> Cc: dekelp@mellanox.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> ---


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-20  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 15:32 [dpdk-dev] [PATCH] net/mlx5: fix L3 encapsulation flow validation Matan Azrad
2019-11-20  9:44 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).