[dpdk-stable] patch 'net/mlx5: fix layer validation with decapsulation' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 27 10:33:49 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/29/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From f9cb01862aabf54ab0b88cd755602fe966a73c2a Mon Sep 17 00:00:00 2001
From: Suanming Mou <suanmingm at mellanox.com>
Date: Wed, 19 Feb 2020 16:26:19 +0200
Subject: [PATCH] net/mlx5: fix layer validation with decapsulation

[ upstream commit e505ac7f91b59e1165c143f14b208885658d2f94 ]

Currently, the flow validate function only validate the outermost layer
with the header modify actions. If there is decapsulation action before
the header modify action, the validation should choose the inner layer
for validation.

Add decapsulation check when validate with the header modify actions.
Choose the inner layer once there is decapsulation action.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")

Signed-off-by: Suanming Mou <suanmingm at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 36 +++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2b37c1c353..9a79e6e7a4 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -3015,10 +3015,14 @@ flow_dv_validate_action_modify_ipv4(const uint64_t action_flags,
 				    struct rte_flow_error *error)
 {
 	int ret = 0;
+	uint64_t layer;
 
 	ret = flow_dv_validate_action_modify_hdr(action_flags, action, error);
 	if (!ret) {
-		if (!(item_flags & MLX5_FLOW_LAYER_L3_IPV4))
+		layer = (action_flags & MLX5_FLOW_ACTION_DECAP) ?
+				 MLX5_FLOW_LAYER_INNER_L3_IPV4 :
+				 MLX5_FLOW_LAYER_OUTER_L3_IPV4;
+		if (!(item_flags & layer))
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL,
@@ -3049,10 +3053,14 @@ flow_dv_validate_action_modify_ipv6(const uint64_t action_flags,
 				    struct rte_flow_error *error)
 {
 	int ret = 0;
+	uint64_t layer;
 
 	ret = flow_dv_validate_action_modify_hdr(action_flags, action, error);
 	if (!ret) {
-		if (!(item_flags & MLX5_FLOW_LAYER_L3_IPV6))
+		layer = (action_flags & MLX5_FLOW_ACTION_DECAP) ?
+				 MLX5_FLOW_LAYER_INNER_L3_IPV6 :
+				 MLX5_FLOW_LAYER_OUTER_L3_IPV6;
+		if (!(item_flags & layer))
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL,
@@ -3083,10 +3091,14 @@ flow_dv_validate_action_modify_tp(const uint64_t action_flags,
 				  struct rte_flow_error *error)
 {
 	int ret = 0;
+	uint64_t layer;
 
 	ret = flow_dv_validate_action_modify_hdr(action_flags, action, error);
 	if (!ret) {
-		if (!(item_flags & MLX5_FLOW_LAYER_L4))
+		layer = (action_flags & MLX5_FLOW_ACTION_DECAP) ?
+				 MLX5_FLOW_LAYER_INNER_L4 :
+				 MLX5_FLOW_LAYER_OUTER_L4;
+		if (!(item_flags & layer))
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL, "no transport layer "
@@ -3118,10 +3130,14 @@ flow_dv_validate_action_modify_tcp_seq(const uint64_t action_flags,
 				       struct rte_flow_error *error)
 {
 	int ret = 0;
+	uint64_t layer;
 
 	ret = flow_dv_validate_action_modify_hdr(action_flags, action, error);
 	if (!ret) {
-		if (!(item_flags & MLX5_FLOW_LAYER_OUTER_L4_TCP))
+		layer = (action_flags & MLX5_FLOW_ACTION_DECAP) ?
+				 MLX5_FLOW_LAYER_INNER_L4_TCP :
+				 MLX5_FLOW_LAYER_OUTER_L4_TCP;
+		if (!(item_flags & layer))
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL, "no TCP item in"
@@ -3163,10 +3179,14 @@ flow_dv_validate_action_modify_tcp_ack(const uint64_t action_flags,
 				       struct rte_flow_error *error)
 {
 	int ret = 0;
+	uint64_t layer;
 
 	ret = flow_dv_validate_action_modify_hdr(action_flags, action, error);
 	if (!ret) {
-		if (!(item_flags & MLX5_FLOW_LAYER_OUTER_L4_TCP))
+		layer = (action_flags & MLX5_FLOW_ACTION_DECAP) ?
+				 MLX5_FLOW_LAYER_INNER_L4_TCP :
+				 MLX5_FLOW_LAYER_OUTER_L4_TCP;
+		if (!(item_flags & layer))
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL, "no TCP item in"
@@ -3207,10 +3227,14 @@ flow_dv_validate_action_modify_ttl(const uint64_t action_flags,
 				   struct rte_flow_error *error)
 {
 	int ret = 0;
+	uint64_t layer;
 
 	ret = flow_dv_validate_action_modify_hdr(action_flags, action, error);
 	if (!ret) {
-		if (!(item_flags & MLX5_FLOW_LAYER_L3))
+		layer = (action_flags & MLX5_FLOW_ACTION_DECAP) ?
+				 MLX5_FLOW_LAYER_INNER_L3 :
+				 MLX5_FLOW_LAYER_OUTER_L3;
+		if (!(item_flags & layer))
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION,
 						  NULL,
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 09:31:56.765128296 +0000
+++ 0029-net-mlx5-fix-layer-validation-with-decapsulation.patch	2020-02-27 09:31:55.787946255 +0000
@@ -1,8 +1,10 @@
-From e505ac7f91b59e1165c143f14b208885658d2f94 Mon Sep 17 00:00:00 2001
+From f9cb01862aabf54ab0b88cd755602fe966a73c2a Mon Sep 17 00:00:00 2001
 From: Suanming Mou <suanmingm at mellanox.com>
 Date: Wed, 19 Feb 2020 16:26:19 +0200
 Subject: [PATCH] net/mlx5: fix layer validation with decapsulation
 
+[ upstream commit e505ac7f91b59e1165c143f14b208885658d2f94 ]
+
 Currently, the flow validate function only validate the outermost layer
 with the header modify actions. If there is decapsulation action before
 the header modify action, the validation should choose the inner layer
@@ -12,7 +14,6 @@
 Choose the inner layer once there is decapsulation action.
 
 Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
-Cc: stable at dpdk.org
 
 Signed-off-by: Suanming Mou <suanmingm at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
@@ -21,10 +22,10 @@
  1 file changed, 30 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
-index 99d668f5d3..caa0ff8bad 100644
+index 2b37c1c353..9a79e6e7a4 100644
 --- a/drivers/net/mlx5/mlx5_flow_dv.c
 +++ b/drivers/net/mlx5/mlx5_flow_dv.c
-@@ -3096,10 +3096,14 @@ flow_dv_validate_action_modify_ipv4(const uint64_t action_flags,
+@@ -3015,10 +3015,14 @@ flow_dv_validate_action_modify_ipv4(const uint64_t action_flags,
  				    struct rte_flow_error *error)
  {
  	int ret = 0;
@@ -40,7 +41,7 @@
  			return rte_flow_error_set(error, EINVAL,
  						  RTE_FLOW_ERROR_TYPE_ACTION,
  						  NULL,
-@@ -3130,10 +3134,14 @@ flow_dv_validate_action_modify_ipv6(const uint64_t action_flags,
+@@ -3049,10 +3053,14 @@ flow_dv_validate_action_modify_ipv6(const uint64_t action_flags,
  				    struct rte_flow_error *error)
  {
  	int ret = 0;
@@ -56,7 +57,7 @@
  			return rte_flow_error_set(error, EINVAL,
  						  RTE_FLOW_ERROR_TYPE_ACTION,
  						  NULL,
-@@ -3164,10 +3172,14 @@ flow_dv_validate_action_modify_tp(const uint64_t action_flags,
+@@ -3083,10 +3091,14 @@ flow_dv_validate_action_modify_tp(const uint64_t action_flags,
  				  struct rte_flow_error *error)
  {
  	int ret = 0;
@@ -72,7 +73,7 @@
  			return rte_flow_error_set(error, EINVAL,
  						  RTE_FLOW_ERROR_TYPE_ACTION,
  						  NULL, "no transport layer "
-@@ -3199,10 +3211,14 @@ flow_dv_validate_action_modify_tcp_seq(const uint64_t action_flags,
+@@ -3118,10 +3130,14 @@ flow_dv_validate_action_modify_tcp_seq(const uint64_t action_flags,
  				       struct rte_flow_error *error)
  {
  	int ret = 0;
@@ -88,7 +89,7 @@
  			return rte_flow_error_set(error, EINVAL,
  						  RTE_FLOW_ERROR_TYPE_ACTION,
  						  NULL, "no TCP item in"
-@@ -3244,10 +3260,14 @@ flow_dv_validate_action_modify_tcp_ack(const uint64_t action_flags,
+@@ -3163,10 +3179,14 @@ flow_dv_validate_action_modify_tcp_ack(const uint64_t action_flags,
  				       struct rte_flow_error *error)
  {
  	int ret = 0;
@@ -104,7 +105,7 @@
  			return rte_flow_error_set(error, EINVAL,
  						  RTE_FLOW_ERROR_TYPE_ACTION,
  						  NULL, "no TCP item in"
-@@ -3288,10 +3308,14 @@ flow_dv_validate_action_modify_ttl(const uint64_t action_flags,
+@@ -3207,10 +3227,14 @@ flow_dv_validate_action_modify_ttl(const uint64_t action_flags,
  				   struct rte_flow_error *error)
  {
  	int ret = 0;


More information about the stable mailing list