All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: Huisong Li <lihuisong@huawei.com>, <stable@dpdk.org>,
	Min Hu <humin29@huawei.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	Lijun Ou <oulijun@huawei.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	"Wei Hu (Xavier)" <xavier.huwei@huawei.com>,
	Hao Chen <chenhao164@huawei.com>
Subject: [PATCH v2 7/7] net/hns3: remove redundant RSS tuple field
Date: Thu, 5 May 2022 20:27:07 +0800	[thread overview]
Message-ID: <20220505122707.61182-8-humin29@huawei.com> (raw)
In-Reply-To: <20220505122707.61182-1-humin29@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

The 'rss_tuple_fields' in struct struct hns3_rss_conf::rss_tuple_sets is
redundant. Because the enabled RSS tuple in PMD is already managed by the
'types' in struct hns3_rss_conf::conf. This patch removes this redundant
variable.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 drivers/net/hns3/hns3_flow.c |  6 ++----
 drivers/net/hns3/hns3_rss.c  | 12 ++++--------
 drivers/net/hns3/hns3_rss.h  |  5 +----
 3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index feabac9f41..317f91fc71 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1446,7 +1446,7 @@ hns3_disable_rss(struct hns3_hw *hw)
 {
 	int ret;
 
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, &hw->rss_info.rss_tuple_sets, 0);
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, 0);
 	if (ret)
 		return ret;
 	hw->rss_dis_flag = true;
@@ -1496,7 +1496,6 @@ hns3_parse_rss_algorithm(struct hns3_hw *hw, enum rte_eth_hash_function *func,
 static int
 hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 {
-	struct hns3_rss_tuple_cfg *tuple;
 	int ret;
 
 	hns3_adjust_rss_key(hw, rss_config);
@@ -1512,8 +1511,7 @@ hns3_hw_rss_hash_set(struct hns3_hw *hw, struct rte_flow_action_rss *rss_config)
 
 	hw->rss_info.conf.func = rss_config->func;
 
-	tuple = &hw->rss_info.rss_tuple_sets;
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, tuple, rss_config->types);
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_config->types);
 	if (ret)
 		hns3_err(hw, "Update RSS tuples by rss hf failed %d", ret);
 
diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index 4b2c24ace4..e149c16bfe 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -310,8 +310,7 @@ hns3_rss_reset_indir_table(struct hns3_hw *hw)
 }
 
 int
-hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw,
-			     struct hns3_rss_tuple_cfg *tuple, uint64_t rss_hf)
+hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf)
 {
 	struct hns3_rss_input_tuple_cmd *req;
 	struct hns3_cmd_desc desc;
@@ -356,7 +355,6 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw,
 		return ret;
 	}
 
-	tuple->rss_tuple_fields = rte_le_to_cpu_64(req->tuple_field);
 	/* Update supported flow types when set tuple success */
 	hw->rss_info.conf.types = rss_hf;
 
@@ -377,7 +375,6 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 			 struct rte_eth_rss_conf *rss_conf)
 {
 	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct hns3_rss_tuple_cfg *tuple = &hw->rss_info.rss_tuple_sets;
 	uint64_t rss_hf_bk = hw->rss_info.conf.types;
 	uint8_t key_len = rss_conf->rss_key_len;
 	uint64_t rss_hf = rss_conf->rss_hf;
@@ -394,7 +391,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	}
 
 	rte_spinlock_lock(&hw->lock);
-	ret = hns3_set_rss_tuple_by_rss_hf(hw, tuple, rss_hf);
+	ret = hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
 	if (ret)
 		goto set_tuple_fail;
 
@@ -408,7 +405,7 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	return 0;
 
 set_algo_key_fail:
-	(void)hns3_set_rss_tuple_by_rss_hf(hw, tuple, rss_hf_bk);
+	(void)hns3_set_rss_tuple_by_rss_hf(hw, rss_hf_bk);
 set_tuple_fail:
 	rte_spinlock_unlock(&hw->lock);
 	return ret;
@@ -699,8 +696,7 @@ hns3_config_rss(struct hns3_adapter *hns)
 	    !(rss_hf & HNS3_ETH_RSS_SUPPORT))
 		rss_hf = 0;
 
