net/mlx5: fix setting of port ID for egress rules
authorDekel Peled <dekelp@mellanox.com>
Wed, 22 Jan 2020 12:33:06 +0000 (14:33 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 08:51:20 +0000 (09:51 +0100)
Previous patch fixed the setting of port-id for eswitch rules, which
are ingress only.
This patch expands the fix, to support NIC rules as well, which can
be ingress or egress.

Fixes: ce777b147bf8 ("net/mlx5: fix E-Switch flow without port item")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
drivers/net/mlx5/mlx5_flow_dv.c

index a32f0be..c2900c5 100644 (file)
@@ -7602,13 +7602,13 @@ cnt_err:
                item_flags |= last_item;
        }
        /*
                item_flags |= last_item;
        }
        /*
-        * In case of ingress traffic when E-Switch mode is enabled,
-        * we have two cases where we need to set the source port manually.
+        * When E-Switch mode is enabled, we have two cases where we need to
+        * set the source port manually.
         * The first one, is in case of Nic steering rule, and the second is
         * E-Switch rule where no port_id item was found. In both cases
         * the source port is set according the current port in use.
         */
         * The first one, is in case of Nic steering rule, and the second is
         * E-Switch rule where no port_id item was found. In both cases
         * the source port is set according the current port in use.
         */
-       if ((attr->ingress && !(item_flags & MLX5_FLOW_ITEM_PORT_ID)) &&
+       if (!(item_flags & MLX5_FLOW_ITEM_PORT_ID) &&
            (priv->representor || priv->master)) {
                if (flow_dv_translate_item_port_id(dev, match_mask,
                                                   match_value, NULL))
            (priv->representor || priv->master)) {
                if (flow_dv_translate_item_port_id(dev, match_mask,
                                                   match_value, NULL))