]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5e: Fix pfnum in devlink port attribute
authorParav Pandit <parav@mellanox.com>
Fri, 3 Apr 2020 08:57:30 +0000 (03:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Apr 2020 07:06:26 +0000 (09:06 +0200)
commit866da7da6e36b02b28b92b00efde44b56d279a63
tree62e8573f6b82b8cb2b0e2e021c30304424c61b32
parenta132dc5aff2a86387c4030be4258bfaa280f412c
net/mlx5e: Fix pfnum in devlink port attribute

[ Upstream commit 7482d9cb5b974b7ad1a58fa8714f7a8c05b5d278 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c