Thread (18 messages) flat view 18 messages, 5 authors, 2012-02-09

RE: [net 2/8] igb: fix vf lookup

From: Rose, Gregory V <hidden>
Date: 2012-02-08 23:42:53

quoted hunk ↗ jump to hunk
-----Original Message-----
From: Kirsher, Jeffrey T
Sent: Wednesday, February 08, 2012 1:37 AM
To: davem@davemloft.net
Cc: Rose, Gregory V; netdev@vger.kernel.org; gospo@redhat.com;
sassmann@redhat.com; stable@vger.kernel.org; Kirsher, Jeffrey T
Subject: [net 2/8] igb: fix vf lookup

From: Greg Rose <redacted>

Recent addition of code to find already allocated VFs failed to take
account that systems with 2 or more multi-port SR-IOV capable controllers
might have already enabled VFs.  Make sure that the VFs the function is
finding are actually subordinate to the particular instance of the adapter
that is looking for them and not subordinate to some device that has
previously enabled SR-IOV.

This is applicable to 3.2+ kernels.

CC: stable@vger.kernel.org
Reported-by: David Ahern <redacted>
Signed-off-by: Greg Rose <redacted>
Tested-by: Robert E Garrett <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/ethernet/intel/igb/igb_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
b/drivers/net/ethernet/intel/igb/igb_main.c
index e91d73c..94be6c3 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5012,7 +5012,8 @@ static int igb_find_enabled_vfs(struct igb_adapter
*adapter)
 	vf_devfn = pdev->devfn + 0x80;
 	pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
 	while (pvfdev) {
-		if (pvfdev->devfn == vf_devfn)
+		if (pvfdev->devfn == vf_devfn &&
+		    (pvfdev->bus->number >= pdev->bus->number))
 			vfs_found++;
 		vf_devfn += vf_stride;
 		pvfdev = pci_get_device(hw->vendor_id,
--
1.7.7.6
I'll fix this one too.  You start leaning on checkpatch and you get lazy I guess.

- Greg
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help