DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/nfp: fix the hash key length logic problem
@ 2025-04-01  8:12 Chaoyong He
  0 siblings, 0 replies; only message in thread
From: Chaoyong He @ 2025-04-01  8:12 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He, stable, Peng Zhang

There does not exist an API for driver to get/set the hash key length
from/to the firmware.

---
	#define NFP_NET_CFG_RSS_KEY_SZ          0x28
	#define NFP_NET_CFG_MACADDR             0x0024
---

The original logic try to use the 'NFP_NET_CFG_RSS_KEY_SZ' as the
inexistent API, read from this address will get wrong hash key length
and write to this address will overwrite the MAC address unexpected,
which will cause very strange problem.

Fixes: 934e4c60fbff ("nfp: add RSS")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_net_common.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index aaa515bac2..62550e4cad 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -1966,9 +1966,6 @@ nfp_net_rss_hash_write(struct rte_eth_dev *dev,
 	/* Configuring where to apply the RSS hash */
 	nn_cfg_writel(hw, NFP_NET_CFG_RSS_CTRL, cfg_rss_ctrl);
 
-	/* Writing the key size */
-	nn_cfg_writeb(hw, NFP_NET_CFG_RSS_KEY_SZ, rss_conf->rss_key_len);
-
 	return 0;
 }
 
@@ -2059,7 +2056,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
 	rss_conf->rss_hf = rss_hf;
 
 	/* Reading the key size */
-	rss_conf->rss_key_len = nn_cfg_readl(hw, NFP_NET_CFG_RSS_KEY_SZ);
+	rss_conf->rss_key_len = NFP_NET_CFG_RSS_KEY_SZ;
 
 	/* Reading the key byte a byte */
 	for (i = 0; i < rss_conf->rss_key_len; i++) {
-- 
2.43.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-01  8:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-01  8:12 [PATCH] net/nfp: fix the hash key length logic problem Chaoyong He

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