patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/ice: fix default RSS key configuration
@ 2020-07-21  9:02 Xiao Wang
  2020-07-22  5:25 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Wang @ 2020-07-21  9:02 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, qiming.yang, lei.a.yao, jingjing.wu, Xiao Wang, stable

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-23 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21  9:02 [dpdk-stable] [PATCH] net/ice: fix default RSS key configuration Xiao Wang
2020-07-22  5:25 ` Zhang, Qi Z
2020-07-23 10:25   ` Zhang, Qi Z

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).