From: NĂ©lio Laranjeiro Date: Tue, 31 Jan 2017 16:02:48 +0000 (+0100) Subject: net/mlx5: fix flow rule creation if ports are stopped X-Git-Tag: spdx-start~4560 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=05d7777b6fd49fd14cf302d0953057b345d4f8b7;p=dpdk.git net/mlx5: fix flow rule creation if ports are stopped Adding a flow when the port is stopped ends in an inconsistent situation where the queue can receive traffic when it should not. Record new rules and apply them as soon as the port is started. Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions") Signed-off-by: Nelio Laranjeiro Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 34ac5d3803..23c1b5ef3c 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -948,6 +948,8 @@ priv_flow_create_action_queue(struct priv *priv, NULL, "cannot allocate QP"); goto error; } + if (!priv->started) + return rte_flow; rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp, rte_flow->ibv_attr); if (!rte_flow->ibv_flow) {