Skip to content

Commit

Permalink
net/cnxk: fix flow RSS configuration
Browse files Browse the repository at this point in the history
[ upstream commit 752ce2f3e5bf7bd8add8dc9629f3b824886c641e ]

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

Fixes: bc778a1 ("net/cnxk: support flow RSS")

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
  • Loading branch information
Kiran Kumar K authored and kevintraynor committed Mar 5, 2024
1 parent 638141e commit 5a59e07
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions drivers/net/cnxk/cnxk_rte_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,19 @@ npc_rss_action_validate(struct rte_eth_dev *eth_dev,
}

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
Expand Down Expand Up @@ -196,7 +200,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:
Expand Down

0 comments on commit 5a59e07

Please sign in to comment.