Skip to content

Commit

Permalink
net/mlx5: E-Switch, Use vport metadata matching only when mandatory
Browse files Browse the repository at this point in the history
Multi-port RoCE mode requires tagging traffic that passes through the
vport.
This matching can cause performance degradation, therefore disable it
and use the legacy matching on vhca_id and source_port when possible.

Fixes: 92ab1eb ("net/mlx5: E-Switch, Enable vport metadata matching if firmware supports it")
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Majd Dibbiny authored and Saeed Mahameed committed Mar 9, 2020
1 parent 2f5438c commit 1e62e22
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,18 @@ esw_check_vport_match_metadata_supported(const struct mlx5_eswitch *esw)
return true;
}

static bool
esw_check_vport_match_metadata_mandatory(const struct mlx5_eswitch *esw)
{
return mlx5_core_mp_enabled(esw->dev);
}

static bool esw_use_vport_metadata(const struct mlx5_eswitch *esw)
{
return esw_check_vport_match_metadata_mandatory(esw) &&
esw_check_vport_match_metadata_supported(esw);
}

int
esw_vport_create_offloads_acl_tables(struct mlx5_eswitch *esw,
struct mlx5_vport *vport)
Expand Down Expand Up @@ -2059,7 +2071,7 @@ static int esw_create_uplink_offloads_acl_tables(struct mlx5_eswitch *esw)
struct mlx5_vport *vport;
int err;

if (esw_check_vport_match_metadata_supported(esw))
if (esw_use_vport_metadata(esw))
esw->flags |= MLX5_ESWITCH_VPORT_MATCH_METADATA;

vport = mlx5_eswitch_get_vport(esw, MLX5_VPORT_UPLINK);
Expand Down

0 comments on commit 1e62e22

Please sign in to comment.