OSDN Git Service

net/mlx5e: E-Switch, Maintain vhca_id to vport_num mapping
authorVlad Buslov <vladbu@nvidia.com>
Wed, 23 Sep 2020 14:26:42 +0000 (17:26 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 6 Feb 2021 04:53:34 +0000 (20:53 -0800)
commit84ae9c1f29c06cb4aaf9b1ad290e0abee44ceebc
treeb3c0bd97b9be7d40b598fdd93eee7db5d5721f89
parentb055ecf5827d81a60144560266a78fea652bdf1a
net/mlx5e: E-Switch, Maintain vhca_id to vport_num mapping

Following patches in the series need to be able to map VF netdev to vport.
Since it is trivial to obtain vhca_id from netdev, maintain mapping from
vhca_id to vport_num inside eswitch offloads using xarray. Provide function
mlx5_eswitch_vhca_id_to_vport() to be used by TC code in following patches
to obtain the mapping.

Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
drivers/net/ethernet/mellanox/mlx5/core/vport.c