net/cnxk: fix issue with RSS configuration for cnxk

Message ID 20231215064543.610485-1-psatheesh@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/cnxk: fix issue with RSS configuration for cnxk |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Satheesh Paul Antonysamy Dec. 15, 2023, 6:45 a.m. UTC
  From: Kiran Kumar K <kirankumark@marvell.com>

While creating a RSS rule, if no RSS types are specified,
use RSS types from dev config.

Fixes: bc778a17fa46 ("net/cnxk: support flow RSS")
Cc: stable@dpdk.org

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
---
 drivers/net/cnxk/cnxk_flow.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
  

Comments

Jerin Jacob Dec. 16, 2023, 4:35 a.m. UTC | #1
On Fri, Dec 15, 2023 at 4:28 PM <psatheesh@marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> While creating a RSS rule, if no RSS types are specified,
> use RSS types from dev config.
>
> Fixes: bc778a17fa46 ("net/cnxk: support flow RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
> Reviewed-by: Satheesh Paul <psatheesh@marvell.com>

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-main. Thanks

    net/cnxk: fix RSS configuration

    While creating a RSS rule, if no RSS types are specified,
    use RSS types from dev config.

    Fixes: bc778a17fa46 ("net/cnxk: support flow RSS")
    Cc: stable@dpdk.org

    Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
    Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
  

Patch

diff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c
index 11670d37e0..a92b61c332 100644
--- a/drivers/net/cnxk/cnxk_flow.c
+++ b/drivers/net/cnxk/cnxk_flow.c
@@ -103,15 +103,19 @@  npc_rss_action_validate(struct rte_eth_dev *eth_dev, const struct rte_flow_attr
 }
 
 static void
-npc_rss_flowkey_get(struct cnxk_eth_dev *eth_dev,
-		    const struct roc_npc_action *rss_action,
-		    uint32_t *flowkey_cfg)
+npc_rss_flowkey_get(struct cnxk_eth_dev *eth_dev, const struct roc_npc_action *rss_action,
+		    uint32_t *flowkey_cfg, uint64_t default_rss_types)
 {
 	const struct roc_npc_action_rss *rss;
+	uint64_t rss_types;
 
 	rss = (const struct roc_npc_action_rss *)rss_action->conf;
+	rss_types = rss->types;
+	/* If no RSS types are specified, use default one */
+	if (rss_types == 0)
+		rss_types = default_rss_types;
 
-	*flowkey_cfg = cnxk_rss_ethdev_to_nix(eth_dev, rss->types, rss->level);
+	*flowkey_cfg = cnxk_rss_ethdev_to_nix(eth_dev, rss_types, rss->level);
 }
 
 static int
@@ -293,7 +297,8 @@  cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,
 				goto err_exit;
 			in_actions[i].type = ROC_NPC_ACTION_TYPE_RSS;
 			in_actions[i].conf = actions->conf;
-			npc_rss_flowkey_get(dev, &in_actions[i], flowkey_cfg);
+			npc_rss_flowkey_get(dev, &in_actions[i], flowkey_cfg,
+					    eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf);
 			break;
 
 		case RTE_FLOW_ACTION_TYPE_SECURITY: