Skip to content

Commit

Permalink
net/mlx5: Remove pointless vport lookup from mlx5_esw_check_port_type()
Browse files Browse the repository at this point in the history
As xa_get_mark() returns false in case the entry is not present,
no need to redundantly check if vport is present. Remove the lookup.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
  • Loading branch information
Jiri Pirko authored and Saeed Mahameed committed Jun 23, 2023
1 parent 899862b commit 29e4c95
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,12 +1908,6 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,

static bool mlx5_esw_check_port_type(struct mlx5_eswitch *esw, u16 vport_num, xa_mark_t mark)
{
struct mlx5_vport *vport;

vport = mlx5_eswitch_get_vport(esw, vport_num);
if (IS_ERR(vport))
return false;

return xa_get_mark(&esw->vports, vport_num, mark);
}

Expand Down

0 comments on commit 29e4c95

Please sign in to comment.