net/mlx5: split hairpin flows
[dpdk.git] / drivers / net / mlx5 / mlx5_flow_verbs.c
index 23110f2..fd27f6c 100644 (file)
@@ -191,7 +191,7 @@ flow_verbs_counter_query(struct rte_eth_dev *dev __rte_unused,
 {
 #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) || \
        defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45)
-       if (flow->actions & MLX5_FLOW_ACTION_COUNT) {
+       if (flow->counter->cs) {
                struct rte_flow_query_count *qc = data;
                uint64_t counters[2] = {0, 0};
 #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42)
@@ -1410,7 +1410,6 @@ flow_verbs_translate(struct rte_eth_dev *dev,
                     const struct rte_flow_action actions[],
                     struct rte_flow_error *error)
 {
-       struct rte_flow *flow = dev_flow->flow;
        uint64_t item_flags = 0;
        uint64_t action_flags = 0;
        uint64_t priority = attr->priority;
@@ -1460,7 +1459,7 @@ flow_verbs_translate(struct rte_eth_dev *dev,
                                                  "action not supported");
                }
        }
-       flow->actions = action_flags;
+       dev_flow->actions = action_flags;
        for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) {
                int tunnel = !!(item_flags & MLX5_FLOW_LAYER_TUNNEL);
 
@@ -1592,7 +1591,7 @@ flow_verbs_remove(struct rte_eth_dev *dev, struct rte_flow *flow)
                        verbs->flow = NULL;
                }
                if (verbs->hrxq) {
-                       if (flow->actions & MLX5_FLOW_ACTION_DROP)
+                       if (dev_flow->actions & MLX5_FLOW_ACTION_DROP)
                                mlx5_hrxq_drop_release(dev);
                        else
                                mlx5_hrxq_release(dev, verbs->hrxq);
@@ -1656,7 +1655,7 @@ flow_verbs_apply(struct rte_eth_dev *dev, struct rte_flow *flow,
 
        LIST_FOREACH(dev_flow, &flow->dev_flows, next) {
                verbs = &dev_flow->verbs;
-               if (flow->actions & MLX5_FLOW_ACTION_DROP) {
+               if (dev_flow->actions & MLX5_FLOW_ACTION_DROP) {
                        verbs->hrxq = mlx5_hrxq_drop_new(dev);
                        if (!verbs->hrxq) {
                                rte_flow_error_set
@@ -1717,7 +1716,7 @@ error:
        LIST_FOREACH(dev_flow, &flow->dev_flows, next) {
                verbs = &dev_flow->verbs;
                if (verbs->hrxq) {
-                       if (flow->actions & MLX5_FLOW_ACTION_DROP)
+                       if (dev_flow->actions & MLX5_FLOW_ACTION_DROP)
                                mlx5_hrxq_drop_release(dev);
                        else
                                mlx5_hrxq_release(dev, verbs->hrxq);