* [PATCH 21.11] common/cnxk: fix RSS key configuration
@ 2024-11-29 10:43 psatheesh
2024-12-04 11:37 ` Kevin Traynor
0 siblings, 1 reply; 2+ messages in thread
From: psatheesh @ 2024-11-29 10:43 UTC (permalink / raw)
To: Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
Satheesh Paul
Cc: stable, Jerin Jacob
From: Kiran Kumar K <kirankumark@marvell.com>
[ upstream commit 56fa6f92e9e32cbc5c99af89da611a9f33bbe254 ]
Limit the configuring RSS key with rte_flow operations as
it is a global resource. Key can be update only with ethdev dev
operations using rte_eth_dev_rss_hash_update().
Fixes: 51dc6a80f843 ("common/cnxk: support RSS action in NPC rule")
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
---
drivers/common/cnxk/roc_npc.c | 33 +++++++++++++++++++++++-------
drivers/common/cnxk/roc_platform.h | 3 ++-
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c
index 9422a42457..5183d3016e 100644
--- a/drivers/common/cnxk/roc_npc.c
+++ b/drivers/common/cnxk/roc_npc.c
@@ -716,9 +716,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)
@@ -733,13 +759,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
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 61d4781209..c79c5fda4b 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -203,7 +203,8 @@ extern int cnxk_logtype_tm;
#define plt_info(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
#define plt_warn(fmt, args...) RTE_LOG(WARNING, PMD, fmt "\n", ##args)
#define plt_print(fmt, args...) RTE_LOG(INFO, PMD, fmt "\n", ##args)
-#define plt_dump(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)
+#define plt_dump(fmt, ...) fprintf(stderr, fmt "\n", ##__VA_ARGS__)
+#define plt_dump_no_nl(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
/**
* Log debug message if given subsystem logging is enabled.
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 21.11] common/cnxk: fix RSS key configuration
2024-11-29 10:43 [PATCH 21.11] common/cnxk: fix RSS key configuration psatheesh
@ 2024-12-04 11:37 ` Kevin Traynor
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Traynor @ 2024-12-04 11:37 UTC (permalink / raw)
To: psatheesh, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
Cc: stable, Jerin Jacob
On 29/11/2024 11:43, psatheesh@marvell.com wrote:
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> [ upstream commit 56fa6f92e9e32cbc5c99af89da611a9f33bbe254 ]
>
> Limit the configuring RSS key with rte_flow operations as
> it is a global resource. Key can be update only with ethdev dev
> operations using rte_eth_dev_rss_hash_update().
>
> Fixes: 51dc6a80f843 ("common/cnxk: support RSS action in NPC rule")
>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
> Reviewed-by: Jerin Jacob <jerinj@marvell.com>
> ---
> drivers/common/cnxk/roc_npc.c | 33 +++++++++++++++++++++++-------
> drivers/common/cnxk/roc_platform.h | 3 ++-
> 2 files changed, 28 insertions(+), 8 deletions(-)
>
Hi Kiran, thanks for rebasing this patch. Applied and pushed to 21.11
branch.
Kevin.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-04 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-29 10:43 [PATCH 21.11] common/cnxk: fix RSS key configuration psatheesh
2024-12-04 11:37 ` Kevin Traynor
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).