[dpdk-dev] [PATCH] net/mlx5: fix empty RSS flow action

Nelio Laranjeiro nelio.laranjeiro at 6wind.com
Tue Apr 18 10:30:11 CEST 2017


Empty RSS action is causing a segmentation fault.

Fixes: 3d821d6fea40 ("net/mlx5: support RSS action flow rule")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
Acked-by: Shahaf Shuler <shahafs at mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 8d62f85..1784e64 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -506,6 +506,13 @@ priv_flow_validate(struct priv *priv,
 				actions->conf;
 			uint16_t n;
 
+			if (!rss || !rss->num) {
+				rte_flow_error_set(error, EINVAL,
+						   RTE_FLOW_ERROR_TYPE_ACTION,
+						   actions,
+						   "no valid queues");
+				return -rte_errno;
+			}
 			if (action->queues_n == 1) {
 				uint16_t found = 0;
 
-- 
2.1.4



More information about the dev mailing list