bnxt_en: Device serial number is supported only for PFs.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Wed, 22 May 2019 23:12:57 +0000 (19:12 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 May 2019 01:02:14 +0000 (18:02 -0700)
Don't read DSN on VFs that do not have the PCI capability.

Fixes: 03213a996531 ("bnxt: move bp->switch_id initialization to PF probe")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 79812daa41275b1adfd62e28ee8d80da97730c12..f758b2e0591fe1f0ca8d5f9c92d61cdc569a84a1 100644 (file)
@@ -10725,11 +10725,12 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto init_err_pci_clean;
        }
 
-       /* Read the adapter's DSN to use as the eswitch switch_id */
-       rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
-       if (rc)
-               goto init_err_pci_clean;
-
+       if (BNXT_PF(bp)) {
+               /* Read the adapter's DSN to use as the eswitch switch_id */
+               rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
+               if (rc)
+                       goto init_err_pci_clean;
+       }
        bnxt_hwrm_func_qcfg(bp);
        bnxt_hwrm_vnic_qcaps(bp);
        bnxt_hwrm_port_led_qcaps(bp);