{IB, net}/mlx5: E-Switch, Use index of rep for vport to IB port mapping
authorBodong Wang <bodong@mellanox.com>
Fri, 28 Jun 2019 22:35:53 +0000 (22:35 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 1 Jul 2019 23:40:30 +0000 (16:40 -0700)
commit2f69e591e4531d3192841a4eb2bd9b512f5a8b66
treec75dfc8f7340bbb48f52e02c6dfc49df4e6f6d82
parentd6518db278ed64561aa58f74ef5f3ee2f9dbe546
{IB, net}/mlx5: E-Switch, Use index of rep for vport to IB port mapping

In the single IB device mode, the mapping between vport number and
rep relies on a counter. However for dynamic vport allocation, it is
desired to keep consistent map of eswitch vport and IB port.

Hence, simplify code to remove the free running counter and instead
use the available vport index during load/unload sequence from the
eswitch.

Signed-off-by: Bodong Wang <bodong@mellanox.com>
Suggested-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/infiniband/hw/mlx5/ib_rep.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
include/linux/mlx5/eswitch.h