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 4800FA051C for ; Tue, 11 Feb 2020 12:40:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C4A61BFEF; Tue, 11 Feb 2020 12:40:49 +0100 (CET) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by dpdk.org (Postfix) with ESMTP id 66EE21BFEF for ; Tue, 11 Feb 2020 12:40:48 +0100 (CET) Received: by mail-wr1-f43.google.com with SMTP id u6so11988972wrt.0 for ; Tue, 11 Feb 2020 03:40:48 -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=cW+XpDfe/me2G0tzMtxL9Gh1lCzFJvvMm0Lq574lBc8=; b=HI4dgYSktHTYujiG5zIoWiy+/Wrj8sRW0b7bowKDi3j5tUQmuV9qFhOcF24J5pY5NI jjhfs76JsxDLbDhwCtkIGQfCjqf0aPpEelYV5gc3qWiNAs9GiOTqgaeNKpVPmyreW97X ddZWgLhN9y8YYkkyUEZUAhOnPQ3ccRJhNePKql0ojFmTqVsB1Kfot5CRL4LZ5x3GGPVZ B8v1//mQW4ODCRuTnVh0T6dfUkwmsftol9doIsxAAOZmq3ACXF5aK4d4EzEKHBOcoKNZ zbEZAKW9rvUUNbikMkM4gMB4rcNuT9S2UDrW/gI4LSkp488Pz2bDpzecyPi+5P3eXkmT VVJg== 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=cW+XpDfe/me2G0tzMtxL9Gh1lCzFJvvMm0Lq574lBc8=; b=p+603AAAtD2T5nds4+gWOcnhMstlmm2Jkz6GNr10aiXvtZiJw+vPkkXXGajgR09K48 RsFTxaBzf1jNkPlwPDr03shWMwTm4x6cYhBPiBfJ/Gh4ETWc/GTtVLlySjB4RdZAtlmc 3ZH87wzWLbX711bq0UrIJi5XxZhdKW+hNj1VkhdxvdC8fn7352R9vaJmbcySbDolKJva FOftkjWCd17d615qgERbYrciiZDNEaUgi7zMQGQYLbLnMberx0bbn7BzqEb3wQEs1xBH yTTtno9WpEM1ltcRZBF3IG7uf5Bf25j2RHvVa4h4fiz6AhcODkKtdwwmAJF9rou5555f kZog== X-Gm-Message-State: APjAAAVPku6mb9vaQWmL82NG405VIb50AB+H9hHhnYDWdaM4KoA1rico jnRwIkrCx5fN728kTMCYjPgyP1ubFDo= X-Google-Smtp-Source: APXvYqxOl3cGJGw5D+1uVbDy6uOfSnbKUk3IDzJqD44cXU2OEI+Nr3H0ou6czcVpuVykB52R53p7Fg== X-Received: by 2002:adf:f80c:: with SMTP id s12mr8175788wrp.1.1581421248109; Tue, 11 Feb 2020 03:40:48 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id x21sm3307232wmi.30.2020.02.11.03.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:40:47 -0800 (PST) From: luca.boccassi@gmail.com To: Dekel Peled Cc: Ori Kam , Viacheslav Ovsiienko , dpdk stable Date: Tue, 11 Feb 2020 11:21:37 +0000 Message-Id: <20200211112216.3929-151-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix VLAN VID action validation' 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/13/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 31cb74256a053f75499408ab5b9f2a3f34c10955 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 22 Jan 2020 16:27:21 +0200 Subject: [PATCH] net/mlx5: fix VLAN VID action validation [ upstream commit 5a2ab34d81c2bd07539ae7cb5167498617909d42 ] Validation function of 'set VLAN VID' action checks twice for existing same action in flow rule. This patch updates the validation function logic, to check the same restrictions more efficiently. Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN header") Fixes: b8c0372bc5ac ("net/mlx5: fix set VLAN ID/PCP in new header") Signed-off-by: Dekel Peled Acked-by: Ori Kam Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index db86623651..8a9a872ac6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1686,10 +1686,10 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags, * * @param[in] item_flags * Holds the items detected in this rule. + * @param[in] action_flags + * Holds the actions detected until now. * @param[in] actions * Pointer to the list of actions remaining in the flow rule. - * @param[in] attr - * Pointer to flow attributes * @param[out] error * Pointer to error structure. * @@ -1709,33 +1709,17 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "VLAN VID value is too big"); - /* there is an of_push_vlan action before us */ - if (action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN) { - if (mlx5_flow_find_action(actions + 1, - RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID)) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "Multiple VLAN VID modifications are " - "not supported"); - else - return 0; - } - - /* - * Action is on an existing VLAN header: - * Need to verify this is a single modify CID action. - * Rule mast include a match on outer VLAN. - */ + if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN) && + !(item_flags & MLX5_FLOW_LAYER_OUTER_VLAN)) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "set VLAN VID action must follow push" + " VLAN action or match on VLAN item"); if (action_flags & MLX5_FLOW_ACTION_OF_SET_VLAN_VID) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, action, "Multiple VLAN VID modifications are " "not supported"); - if (!(item_flags & MLX5_FLOW_LAYER_OUTER_VLAN)) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "match on VLAN is required in order " - "to set VLAN VID"); if (action_flags & MLX5_FLOW_ACTION_PORT_ID) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:43.882599399 +0000 +++ 0151-net-mlx5-fix-VLAN-VID-action-validation.patch 2020-02-11 11:17:38.708007106 +0000 @@ -1,8 +1,10 @@ -From 5a2ab34d81c2bd07539ae7cb5167498617909d42 Mon Sep 17 00:00:00 2001 +From 31cb74256a053f75499408ab5b9f2a3f34c10955 Mon Sep 17 00:00:00 2001 From: Dekel Peled Date: Wed, 22 Jan 2020 16:27:21 +0200 Subject: [PATCH] net/mlx5: fix VLAN VID action validation +[ upstream commit 5a2ab34d81c2bd07539ae7cb5167498617909d42 ] + Validation function of 'set VLAN VID' action checks twice for existing same action in flow rule. @@ -11,7 +13,6 @@ Fixes: 5f163d520cff ("net/mlx5: support modify VLAN ID on existing VLAN header") Fixes: b8c0372bc5ac ("net/mlx5: fix set VLAN ID/PCP in new header") -Cc: stable@dpdk.org Signed-off-by: Dekel Peled Acked-by: Ori Kam @@ -21,10 +22,10 @@ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index de4b765a0e..4b6a92c83c 100644 +index db86623651..8a9a872ac6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c -@@ -1815,10 +1815,10 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags, +@@ -1686,10 +1686,10 @@ flow_dv_validate_action_set_vlan_pcp(uint64_t action_flags, * * @param[in] item_flags * Holds the items detected in this rule. @@ -37,7 +38,7 @@ * @param[out] error * Pointer to error structure. * -@@ -1838,33 +1838,17 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags, +@@ -1709,33 +1709,17 @@ flow_dv_validate_action_set_vlan_vid(uint64_t item_flags, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "VLAN VID value is too big");