summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_flow.c
diff options
context:
space:
mode:
authorDekel Peled <dekelp@mellanox.com>2019-01-22 10:22:24 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-01-24 14:53:10 +0100
commit15c80155874e6eef8e1023edab233d4bc6868ad9 (patch)
tree6ebd79c5d6dfba76cafb0430e079221671762d3e /drivers/net/mlx5/mlx5_flow.c
parentff160dbcba6274bfcb22bbb05155c80c011f996d (diff)
downloaddpdk-next-eventdev-15c80155874e6eef8e1023edab233d4bc6868ad9.zip
dpdk-next-eventdev-15c80155874e6eef8e1023edab233d4bc6868ad9.tar.gz
dpdk-next-eventdev-15c80155874e6eef8e1023edab233d4bc6868ad9.tar.xz
net/mlx5: block RSS action without Rx queue
This patch modifies function mlx5_flow_validate_action_rss(), to prevent the setting of rule with rss action, but without specifying any queues. For example: flow create 0 ingress pattern end actions rss queues end / end Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_flow.c')
-rw-r--r--drivers/net/mlx5/mlx5_flow.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f91aecd..11213e2 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -947,6 +947,10 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION_CONF,
NULL, "No Rx queues configured");
+ if (!rss->queue_num)
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION_CONF,
+ NULL, "No queues configured");
for (i = 0; i != rss->queue_num; ++i) {
if (!(*priv->rxqs)[rss->queue[i]])
return rte_flow_error_set