DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] common/cnxk: limit RSS key config with RTE Flow operations
@ 2023-09-04 10:57 psatheesh
  2023-09-04 10:57 ` [dpdk-dev] [PATCH 2/2] drivers: add represented port flow item for cnxk psatheesh
  2023-09-20  3:46 ` [dpdk-dev] [PATCH 1/2] common/cnxk: limit RSS key config with RTE Flow operations Jerin Jacob
  0 siblings, 2 replies; 4+ messages in thread
From: psatheesh @ 2023-09-04 10:57 UTC (permalink / raw)
  To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, Jerin Jacob

From: Kiran Kumar K <kirankumark@marvell.com>

Limit the configuring RSS key with RTE Flow operations for cnxk
device. Key can be update only with dev operations using
rte_eth_dev_rss_hash_update.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/common/cnxk/roc_npc.c | 33 ++++++++++++++++++++++++++-------
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index c0c168db76..0611a83bba 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -943,9 +943,35 @@ npc_rss_action_configure(struct roc_npc *roc_npc,
 	uint8_t key[ROC_NIX_RSS_KEY_LEN];
 	const uint8_t *key_ptr;
 	uint8_t flowkey_algx;
+	uint32_t key_len;
 	uint16_t *reta;
 	int rc;
 
+	roc_nix_rss_key_get(roc_nix, key);
+	if (rss->key == NULL) {
+		key_ptr = key;
+	} else {
+		key_len = rss->key_len;
+		if (key_len > ROC_NIX_RSS_KEY_LEN)
+			key_len = ROC_NIX_RSS_KEY_LEN;
+
+		for (i = 0; i < key_len; i++) {
+			if (key[i] != rss->key[i]) {
+				plt_err("RSS key config not supported");
+				plt_err("New Key:");
+				for (i = 0; i < key_len; i++)
+					plt_dump_no_nl("0x%.2x ", rss->key[i]);
+				plt_dump_no_nl("\n");
+				plt_err("Configured Key:");
+				for (i = 0; i < ROC_NIX_RSS_KEY_LEN; i++)
+					plt_dump_no_nl("0x%.2x ", key[i]);
+				plt_dump_no_nl("\n");
+				return -ENOTSUP;
+			}
+		}
+		key_ptr = rss->key;
+	}
+
 	rc = npc_rss_free_grp_get(npc, &rss_grp_idx);
 	/* RSS group :0 is not usable for flow rss action */
 	if (rc < 0 || rss_grp_idx == 0)
@@ -960,13 +986,6 @@ npc_rss_action_configure(struct roc_npc *roc_npc,
 
 	*rss_grp = rss_grp_idx;
 
-	if (rss->key == NULL) {
-		roc_nix_rss_key_default_fill(roc_nix, key);
-		key_ptr = key;
-	} else {
-		key_ptr = rss->key;
-	}
-
 	roc_nix_rss_key_set(roc_nix, key_ptr);
 
 	/* If queue count passed in the rss action is less than
-- 
2.39.2


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

end of thread, other threads:[~2023-12-05 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04 10:57 [dpdk-dev] [PATCH 1/2] common/cnxk: limit RSS key config with RTE Flow operations psatheesh
2023-09-04 10:57 ` [dpdk-dev] [PATCH 2/2] drivers: add represented port flow item for cnxk psatheesh
2023-12-05 11:53   ` [dpdk-dev] [PATCH v2] " psatheesh
2023-09-20  3:46 ` [dpdk-dev] [PATCH 1/2] common/cnxk: limit RSS key config with RTE Flow operations Jerin Jacob

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