]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: DR, Add support for SF vports
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Thu, 9 Sep 2021 14:32:46 +0000 (17:32 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 30 Sep 2021 23:18:59 +0000 (16:18 -0700)
commit11a45def2e197532c46aa908dedd52bc1ee378a2
treeade3def0ad7d4681ea7ddbf5df51b059fa6e2795
parentc0e90fc2ccaa8d7b9a781f5bc4287084b855138e
net/mlx5: DR, Add support for SF vports

Move all the vport capabilities to a separate struct and store vport caps
in XArray: SFs vport numbers will not come in the same range as VF vports,
so the existing implementation of vport capabilities as a fixed size array
is not suitable here.

XArray is a perfect fit: it is efficient when the indices used are densely
clustered. In addition to being a perfect fit as a dynamic data structure,
XArray also provides locking - it uses RCU and an internal spinlock to
synchronise access, so no additional protection needed.

Now except for the eswitch manager vport, all other vports (including the
uplink vport) are handled in the same way: when a new go-to-vport action
is added, this vport's caps are loaded from the xarray. If it is the first
time for this particular vport number, then its capabilities are queried
from FW and filled in into the appropriate entry.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Muhammad Sammar <muhammads@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h