net/mlx5: fix switch port id when representor in bonding
authorDong Zhou <dongzhou@nvidia.com>
Wed, 4 Nov 2020 06:04:55 +0000 (08:04 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 18:42:40 +0000 (19:42 +0100)
commitcdbdcd46a2b915c0781ecb2f48f412237daf03da
treee6c43cee8809f63f1c5a1d92a2122da304ae1f4e
parent105d2149657bedb4545970b93bca15163ba3754c
net/mlx5: fix switch port id when representor in bonding

In the bonding configurations the port switch id for representors was
composed of pf index in bonding as the 1 MSB and the representor's index
as the remaining 15 LSBs. The special corner case for the host PF
representor on BF setups with representor id 0xFFFF was missed as well.

The new switch port id consists of 4 MSBs for the pf bonding index and
the remaining 12 LSBs for the representor index. The switch port id
ranges for each type of representors are as follows:

Uplink representor(AKA master): 0xFFFF
Host PF representor: 0x<pf_bond>FFF
VF representor: 0x<pf_bond>[0-FFE]

Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding configuration")
Cc: stable@dpdk.org
Signed-off-by: Dong Zhou <dongzhou@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/mlx5_defs.h
drivers/net/mlx5/mlx5_ethdev.c