net/mlx5: E-switch, Use PF num in metadata reg c0
authorsunils <sunils@nvidia.com>
Thu, 10 Sep 2020 21:13:26 +0000 (00:13 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 1 Oct 2020 04:26:28 +0000 (21:26 -0700)
commit7cd7becdddb00620fb8deb74e6fe4e5a1522ae5a
treeb5c38713ca611c1b1f78e4020452c8953373a814
parent01723919675dfa8d984b2b80b93092f39a4a84de
net/mlx5: E-switch, Use PF num in metadata reg c0

Currently only 256 vports can be supported as only 8 bits are
reserved for them and 8 bits are reserved for vhca_ids in
metadata reg c0. To support more than 256 vports, replace
vhca_id with a unique shorter 4-bit PF number which covers
upto 16 PF's. Use remaining 12 bits for vports ranging 1-4095.
This will continue to generate unique metadata even if
multiple PCI devices have same switch_id.

Signed-off-by: sunils <sunils@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Vu Pham <vuhuong@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
include/linux/mlx5/eswitch.h