DPDK patches and discussions
 help / color / Atom feed
From: "Wei Hu (Xavier)" <xavier.huwei@tom.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 5/9] net/hns3: optimize RSS's default algorithm
Date: Mon,  2 Dec 2019 10:51:22 +0800
Message-ID: <20191202025126.73423-6-xavier.huwei@tom.com> (raw)
In-Reply-To: <20191202025126.73423-1-xavier.huwei@tom.com>

From: Hao Chen <chenhao164@huawei.com>

This patch changed the default algorithm of RSS from simle_xor to
toeplitz because toeplitz is used more frequently by upper applications
such as ceph.

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 drivers/net/hns3/hns3_rss.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/hns3/hns3_rss.c b/drivers/net/hns3/hns3_rss.c
index b8c20e6d9..dfc42f840 100644
--- a/drivers/net/hns3/hns3_rss.c
+++ b/drivers/net/hns3/hns3_rss.c
@@ -211,7 +211,11 @@ hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw,
 			req->ipv6_fragment_en |= HNS3_IP_OTHER_BIT_MASK;
 			break;
 		default:
-			/* Other unsupported flow types won't change tuples */
+			/*
+			 * rss_hf doesn't include unsupported flow types
+			 * because the API framework has checked it, and
+			 * this branch will never go unless rss_hf is zero.
+			 */
 			break;
 		}
 	}
@@ -251,8 +255,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 	struct hns3_hw *hw = &hns->hw;
 	struct hns3_rss_tuple_cfg *tuple = &hw->rss_info.rss_tuple_sets;
 	struct hns3_rss_conf *rss_cfg = &hw->rss_info;
-	uint8_t algo = rss_cfg->conf.func;
 	uint8_t key_len = rss_conf->rss_key_len;
+	uint8_t algo;
 	uint64_t rss_hf = rss_conf->rss_hf;
 	uint8_t *key = rss_conf->rss_key;
 	int ret;
@@ -285,6 +289,8 @@ hns3_dev_rss_hash_update(struct rte_eth_dev *dev,
 			ret = -EINVAL;
 			goto conf_err;
 		}
+		algo = rss_cfg->conf.func == RTE_ETH_HASH_FUNCTION_SIMPLE_XOR ?
+			HNS3_RSS_HASH_ALGO_SIMPLE : HNS3_RSS_HASH_ALGO_TOEPLITZ;
 		ret = hns3_set_rss_algo_key(hw, algo, key);
 		if (ret)
 			goto conf_err;
@@ -500,7 +506,9 @@ hns3_set_default_rss_args(struct hns3_hw *hw)
 	int i;
 
 	/* Default hash algorithm */
-	rss_cfg->conf.func = RTE_ETH_HASH_FUNCTION_SIMPLE_XOR;
+	rss_cfg->conf.func = RTE_ETH_HASH_FUNCTION_TOEPLITZ;
+
+	/* Default RSS key */
 	memcpy(rss_cfg->key, hns3_hash_key, HNS3_RSS_KEY_SIZE);
 
 	/* Initialize RSS indirection table */
-- 
2.23.0


  parent reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-02  2:51 [dpdk-dev] [PATCH 0/9] updates for hns3 PMD driver Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 1/9] net/hns3: support Rx interrupt Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 2/9] net/hns3: get link state change through mailbox Wei Hu (Xavier)
2019-12-03 13:16   ` Ferruh Yigit
2019-12-03 13:19     ` Ferruh Yigit
2019-12-14 10:12       ` Wei Hu (Xavier)
2019-12-14 10:26     ` Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 3/9] net/hns3: modify the return value of enable msix Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 4/9] net/hns3: modify custom macro Wei Hu (Xavier)
2019-12-02  2:51 ` Wei Hu (Xavier) [this message]
2019-12-02  2:51 ` [dpdk-dev] [PATCH 6/9] net/hns3: remove the redundant function call Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 7/9] net/hns3: remove the redundant variable initialization Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 8/9] net/hns3: remove the unnecessary assignment Wei Hu (Xavier)
2019-12-02  2:51 ` [dpdk-dev] [PATCH 9/9] net/hns3: remove the unused macros Wei Hu (Xavier)

Reply instructions:

You may reply publically 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=20191202025126.73423-6-xavier.huwei@tom.com \
    --to=xavier.huwei@tom.com \
    --cc=dev@dpdk.org \
    /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

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox