Thread (28 messages) 28 messages, 5 authors, 2013-12-10

[net-next 14/14] i40e: Add a new variable to track number of pf instances

flat view
STALE4696d SUPERSEDED: 1 (0M)

From: Jeff Kirsher <hidden>
Date: 2013-12-07 02:17:34
Subsystem: intel ethernet drivers, networking drivers, the rest · Maintainers: Tony Nguyen, Przemek Kitszel, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 58 in this series; 1 review trailer.

Revisions (58)
  1. v1
  2. v2 [diff vs current]
  3. v1
  4. v1
  5. v1
  6. v1
  7. v1
  8. v1
  9. v1
  10. v1
  11. v1
  12. v2 [diff vs current]
  13. v1
  14. v1
  15. v1
  16. v1
  17. v1
  18. v1
  19. v2 [diff vs current]
  20. v1
  21. v2 [diff vs current]
  22. v1
  23. v2 [diff vs current]
  24. v1
  25. v2 [diff vs current]
  26. v1
  27. v1 current
  28. v1
  29. v1
  30. v1
  31. v2 [diff vs current]
  32. v3 [diff vs current]
  33. v4 [diff vs current]
  34. v5 [diff vs current]
  35. v1
  36. v1
  37. v1
  38. v2 [diff vs current]
  39. v1
  40. v1
  41. v2 [diff vs current]
  42. v3 [diff vs current]
  43. v1
  44. v1
  45. v2 [diff vs current]
  46. v1
  47. v2 [diff vs current]
  48. v3 [diff vs current]
  49. v1
  50. v1
  51. v1
  52. v2 [diff vs current]
  53. v1
  54. v1
  55. v1
  56. v1
  57. v1
  58. v1
From: Anjali Singhai Jain <redacted>

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 <redacted>
Signed-off-by: Jesse Brandeburg <redacted>
Tested-by: Kavindya Deegala <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/ethernet/intel/i40e/i40e.h      | 2 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
 2 files changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 5aa2ea2..001d7cf 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -276,6 +276,8 @@ struct i40e_pf {
 	struct dentry *i40e_dbg_pf;
 #endif /* CONFIG_DEBUG_FS */
 
+	u16 instance; /* A unique number per i40e_pf instance in the system */
+
 	/* sr-iov config info */
 	struct i40e_vf *vf;
 	int num_alloc_vfs;	/* actual number of VFs allocated */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 08ac960..d2b48bb2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -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_pf *pf;
 	struct i40e_hw *hw;
+	static u16 pfs_found;
 	int err = 0;
 	u32 len;
 
@@ -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->bus.device = PCI_SLOT(pdev->devfn);
 	hw->bus.func = PCI_FUNC(pdev->devfn);
+	pf->instance = pfs_found;
 
 	/* do a special CORER for clearing PXE mode once at init */
 	if (hw->revision_id == 0 &&
@@ -7391,6 +7393,8 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		i40e_flush(hw);
 	}
 
+	pfs_found++;
+
 	i40e_dbg_pf_init(pf);
 
 	/* tell the firmware that we're starting */
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help