From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1198A055A for ; Thu, 27 Feb 2020 10:35:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E5E791BFF2; Thu, 27 Feb 2020 10:35:25 +0100 (CET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by dpdk.org (Postfix) with ESMTP id 237DC1BFF6 for ; Thu, 27 Feb 2020 10:35:24 +0100 (CET) Received: by mail-wr1-f50.google.com with SMTP id v4so2399153wrs.8 for ; Thu, 27 Feb 2020 01:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yaaKreRx1f1Jz+SMYmxrICq443rhtiCcm6DvWrnfrrA=; b=jWYFxA7uOusb80G1n0SvYa6FKQ5xGHU527McNmh/M60sOpBnuUVXuBGWBk2TMehchp WoHTClOqxINJgLmlKTtsl1Z9308sQDdLoXYXI2+HF2wJT8J8hAhfy050BRMUzhQU0Ahf OC5dcKohcwVG6e3MvDIU0ElAucOyCyI3sdfY6cvBQbEcAANESNYJDNEFfVCQY68F4mKw 5VntzugmGLpk8s16JxUy+ttd672azowaLOMfQI9HvWSSYr8yNuilFalTe3kfcofDbXy8 TgkHINUyCgjuV0kkqt3bnA3gjo8NI6i6dT0tlL8ffXY5dJuSnsL3n3gg6dmTn2Uk1vts HzWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yaaKreRx1f1Jz+SMYmxrICq443rhtiCcm6DvWrnfrrA=; b=ZjAzcL1edZd2PAYYHWvgntrpDBTJ+ZNESsw+EWssKAoo+id6KCNS+AQCpHqNg3OZZ5 c7CpHY5LazIXXSj1pwJTOSRa1WO2pAmNosUofI9jJJut7Y5KDn7ie1mKWA58kJVj2U1c P3KecsS1DnpMbJzd7djSz+hEt5S15IjU6mLubaJVZSRGWeHUtvpWL8ZRfhD3MY74zlNt MqLw0fnLhoagVOvESPjsJ8isXGCR91537/HigfAgaNuPWo6ihA/F+QEv1Jl9azH55u00 ODPwZZAwpjra7V2jhva6Roo0ZRRDZcPrORZMnox/Qtm4lD/oDkQDZW5X+H6YxeAh9mCT /WPg== X-Gm-Message-State: APjAAAXPyDbR97V5z9leB0/a/GGWvXJOLLoPNWPFjzl58EaEyzDwnKvJ dlcpjppPz9kgWjU3eQSfqek= X-Google-Smtp-Source: APXvYqyTuvOJFcL8dQ+tQ3JcuPs8fGfnfg9edm9xsWVKe5Efhi/hzzh9V16HKnHZJliAmRj4neD3Lg== X-Received: by 2002:a5d:61ce:: with SMTP id q14mr3777557wrv.222.1582796123795; Thu, 27 Feb 2020 01:35:23 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z11sm185999wmd.47.2020.02.27.01.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 01:35:23 -0800 (PST) From: luca.boccassi@gmail.com To: Suanming Mou Cc: Matan Azrad , dpdk stable Date: Thu, 27 Feb 2020 09:33:49 +0000 Message-Id: <20200227093402.17690-29-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200227093402.17690-1-luca.boccassi@gmail.com> References: <20200217174546.25334-54-luca.boccassi@gmail.com> <20200227093402.17690-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix layer validation with decapsulation' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Acked-by: Matan Azrad --- 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 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@dpdk.org Signed-off-by: Suanming Mou Acked-by: Matan Azrad @@ -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;