Commit 93cd765b authored by Anjali Singhai Jain's avatar Anjali Singhai Jain Committed by Jeff Kirsher

i40e: Add a new variable to track number of pf instances

Track the number of physical functions (PFs) found, this is a global counter
on purpose so that each pf loaded has a unique ID.

Change-Id: I74d618520afbce4a774d0235449e3b5f97ff6d4a
Signed-off-by: default avatarAnjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 4a38d09c
...@@ -276,6 +276,8 @@ struct i40e_pf { ...@@ -276,6 +276,8 @@ struct i40e_pf {
struct dentry *i40e_dbg_pf; struct dentry *i40e_dbg_pf;
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
u16 instance; /* A unique number per i40e_pf instance in the system */
/* sr-iov config info */ /* sr-iov config info */
struct i40e_vf *vf; struct i40e_vf *vf;
int num_alloc_vfs; /* actual number of VFs allocated */ int num_alloc_vfs; /* actual number of VFs allocated */
......
...@@ -7176,6 +7176,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7176,6 +7176,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct i40e_driver_version dv; struct i40e_driver_version dv;
struct i40e_pf *pf; struct i40e_pf *pf;
struct i40e_hw *hw; struct i40e_hw *hw;
static u16 pfs_found;
int err = 0; int err = 0;
u32 len; u32 len;
...@@ -7241,6 +7242,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7241,6 +7242,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
hw->subsystem_device_id = pdev->subsystem_device; hw->subsystem_device_id = pdev->subsystem_device;
hw->bus.device = PCI_SLOT(pdev->devfn); hw->bus.device = PCI_SLOT(pdev->devfn);
hw->bus.func = PCI_FUNC(pdev->devfn); hw->bus.func = PCI_FUNC(pdev->devfn);
pf->instance = pfs_found;
/* do a special CORER for clearing PXE mode once at init */ /* do a special CORER for clearing PXE mode once at init */
if (hw->revision_id == 0 && if (hw->revision_id == 0 &&
...@@ -7391,6 +7393,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -7391,6 +7393,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
i40e_flush(hw); i40e_flush(hw);
} }
pfs_found++;
i40e_dbg_pf_init(pf); i40e_dbg_pf_init(pf);
/* tell the firmware that we're starting */ /* tell the firmware that we're starting */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment