Skip to content

Commit 93cd765

Browse files
anjalisinghai1Jeff Kirsher
authored andcommitted
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: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 4a38d09 commit 93cd765

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ struct i40e_pf {
276276
struct dentry *i40e_dbg_pf;
277277
#endif /* CONFIG_DEBUG_FS */
278278

279+
u16 instance; /* A unique number per i40e_pf instance in the system */
280+
279281
/* sr-iov config info */
280282
struct i40e_vf *vf;
281283
int num_alloc_vfs; /* actual number of VFs allocated */

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7176,6 +7176,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
71767176
struct i40e_driver_version dv;
71777177
struct i40e_pf *pf;
71787178
struct i40e_hw *hw;
7179+
static u16 pfs_found;
71797180
int err = 0;
71807181
u32 len;
71817182

@@ -7241,6 +7242,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
72417242
hw->subsystem_device_id = pdev->subsystem_device;
72427243
hw->bus.device = PCI_SLOT(pdev->devfn);
72437244
hw->bus.func = PCI_FUNC(pdev->devfn);
7245+
pf->instance = pfs_found;
72447246

72457247
/* do a special CORER for clearing PXE mode once at init */
72467248
if (hw->revision_id == 0 &&
@@ -7391,6 +7393,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
73917393
i40e_flush(hw);
73927394
}
73937395

7396+
pfs_found++;
7397+
73947398
i40e_dbg_pf_init(pf);
73957399

73967400
/* tell the firmware that we're starting */

0 commit comments

Comments
 (0)