patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Xiao Wang <xiao.w.wang@intel.com>
To: qi.z.zhang@intel.com
Cc: dev@dpdk.org, qiming.yang@intel.com, lei.a.yao@intel.com,
	jingjing.wu@intel.com, Xiao Wang <xiao.w.wang@intel.com>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH] net/ice: fix default RSS key configuration
Date: Tue, 21 Jul 2020 17:02:58 +0800	[thread overview]
Message-ID: <20200721090258.65715-1-xiao.w.wang@intel.com> (raw)

There's chance that rte_rand() doesn't provision suitable values for
RSS hash, an extreme example could be a key with a lot of 0s in it.

This patch adds a default RSS key which has been used in ixgbe driver
and fm10k driver.

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 3534d18..74d37c7 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2628,11 +2628,20 @@ static int ice_init_rss(struct ice_pf *pf)
 		vsi->rss_lut = rte_zmalloc(NULL,
 					   vsi->rss_lut_size, 0);
 
+#define RSS_KEY_SIZE ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE
+	static uint8_t rss_intel_key[RSS_KEY_SIZE] = {
+		0x6D, 0x5A, 0x56, 0xDA, 0x25, 0x5B, 0x0E, 0xC2,
+		0x41, 0x67, 0x25, 0x3D, 0x43, 0xA3, 0x8F, 0xB0,
+		0xD0, 0xCA, 0x2B, 0xCB, 0xAE, 0x7B, 0x30, 0xB4,
+		0x77, 0xCB, 0x2D, 0xA3, 0x80, 0x30, 0xF2, 0x0C,
+		0x6A, 0x42, 0xB7, 0x3B, 0xBE, 0xAC, 0x01, 0xFA,
+	};
+
 	/* configure RSS key */
 	if (!rss_conf->rss_key) {
 		/* Calculate the default hash key */
 		for (i = 0; i <= vsi->rss_key_size; i++)
-			vsi->rss_key[i] = (uint8_t)rte_rand();
+			vsi->rss_key[i] = rss_intel_key[i];
 	} else {
 		rte_memcpy(vsi->rss_key, rss_conf->rss_key,
 			   RTE_MIN(rss_conf->rss_key_len,
-- 
1.8.3.1


             reply	other threads:[~2020-07-21  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  9:02 Xiao Wang [this message]
2020-07-22  5:25 ` Zhang, Qi Z
2020-07-23 10:25   ` Zhang, Qi Z

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=20200721090258.65715-1-xiao.w.wang@intel.com \
    --to=xiao.w.wang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=lei.a.yao@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).