nfp: print a warning when binding VFs to PF driver
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 12 Jun 2019 23:59:03 +0000 (16:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Jun 2019 02:18:27 +0000 (19:18 -0700)
Users sometimes mistakenly try to manually bind the PF driver
to the VFs, print a warning message in that case.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_main.c

index 948d1a4b46439b61f7d4cd7ba197ce2b14b04d85..60e57f08de80ee43876bfb1f358e2f6811d0c9dd 100644 (file)
@@ -596,6 +596,10 @@ static int nfp_pci_probe(struct pci_dev *pdev,
        struct nfp_pf *pf;
        int err;
 
+       if (pdev->vendor == PCI_VENDOR_ID_NETRONOME &&
+           pdev->device == PCI_DEVICE_ID_NETRONOME_NFP6000_VF)
+               dev_warn(&pdev->dev, "Binding NFP VF device to the NFP PF driver, the VF driver is called 'nfp_netvf'\n");
+
        err = pci_enable_device(pdev);
        if (err < 0)
                return err;