summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_flow_verbs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx5/mlx5_flow_verbs.c')
-rw-r--r--drivers/net/mlx5/mlx5_flow_verbs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index 2e506b9..54ac620 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -925,14 +925,18 @@ flow_verbs_translate_action_rss(const struct rte_flow_action *action,
struct mlx5_flow *dev_flow)
{
const struct rte_flow_action_rss *rss = action->conf;
+ const uint8_t *rss_key;
struct rte_flow *flow = dev_flow->flow;
if (flow->queue)
memcpy((*flow->queue), rss->queue,
rss->queue_num * sizeof(uint16_t));
flow->rss.queue_num = rss->queue_num;
- memcpy(flow->key, rss->key, MLX5_RSS_HASH_KEY_LEN);
- flow->rss.types = rss->types;
+ /* NULL RSS key indicates default RSS key. */
+ rss_key = !rss->key ? rss_hash_default_key : rss->key;
+ memcpy(flow->key, rss_key, MLX5_RSS_HASH_KEY_LEN);
+ /* RSS type 0 indicates default RSS type (ETH_RSS_IP). */
+ flow->rss.types = !rss->types ? ETH_RSS_IP : rss->types;
flow->rss.level = rss->level;
*action_flags |= MLX5_FLOW_ACTION_RSS;
}