[dpdk-dev] [PATCH 2/4] net/mlx5: fix flow single queue

Nelio Laranjeiro nelio.laranjeiro at 6wind.com
Tue Mar 13 15:17:37 CET 2018


The flow is created with any steering being applied in the NIC when the
device is handling a single Rx queue.

Fixes: cede123a158f ("net/mlx5: fix flow creation with a single target queue")
Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
Cc: stable at dpdk.org

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index e1ffb38a5..e7040daad 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -937,11 +937,12 @@ mlx5_flow_convert_finalise(struct mlx5_flow_parse *parser)
 	/* Remove any other flow not matching the pattern. */
 	if (parser->queues_n == 1) {
 		for (i = 0; i != hash_rxq_init_n; ++i) {
-			if (i == parser->layer || !parser->queue[i].ibv_attr)
+			if (i == HASH_RXQ_ETH)
 				continue;
 			rte_free(parser->queue[i].ibv_attr);
 			parser->queue[i].ibv_attr = NULL;
 		}
+		return;
 	}
 	if (parser->layer == HASH_RXQ_ETH) {
 		goto fill;
@@ -1807,6 +1808,7 @@ mlx5_flow_create_action_queue(struct rte_eth_dev *dev,
 	struct priv *priv = dev->data->dev_private;
 	int ret;
 	unsigned int i;
+	unsigned int flows_n = 0;
 
 	assert(priv->pd);
 	assert(priv->ctx);
@@ -1830,12 +1832,18 @@ mlx5_flow_create_action_queue(struct rte_eth_dev *dev,
 					   NULL, "flow rule creation failure");
 			goto error;
 		}
+		++flows_n;
 		DRV_LOG(DEBUG, "port %u %p type %d QP %p ibv_flow %p",
 			dev->data->port_id,
 			(void *)flow, i,
 			(void *)flow->frxq[i].hrxq,
 			(void *)flow->frxq[i].ibv_flow);
 	}
+	if (!flows_n) {
+		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE,
+				   NULL, "internal error in flow creation");
+		goto error;
+	}
 	for (i = 0; i != parser->queues_n; ++i) {
 		struct mlx5_rxq_data *q =
 			(*priv->rxqs)[parser->queues[i]];
-- 
2.11.0



More information about the dev mailing list