summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_flow_dv.c
diff options
context:
space:
mode:
authorOphir Munk <ophirmu@mellanox.com>2018-11-04 12:10:20 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-11-05 15:01:25 +0100
commitf1b85a2719dddbdc7c76855dfa42be290f180480 (patch)
treeee989bbfce3d9a0d52496a7f69abf29d346464a4 /drivers/net/mlx5/mlx5_flow_dv.c
parente7d2e32b26f83b69128f80a7d025dca149c5a126 (diff)
downloaddpdk-next-eventdev-f1b85a2719dddbdc7c76855dfa42be290f180480.zip
dpdk-next-eventdev-f1b85a2719dddbdc7c76855dfa42be290f180480.tar.gz
dpdk-next-eventdev-f1b85a2719dddbdc7c76855dfa42be290f180480.tar.xz
net/mlx5: support default RSS key as null
Applications which add RSS rules must supply an RSS key and length. If an application is only interested in default RSS operation it should not care about the exact RSS key. By setting the key to NULL - the PMD will use the default RSS key. In addition if the application does not care about the RSS type it can set it to 0 and the PMD will use the default type (ETH_RSS_IP). Signed-off-by: Ophir Munk <ophirmu@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_flow_dv.c')
-rw-r--r--drivers/net/mlx5/mlx5_flow_dv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c11ecd4..1d5b6bf 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1722,6 +1722,7 @@ flow_dv_create_action(struct rte_eth_dev *dev,
int actions_n = dev_flow->dv.actions_n;
struct rte_flow *flow = dev_flow->flow;
const struct rte_flow_action *action_ptr = action;
+ const uint8_t *rss_key;
switch (action->type) {
case RTE_FLOW_ACTION_TYPE_VOID:
@@ -1758,8 +1759,11 @@ flow_dv_create_action(struct rte_eth_dev *dev,
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;
/* Added to array only in apply since we need the QP */
flow->actions |= MLX5_FLOW_ACTION_RSS;