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 5B526A04DD for ; Wed, 28 Oct 2020 11:52:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 45042CA0C; Wed, 28 Oct 2020 11:52:28 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id DF789C9C0 for ; Wed, 28 Oct 2020 11:52:26 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id x7so5173898wrl.3 for ; Wed, 28 Oct 2020 03:52:26 -0700 (PDT) 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=FP+vrvRY3rIVonxUAJPTwlXlTL9+ChwbwJkszUU+Cmk=; b=oyiWv2alSCLhVPf1tra+IYZPJk41MqWuiRdTUOiccHuf7lEjLWfplOZihHmHABHGLa mBCAEGiGG+wEbWuPqbvQFKl+YQ09DbfBvdolvvDydPWd7GESveO6n1JmWSXQLMH2zLF+ hlIyi+w99O+EhhFnB/IwaWuP5XQW3plGKeATdeBNr7hGetRmCG8MbqqZATIOREJz11EX 3Ex79yR19yBJBberHdsi0Pg3PDYTCA2XArHJ1mbIIxddwu9jb18v7oBPCC4gXVAm3hCe 3Fiscb0Pb/RVfntcpFCGXRJbPEEh/iyA63xZe4iCtrx/04BOU0Oyo0dIa8508YEJ6iUH AbFg== 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=FP+vrvRY3rIVonxUAJPTwlXlTL9+ChwbwJkszUU+Cmk=; b=Z3yi7c8KL9TFbxdTN8/sTPlOkPIh+hMxmZt11BEuxe8qaMlbo50/C1+0ye/PDpmh5W GFaMJMWKiN9Rs39SzrjrJBkhRUbhJCD4sb4mNOzbfYdNobXaFTUjJcCmk9uAyPRO0IJ6 01GSZICNhADMcE8De0CJ/MQk5ZPuQlCM2vde6DG6aPLQccfPzN0ZboNc9u25RFnvOsiF mkyOAiP11ombOYvId0dh5LM4O5c9OBvwF+SW20NUwuF+St9BfbfXYoGt8RfQEcm9gZo9 MopmYP/YZAcEgILj3io+Ko+50HnfhlX2G16L4SHgAY/f6EX/p1U7wBLVNrhf097P6BQu BGLA== X-Gm-Message-State: AOAM533oDK/AbDLs93G/adKrVFZMAG1FJ+SquKMKMwbobXUFtv6Kf4+5 R2xDttIWPFWKq3D7zb3sSuA= X-Google-Smtp-Source: ABdhPJw1L//DqKj5B0aVdqvyGaFA2m0Zsdpk5daswjGkSOQ6+6Wyca0lWiVpT22HUrO8Qb0MVRuW9Q== X-Received: by 2002:adf:c50c:: with SMTP id q12mr7959268wrf.17.1603882345556; Wed, 28 Oct 2020 03:52:25 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id l3sm7446043wmg.32.2020.10.28.03.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:52:24 -0700 (PDT) From: luca.boccassi@gmail.com To: "Wei Hu (Xavier)" Cc: Lijun Ou , dpdk stable Date: Wed, 28 Oct 2020 10:44:38 +0000 Message-Id: <20201028104606.3504127-119-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix error type when validating RSS flow action' has been queued to stable release 19.11.6 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/30/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 e9c49642bda64e099b8c137a919f3be45df744fb Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Tue, 29 Sep 2020 20:01:11 +0800 Subject: [PATCH] net/hns3: fix error type when validating RSS flow action [ upstream commit f8f8df765f5f9a983f20a9a4f061f5a02672f693 ] Because the macro named RTE_FLOW_ERROR_TYPE_ACTION_CONF indicates a action configuration and the macro named RTE_FLOW_ERROR_TYPE_ACTION indicates a specific action, the driver needs to return RTE_FLOW_ERROR_ACTION_CONF type and notify the user when a RSS configuration is invalid with actions list in the internal function named hns3_parse_rss_filter called by the '.validate' ops implementation function named hns3_flow_validate. Besides, this patch removes some unnecessary judgment lines in hns3_parse_rss_filter. Fixes: c37ca66f2b27 ("net/hns3: support RSS") Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_flow.c | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 4bc6812283..1137cb24e8 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1261,7 +1261,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, const struct rte_flow_action_rss *rss; const struct rte_flow_action *act; uint32_t act_index = 0; - uint64_t flow_types; uint16_t n; NEXT_ITEM_OF_ACTION(act, actions, act_index); @@ -1269,7 +1268,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, if (rss == NULL) { return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "no valid queues"); } @@ -1277,47 +1276,32 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, if (rss->queue[n] < dev->data->nb_rx_queues) continue; return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "queue id > max number of queues"); } - /* Parse flow types of RSS */ if (!(rss->types & HNS3_ETH_RSS_SUPPORT) && rss->types) return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "Flow types is unsupported by " "hns3's RSS"); - - flow_types = rss->types & HNS3_ETH_RSS_SUPPORT; - if (flow_types != rss->types) - hns3_warn(hw, "RSS flow types(%" PRIx64 ") include unsupported " - "flow types", rss->types); - - /* Parse RSS related parameters from RSS configuration */ - switch (rss->func) { - case RTE_ETH_HASH_FUNCTION_DEFAULT: - case RTE_ETH_HASH_FUNCTION_TOEPLITZ: - case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR: - break; - default: + if (rss->func >= RTE_ETH_HASH_FUNCTION_MAX) return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, act, - "input RSS hash functions are not supported"); - } - + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, + "RSS hash func are not supported"); if (rss->level) return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, act, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "a nonzero RSS encapsulation level is not supported"); if (rss->key_len && rss->key_len != RTE_DIM(rss_conf->key)) return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, act, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "RSS hash key must be exactly 40 bytes"); if (rss->queue_num > RTE_DIM(rss_conf->queue)) return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ACTION, act, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "too many queues for RSS context"); act_index++; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:15.443754562 +0000 +++ 0119-net-hns3-fix-error-type-when-validating-RSS-flow-act.patch 2020-10-28 10:35:11.676832556 +0000 @@ -1,8 +1,10 @@ -From f8f8df765f5f9a983f20a9a4f061f5a02672f693 Mon Sep 17 00:00:00 2001 +From e9c49642bda64e099b8c137a919f3be45df744fb Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Tue, 29 Sep 2020 20:01:11 +0800 Subject: [PATCH] net/hns3: fix error type when validating RSS flow action +[ upstream commit f8f8df765f5f9a983f20a9a4f061f5a02672f693 ] + Because the macro named RTE_FLOW_ERROR_TYPE_ACTION_CONF indicates a action configuration and the macro named RTE_FLOW_ERROR_TYPE_ACTION indicates a specific action, the driver needs to return @@ -15,19 +17,18 @@ hns3_parse_rss_filter. Fixes: c37ca66f2b27 ("net/hns3: support RSS") -Cc: stable@dpdk.org Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) --- - drivers/net/hns3/hns3_flow.c | 35 +++++++++-------------------------- - 1 file changed, 9 insertions(+), 26 deletions(-) + drivers/net/hns3/hns3_flow.c | 34 +++++++++------------------------- + 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c -index f8e5f05d38..a6676d650d 100644 +index 4bc6812283..1137cb24e8 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c -@@ -1356,7 +1356,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, +@@ -1261,7 +1261,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, const struct rte_flow_action_rss *rss; const struct rte_flow_action *act; uint32_t act_index = 0; @@ -35,7 +36,7 @@ uint16_t n; NEXT_ITEM_OF_ACTION(act, actions, act_index); -@@ -1364,7 +1363,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, +@@ -1269,7 +1268,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, if (rss == NULL) { return rte_flow_error_set(error, EINVAL, @@ -44,7 +45,7 @@ act, "no valid queues"); } -@@ -1372,48 +1371,32 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, +@@ -1277,47 +1276,32 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, if (rss->queue[n] < dev->data->nb_rx_queues) continue; return rte_flow_error_set(error, EINVAL, @@ -73,7 +74,6 @@ - case RTE_ETH_HASH_FUNCTION_DEFAULT: - case RTE_ETH_HASH_FUNCTION_TOEPLITZ: - case RTE_ETH_HASH_FUNCTION_SIMPLE_XOR: -- case RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ: - break; - default: + if (rss->func >= RTE_ETH_HASH_FUNCTION_MAX) @@ -100,7 +100,7 @@ + RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "too many queues for RSS context"); - if (rss->types & (ETH_RSS_L4_DST_ONLY | ETH_RSS_L4_SRC_ONLY) && + act_index++; -- 2.20.1