net/mlx4: fix flow creation before start
[dpdk.git] / drivers / net / mlx4 / mlx4_flow.c
index 8ade106..925c89c 100644 (file)
@@ -977,7 +977,7 @@ priv_flow_create_action_queue(struct priv *priv,
                return NULL;
        }
        if (action->drop) {
-               qp = priv->flow_drop_queue->qp;
+               qp = priv->flow_drop_queue ? priv->flow_drop_queue->qp : NULL;
        } else {
                int ret;
                unsigned int i;
@@ -1015,6 +1015,8 @@ priv_flow_create_action_queue(struct priv *priv,
                rte_flow->qp = qp;
        }
        rte_flow->ibv_attr = ibv_attr;
+       if (!priv->started)
+               return rte_flow;
        rte_flow->ibv_flow = ibv_create_flow(qp, rte_flow->ibv_attr);
        if (!rte_flow->ibv_flow) {
                rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE,