From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7870C41EA5 for ; Wed, 15 Mar 2023 23:48:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72C1840A7A; Wed, 15 Mar 2023 23:48:23 +0100 (CET) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id ECDB942B71 for ; Wed, 15 Mar 2023 23:48:21 +0100 (CET) Received: by mail-wr1-f44.google.com with SMTP id t15so18689003wrz.7 for ; Wed, 15 Mar 2023 15:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678920501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2KFfmLac5N6fBpN8EUCfkwkchGcS3jUsHOaSXHgN3wk=; b=BiRosYBjwREGZRyYNE62BV8gI0249xneqCL3lpQi5Ghu4Uxn4Liag7PD76JJUCrMgY Z4Y8KFP5dyTY7GO9EGLO9HcYE06kTysMR96Bl13hqqfCKVlvBT2LcK9rHYtm2Mkn23kf 4dca4moUGLrMryUXRUddY//kN2qs9yF5f0jAmx5r+MFBSFPEO17CUvhg/RgLvg/nOuNH 2mmdW4q1CbhsAOw1jWE3osgFrNQyBdEdXIGW+AgZKkFL1urXFiXNFJ1e8hmkf+7hqxkr SgokoI6hm1/E1eHfva48WCDeajpU5o8cGI57XRHYNBVxNXYcqlbHYE5laVBca6WJ21Xi j6cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678920501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2KFfmLac5N6fBpN8EUCfkwkchGcS3jUsHOaSXHgN3wk=; b=NrpiA+3LASh4dKlvIHTx2aLI0y6OmmfwfpizBbNMBTYI+rYfGyaMTTw37OIffphJze 6A0ttdRYMdG5vPjmHgtGwNv4oBMwrMGMES89G9gVOJill4s3N+XpdUSTZli5M++hsrwR dM+fMwz9xeYLx/XR9XTNzRMfE1fzY1b9Yj5oNNKtjagT0mk1YTFcYO1Rm2493ZglglVh d/t7+gZsIeT7L3Fc/+2UAPYuJJbbcwsDxFYAMQIpu3JfcJ9EUL98Si5T7sETP8Z80IaG m5L0ljV4VloErAzqncpr5E3KFkfLitYdrQQf3FY8OQ+2Zz+tkOjf2eog52chH8BfSDS+ jfbQ== X-Gm-Message-State: AO0yUKWwIYKYNZ19vZk1lxCOiDf/KxdQpKtYQepaRgIu5hrw+LXC4uEj z+ThuDRXRue5XuvSKIyGTXHH7ZkzU3+VVQ== X-Google-Smtp-Source: AK7set+ztDH4UNMAdidLm3mTOU7/SYe6Zokq7h1fF0augF0H3OGgKe32jn7egI8XMBHNQVtRZPmM6Q== X-Received: by 2002:a5d:5010:0:b0:2d0:d73a:7671 with SMTP id e16-20020a5d5010000000b002d0d73a7671mr1959160wrt.22.1678920501564; Wed, 15 Mar 2023 15:48:21 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id d16-20020a5d5390000000b002cea392f000sm5642065wrv.69.2023.03.15.15.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 15:48:21 -0700 (PDT) From: luca.boccassi@gmail.com To: Huisong Li Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: separate flow RSS config from RSS conf' has been queued to stable release 20.11.8 Date: Wed, 15 Mar 2023 22:46:28 +0000 Message-Id: <20230315224631.1025649-37-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315224631.1025649-1-luca.boccassi@gmail.com> References: <20230223093715.3926893-71-luca.boccassi@gmail.com> <20230315224631.1025649-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 20.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/17/23. 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. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/65a68c2c6f9076d849aafdcdbdaea91bf2414970 Thanks. Luca Boccassi --- >From 65a68c2c6f9076d849aafdcdbdaea91bf2414970 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 10 Mar 2023 17:35:16 +0800 Subject: [PATCH] net/hns3: separate flow RSS config from RSS conf [ upstream commit b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 ] Some RSS fields in struct hns3_rss_conf (e.g. conf, queue, valid) are only used when create RSS flow rule, which is unnecessary for RSS configuration information from ethdev ops. This patch removes these fields from hns3_rss_conf and add a new struct hns3_flow_rss_conf as rte flow RSS filter list node element. Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_fdir.h | 10 +++++++++- drivers/net/hns3/hns3_flow.c | 23 ++++++++++++----------- drivers/net/hns3/hns3_rss.h | 5 ----- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h index 2d533c30ec..11c2d82238 100644 --- a/drivers/net/hns3/hns3_fdir.h +++ b/drivers/net/hns3/hns3_fdir.h @@ -175,10 +175,18 @@ struct hns3_fdir_rule_ele { struct hns3_fdir_rule fdir_conf; }; +struct hns3_flow_rss_conf { + struct rte_flow_action_rss conf; + uint8_t hash_algo; + uint8_t key[HNS3_RSS_KEY_SIZE_MAX]; /* Hash key */ + uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */ + bool valid; /* check if RSS rule is valid */ +}; + /* rss filter list structure */ struct hns3_rss_conf_ele { TAILQ_ENTRY(hns3_rss_conf_ele) entries; - struct hns3_rss_conf filter_info; + struct hns3_flow_rss_conf filter_info; }; /* hns3_flow memory list structure */ diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c index 40a202db20..47ea9f71e8 100644 --- a/drivers/net/hns3/hns3_flow.c +++ b/drivers/net/hns3/hns3_flow.c @@ -1316,7 +1316,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, { struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; - struct hns3_rss_conf *rss_conf = &hw->rss_info; const struct rte_flow_action_rss *rss; const struct rte_flow_action *act; uint32_t act_index = 0; @@ -1331,7 +1330,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, act, "no valid queues"); } - if (rss->queue_num > RTE_DIM(rss_conf->queue)) + if (rss->queue_num > HNS3_RSS_QUEUES_BUFFER_NUM) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION_CONF, act, "queue number configured exceeds " @@ -1407,7 +1406,7 @@ hns3_disable_rss(struct hns3_hw *hw) } static int -hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, +hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_flow_rss_conf *rss_conf, uint8_t *hash_algo) { const uint8_t hash_func_map[] = { @@ -1434,8 +1433,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, * rte_flow_hash_algo) when this rule is delivered. */ if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) && - *hash_algo != rss_conf->rte_flow_hash_algo) - *hash_algo = rss_conf->rte_flow_hash_algo; + *hash_algo != rss_conf->hash_algo) + *hash_algo = rss_conf->hash_algo; return 0; } @@ -1446,7 +1445,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, } static int -hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf) +hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf) { struct rte_flow_action_rss *rss_config = &conf->conf; uint8_t rss_key[HNS3_RSS_KEY_SIZE_MAX] = {0}; @@ -1471,7 +1470,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf) hw->rss_key_size); if (ret) return ret; - conf->rte_flow_hash_algo = hash_algo; + conf->hash_algo = hash_algo; /* Filter the unsupported flow types */ flow_types = rss_config->types ? @@ -1513,7 +1512,8 @@ hns3_update_indir_table(struct hns3_hw *hw, } static int -hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) +hns3_reset_rss_filter(struct hns3_hw *hw, + const struct hns3_flow_rss_conf *conf) { int ret; @@ -1528,7 +1528,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) } static int -hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_rss_conf *conf) +hns3_config_rss_filter(struct hns3_hw *hw, struct hns3_flow_rss_conf *conf) { struct rte_flow_action_rss *rss_act; uint16_t num; @@ -1638,7 +1638,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw, } static int -hns3_flow_parse_rss(struct rte_eth_dev *dev, struct hns3_rss_conf *conf) +hns3_flow_parse_rss(struct rte_eth_dev *dev, + struct hns3_flow_rss_conf *conf) { struct hns3_adapter *hns = dev->data->dev_private; struct hns3_hw *hw = &hns->hw; @@ -1708,8 +1709,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private); const struct rte_flow_action_rss *rss_act; struct hns3_rss_conf_ele *rss_filter_ptr; + struct hns3_flow_rss_conf *new_conf; struct hns3_rss_conf_ele *filter_ptr; - struct hns3_rss_conf *new_conf; int ret; rss_filter_ptr = rte_zmalloc("hns3 rss filter", diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h index 9300866b68..dfd07930f4 100644 --- a/drivers/net/hns3/hns3_rss.h +++ b/drivers/net/hns3/hns3_rss.h @@ -44,15 +44,10 @@ struct hns3_rss_tuple_cfg { /* Same as the Max queue num under TC */ #define HNS3_RSS_QUEUES_BUFFER_NUM 512 struct hns3_rss_conf { - /* RSS parameters :algorithm, flow_types, key, queue */ - struct rte_flow_action_rss conf; uint64_t rss_hf; uint8_t hash_algo; /* hash function type defined by hardware */ - uint8_t rte_flow_hash_algo; uint8_t key[HNS3_RSS_KEY_SIZE_MAX]; /* Hash key */ uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE_MAX]; - uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */ - bool valid; /* check if RSS rule is valid */ /* * For IPv6 SCTP packets type, check whether the NIC hardware support * RSS hash using the src/dst port as the input tuple. For Kunpeng920 -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-15 22:44:51.748584250 +0000 +++ 0037-net-hns3-separate-flow-RSS-config-from-RSS-conf.patch 2023-03-15 22:44:49.663851938 +0000 @@ -1 +1 @@ -From b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 Mon Sep 17 00:00:00 2001 +From 65a68c2c6f9076d849aafdcdbdaea91bf2414970 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b93ad0cc7677881911e5fc3baa89e0a0bbd73c48 ] + @@ -13,2 +14,0 @@ -Cc: stable@dpdk.org - @@ -17,0 +18 @@ + drivers/net/hns3/hns3_fdir.h | 10 +++++++++- @@ -19 +19,0 @@ - drivers/net/hns3/hns3_flow.h | 10 +++++++++- @@ -22,0 +23,24 @@ +diff --git a/drivers/net/hns3/hns3_fdir.h b/drivers/net/hns3/hns3_fdir.h +index 2d533c30ec..11c2d82238 100644 +--- a/drivers/net/hns3/hns3_fdir.h ++++ b/drivers/net/hns3/hns3_fdir.h +@@ -175,10 +175,18 @@ struct hns3_fdir_rule_ele { + struct hns3_fdir_rule fdir_conf; + }; + ++struct hns3_flow_rss_conf { ++ struct rte_flow_action_rss conf; ++ uint8_t hash_algo; ++ uint8_t key[HNS3_RSS_KEY_SIZE_MAX]; /* Hash key */ ++ uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */ ++ bool valid; /* check if RSS rule is valid */ ++}; ++ + /* rss filter list structure */ + struct hns3_rss_conf_ele { + TAILQ_ENTRY(hns3_rss_conf_ele) entries; +- struct hns3_rss_conf filter_info; ++ struct hns3_flow_rss_conf filter_info; + }; + + /* hns3_flow memory list structure */ @@ -24 +48 @@ -index 527874df44..89374816aa 100644 +index 40a202db20..47ea9f71e8 100644 @@ -27 +51 @@ -@@ -1359,7 +1359,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, +@@ -1316,7 +1316,6 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, @@ -35 +59 @@ -@@ -1374,7 +1373,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, +@@ -1331,7 +1330,7 @@ hns3_parse_rss_filter(struct rte_eth_dev *dev, @@ -44 +68 @@ -@@ -1439,7 +1438,7 @@ hns3_disable_rss(struct hns3_hw *hw) +@@ -1407,7 +1406,7 @@ hns3_disable_rss(struct hns3_hw *hw) @@ -53 +77 @@ -@@ -1466,8 +1465,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, +@@ -1434,8 +1433,8 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, @@ -56 +80 @@ - if (__atomic_load_n(&hw->reset.resetting, __ATOMIC_RELAXED) && + if (__atomic_load_n((uint16_t *)&hw->reset.resetting, __ATOMIC_RELAXED) && @@ -64 +88 @@ -@@ -1478,7 +1477,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, +@@ -1446,7 +1445,7 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, struct hns3_rss_conf *rss_conf, @@ -73 +97 @@ -@@ -1503,7 +1502,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf) +@@ -1471,7 +1470,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct hns3_rss_conf *conf) @@ -82 +106 @@ -@@ -1545,7 +1544,8 @@ hns3_update_indir_table(struct hns3_hw *hw, +@@ -1513,7 +1512,8 @@ hns3_update_indir_table(struct hns3_hw *hw, @@ -92 +116 @@ -@@ -1560,7 +1560,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) +@@ -1528,7 +1528,7 @@ hns3_reset_rss_filter(struct hns3_hw *hw, const struct hns3_rss_conf *conf) @@ -101 +125 @@ -@@ -1669,7 +1669,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw, +@@ -1638,7 +1638,8 @@ hns3_rss_action_is_dup(struct hns3_hw *hw, @@ -111 +135 @@ -@@ -1739,8 +1740,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, +@@ -1708,8 +1709,8 @@ hns3_flow_create_rss_rule(struct rte_eth_dev *dev, @@ -121,24 +144,0 @@ -diff --git a/drivers/net/hns3/hns3_flow.h b/drivers/net/hns3/hns3_flow.h -index e4b2fdf2e6..90126f2b6e 100644 ---- a/drivers/net/hns3/hns3_flow.h -+++ b/drivers/net/hns3/hns3_flow.h -@@ -24,10 +24,18 @@ struct rte_flow { - uint32_t counter_id; - }; - -+struct hns3_flow_rss_conf { -+ struct rte_flow_action_rss conf; -+ uint8_t hash_algo; -+ uint8_t key[HNS3_RSS_KEY_SIZE_MAX]; /* Hash key */ -+ uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */ -+ bool valid; /* check if RSS rule is valid */ -+}; -+ - /* rss filter list structure */ - struct hns3_rss_conf_ele { - TAILQ_ENTRY(hns3_rss_conf_ele) entries; -- struct hns3_rss_conf filter_info; -+ struct hns3_flow_rss_conf filter_info; - }; - - /* hns3_flow memory list structure */ @@ -146 +146 @@ -index cc0bb8431d..d19730c69c 100644 +index 9300866b68..dfd07930f4 100644 @@ -149 +149 @@ -@@ -40,15 +40,10 @@ +@@ -44,15 +44,10 @@ struct hns3_rss_tuple_cfg {