dect
/
linux-2.6
Archived
13
0
Fork 0

Revert "be2net: fix vfs enumeration"

This reverts commit 51af6d7c1f.

Breaks the build with CONFIG_PCI_ATS not enabled.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2012-09-27 22:19:02 -04:00
parent 404f7c9e11
commit d9f72f359e
1 changed files with 4 additions and 2 deletions

View File

@ -1076,7 +1076,7 @@ static int be_set_vf_tx_rate(struct net_device *netdev,
static int be_find_vfs(struct be_adapter *adapter, int vf_state)
{
struct pci_dev *dev, *pdev = adapter->pdev;
int vfs = 0, assigned_vfs = 0, pos;
int vfs = 0, assigned_vfs = 0, pos, vf_fn;
u16 offset, stride;
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV);
@ -1087,7 +1087,9 @@ static int be_find_vfs(struct be_adapter *adapter, int vf_state)
dev = pci_get_device(pdev->vendor, PCI_ANY_ID, NULL);
while (dev) {
if (dev->is_virtfn && dev->physfn == pdev) {
vf_fn = (pdev->devfn + offset + stride * vfs) & 0xFFFF;
if (dev->is_virtfn && dev->devfn == vf_fn &&
dev->bus->number == pdev->bus->number) {
vfs++;
if (dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
assigned_vfs++;