diff options
author | Sathya Perla <sathya.perla@broadcom.com> | 2017-07-25 20:28:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-25 22:48:19 +0300 |
commit | 53f70b8b5aa06db53eb06f092342e6073891729a (patch) | |
tree | ad49fbd2ddb2214efd045008417397b9bd367821 /drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | |
parent | e408ebdc41aa53f0aa552132384daaa5f5c6301d (diff) | |
download | linux-53f70b8b5aa06db53eb06f092342e6073891729a.tar.xz |
bnxt_en: fix switchdev port naming for external-port-rep and vf-reps
Fix the phys_port_name for the external physical port to be in
"pA" format and that of VF-rep to be in "pCvfD" format as
suggested by Jakub Kicinski.
Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and get_phys_port_name")
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c index c00352a4c1f0..b05c5d0ee3f9 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c @@ -141,9 +141,11 @@ static int bnxt_vf_rep_get_phys_port_name(struct net_device *dev, char *buf, size_t len) { struct bnxt_vf_rep *vf_rep = netdev_priv(dev); + struct pci_dev *pf_pdev = vf_rep->bp->pdev; int rc; - rc = snprintf(buf, len, "vfr%d", vf_rep->vf_idx); + rc = snprintf(buf, len, "pf%dvf%d", PCI_FUNC(pf_pdev->devfn), + vf_rep->vf_idx); if (rc >= len) return -EOPNOTSUPP; return 0; |