diff options
author | David S. Miller <davem@davemloft.net> | 2012-09-27 22:19:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-27 22:19:02 -0400 |
commit | d9f72f359e00a45a6cd7cc2d5121b04b9dc927e1 (patch) | |
tree | 0a00981dece90214c7c87f7a376aca21d13af05c | |
parent | 404f7c9e118e0c92902afe1853d35f5638fe4a4c (diff) |
Revert "be2net: fix vfs enumeration"
This reverts commit 51af6d7c1f31e0f3d42c87d53657ec7acb6e3462.
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>
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 966d9afb652..84379f4fe83 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1076,7 +1076,7 @@ static int be_set_vf_tx_rate(struct net_device *netdev, | |||
1076 | static int be_find_vfs(struct be_adapter *adapter, int vf_state) | 1076 | static int be_find_vfs(struct be_adapter *adapter, int vf_state) |
1077 | { | 1077 | { |
1078 | struct pci_dev *dev, *pdev = adapter->pdev; | 1078 | struct pci_dev *dev, *pdev = adapter->pdev; |
1079 | int vfs = 0, assigned_vfs = 0, pos; | 1079 | int vfs = 0, assigned_vfs = 0, pos, vf_fn; |
1080 | u16 offset, stride; | 1080 | u16 offset, stride; |
1081 | 1081 | ||
1082 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); | 1082 | 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) | |||
1087 | 1087 | ||
1088 | dev = pci_get_device(pdev->vendor, PCI_ANY_ID, NULL); | 1088 | dev = pci_get_device(pdev->vendor, PCI_ANY_ID, NULL); |
1089 | while (dev) { | 1089 | while (dev) { |
1090 | if (dev->is_virtfn && dev->physfn == pdev) { | 1090 | vf_fn = (pdev->devfn + offset + stride * vfs) & 0xFFFF; |
1091 | if (dev->is_virtfn && dev->devfn == vf_fn && | ||
1092 | dev->bus->number == pdev->bus->number) { | ||
1091 | vfs++; | 1093 | vfs++; |
1092 | if (dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) | 1094 | if (dev->dev_flags & PCI_DEV_FLAGS_ASSIGNED) |
1093 | assigned_vfs++; | 1095 | assigned_vfs++; |