OSDN Git Service

net/mlx5: E-Switch, Support flow source for local vport
authorHamdan Igbaria <hamdani@mellanox.com>
Sun, 30 Aug 2020 09:32:37 +0000 (12:32 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 1 Oct 2020 04:26:30 +0000 (21:26 -0700)
Set flow source as hint for local vport.

Signed-off-by: Hamdan Igbaria <hamdani@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

index e977d85..c9c2962 100644 (file)
@@ -247,8 +247,11 @@ mlx5_eswitch_set_rule_flow_source(struct mlx5_eswitch *esw,
                                  struct mlx5_esw_flow_attr *attr)
 {
        if (MLX5_CAP_ESW_FLOWTABLE(esw->dev, flow_source) &&
-           attr && attr->in_rep && attr->in_rep->vport == MLX5_VPORT_UPLINK)
-               spec->flow_context.flow_source = MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK;
+           attr && attr->in_rep)
+               spec->flow_context.flow_source =
+                       attr->in_rep->vport == MLX5_VPORT_UPLINK ?
+                               MLX5_FLOW_CONTEXT_FLOW_SOURCE_UPLINK :
+                               MLX5_FLOW_CONTEXT_FLOW_SOURCE_LOCAL_VPORT;
 }
 
 static void