net/mlx5: fix creation of drop flows
authorNélio Laranjeiro <nelio.laranjeiro@6wind.com>
Thu, 15 Jun 2017 08:25:16 +0000 (10:25 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:56 +0000 (15:00 +0200)
Drop flows being created when the port is stop should not access to the
drop table hash queues as it is invalid.

Fixes: 028761059aeb ("net/mlx5: use an RSS drop queue")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5_flow.c

index bbfa85c..b7b7c83 100644 (file)
@@ -1015,7 +1015,6 @@ priv_flow_create_action_queue_drop(struct priv *priv,
                return NULL;
        }
        rte_flow->drop = 1;
-       rte_flow->qp = priv->flow_drop_queue->qp;
 #ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP
        drop = (void *)((uintptr_t)flow->ibv_attr + flow->offset);
        *drop = (struct ibv_exp_flow_spec_action_drop){
@@ -1028,6 +1027,7 @@ priv_flow_create_action_queue_drop(struct priv *priv,
        rte_flow->ibv_attr = flow->ibv_attr;
        if (!priv->started)
                return rte_flow;
+       rte_flow->qp = priv->flow_drop_queue->qp;
        rte_flow->ibv_flow = ibv_exp_create_flow(rte_flow->qp,
                                                 rte_flow->ibv_attr);
        if (!rte_flow->ibv_flow) {