net/mlx5e: Fix pfnum in devlink port attribute
authorParav Pandit <parav@mellanox.com>
Fri, 3 Apr 2020 08:57:30 +0000 (03:57 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 8 Apr 2020 22:46:49 +0000 (15:46 -0700)
commit7482d9cb5b974b7ad1a58fa8714f7a8c05b5d278
treed6ca87797d147171024e5d98e86182ff0058710b
parentd5a3c2b640093c8a4bb5d76170a8f6c8c2eacc17
net/mlx5e: Fix pfnum in devlink port attribute

Cited patch missed to extract PCI pf number accurately for PF and VF
port flavour. It considered PCI device + function number.
Due to this, device having non zero device number shown large pfnum.

Hence, use only PCI function number; to avoid similar errors, derive
pfnum one time for all port flavours.

Fixes: f60f315d339e ("net/mlx5e: Register devlink ports for physical link, PCI PF, VFs")
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c