examples/l2fwd-crypto: fix AEAD key setting
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.c
index bbfa85c..86be929 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) {
@@ -1600,3 +1600,30 @@ priv_flow_rxq_in_use(struct priv *priv, struct rxq *rxq)
        }
        return 0;
 }
+
+/**
+ * Isolated mode.
+ *
+ * @see rte_flow_isolate()
+ * @see rte_flow_ops
+ */
+int
+mlx5_flow_isolate(struct rte_eth_dev *dev,
+                 int enable,
+                 struct rte_flow_error *error)
+{
+       struct priv *priv = dev->data->dev_private;
+
+       priv_lock(priv);
+       if (priv->started) {
+               rte_flow_error_set(error, EBUSY,
+                                  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+                                  NULL,
+                                  "port must be stopped first");
+               priv_unlock(priv);
+               return -rte_errno;
+       }
+       priv->isolated = !!enable;
+       priv_unlock(priv);
+       return 0;
+}