-	return hns3_set_rss_tuple_by_rss_hf(hw, &hw->rss_info.rss_tuple_sets,
-					    rss_hf);
+	return hns3_set_rss_tuple_by_rss_hf(hw, rss_hf);
 }
 
 /*
diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h
index c4121207aa..55d5718ffc 100644
--- a/drivers/net/hns3/hns3_rss.h
+++ b/drivers/net/hns3/hns3_rss.h
@@ -43,7 +43,6 @@ struct hns3_rss_conf {
 	struct rte_flow_action_rss conf;
 	uint8_t hash_algo; /* hash function type defined by hardware */
 	uint8_t key[HNS3_RSS_KEY_SIZE];  /* Hash key */
-	struct hns3_rss_tuple_cfg rss_tuple_sets;
 	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 */
@@ -107,9 +106,7 @@ int hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir,
 int hns3_rss_reset_indir_table(struct hns3_hw *hw);
 int hns3_config_rss(struct hns3_adapter *hns);
 void hns3_rss_uninit(struct hns3_adapter *hns);
-int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw,
-				 struct hns3_rss_tuple_cfg *tuple,
-				 uint64_t rss_hf);
+int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, uint64_t rss_hf);
 int hns3_rss_set_algo_key(struct hns3_hw *hw, const uint8_t *key);
 int hns3_restore_rss_filter(struct rte_eth_dev *dev);
 
-- 
2.33.0


  parent reply	other threads:[~2022-05-05 12:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06  9:22 [PATCH 0/7] bugfix for hns3 PMD Min Hu (Connor)
2022-04-06  9:22 ` [PATCH 1/7] net/hns3: fix order of clearing imissed register in PF Min Hu (Connor)
2022-04-06  9:22 ` [PATCH 2/7] net/hns3: fix MAC and queues HW statistics reversion Min Hu (Connor)
2022-05-03 19:05   ` Ferruh Yigit
2022-04-06  9:22 ` [PATCH 3/7] net/hns3: fix pseudo-sharing between threads Min Hu (Connor)
2022-05-03 19:05   ` Ferruh Yigit
2022-04-06  9:22 ` [PATCH 4/7] net/hns3: fix more mbufs are freed when Tx done cleanup Min Hu (Connor)
2022-04-06  9:22 ` [PATCH 5/7] net/hns3: fix RSS disable Min Hu (Connor)
2022-05-03 19:05   ` Ferruh Yigit
2022-04-06  9:22 ` [PATCH 6/7] net/hns3: fix undo rollback when update RSS hash Min Hu (Connor)
2022-04-06  9:22 ` [PATCH 7/7] net/hns3: remove redundant RSS tuple field Min Hu (Connor)
2022-05-03 19:06   ` Ferruh Yigit
2022-04-25  7:03 ` [PATCH 0/7] bugfix for hns3 PMD Min Hu (Connor)
2022-05-03 19:07 ` Ferruh Yigit
2022-05-05 12:27 ` [PATCH v2 " Min Hu (Connor)
2022-05-05 12:27   ` [PATCH v2 1/7] net/hns3: fix order of clearing imissed register in PF Min Hu (Connor)
2022-05-05 12:27   ` [PATCH v2 2/7] net/hns3: fix MAC and queues HW statistics overflow Min Hu (Connor)
2022-05-05 12:27   ` [PATCH v2 3/7] net/hns3: fix pseudo-sharing between threads Min Hu (Connor)
2022-05-05 12:27   ` [PATCH v2 4/7] net/hns3: fix more mbufs are freed when Tx done cleanup Min Hu (Connor)
2022-05-05 12:27   ` [PATCH v2 5/7] net/hns3: fix RSS disable Min Hu (Connor)
2022-05-05 12:27   ` [PATCH v2 6/7] net/hns3: fix undo rollback when update RSS hash Min Hu (Connor)
2022-05-05 12:27   ` Min Hu (Connor) [this message]
2022-05-12  9:51   ` [PATCH v2 0/7] bugfix for hns3 PMD Ferruh Yigit
2022-05-05 12:29 ` [PATCH " Min Hu (Connor)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220505122707.61182-8-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=chenhao164@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=lihuisong@huawei.com \
    --cc=oulijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=xavier.huwei@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.