diff options
author | Sivakumar Subramani <Sivakumar.Subramani@neterion.com> | 2009-06-16 14:48:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-17 07:31:14 -0400 |
commit | 5dbc901172fb952409940cd7ca55d8e6e5a7cc2c (patch) | |
tree | db90856015b0373b3b545901db2d98f88fef4039 /drivers/net/vxge/vxge-main.c | |
parent | a42fc8f6943127787ad2a416436cf211d5531229 (diff) |
vxge: Enable SRIOV support in the driver.
- Enabled SRIOV support in the driver.
- Call __vxge_hw_verify_pci_e_info() for the PF only. This function
verifies the negotiated link width and current link speed in the
Link Status Register (offset 12h) which are reserved fields for VFs
as per the SRIOV specification, section 3.5.8.
- Implemented David Miller's comment to remove the #ifdef CONFIG_PCI_IOV as
these intefaces have NOP versions declared when the defintion is not set.
Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com>
Signed-off-by: Rastapur Santosh <santosh.rastapur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-main.c')
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 6c838b3e063a..6034497536a4 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
@@ -4203,6 +4203,16 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
4203 | max_vpath_supported++; | 4203 | max_vpath_supported++; |
4204 | } | 4204 | } |
4205 | 4205 | ||
4206 | /* Enable SRIOV mode, if firmware has SRIOV support and if it is a PF */ | ||
4207 | if ((VXGE_HW_FUNCTION_MODE_SRIOV == | ||
4208 | ll_config.device_hw_info.function_mode) && | ||
4209 | (max_config_dev > 1) && (pdev->is_physfn)) { | ||
4210 | ret = pci_enable_sriov(pdev, max_config_dev - 1); | ||
4211 | if (ret) | ||
4212 | vxge_debug_ll_config(VXGE_ERR, | ||
4213 | "Failed to enable SRIOV: %d \n", ret); | ||
4214 | } | ||
4215 | |||
4206 | /* | 4216 | /* |
4207 | * Configure vpaths and get driver configured number of vpaths | 4217 | * Configure vpaths and get driver configured number of vpaths |
4208 | * which is less than or equal to the maximum vpaths per function. | 4218 | * which is less than or equal to the maximum vpaths per function. |
@@ -4366,6 +4376,7 @@ _exit6: | |||
4366 | 4376 | ||
4367 | vxge_device_unregister(hldev); | 4377 | vxge_device_unregister(hldev); |
4368 | _exit5: | 4378 | _exit5: |
4379 | pci_disable_sriov(pdev); | ||
4369 | vxge_hw_device_terminate(hldev); | 4380 | vxge_hw_device_terminate(hldev); |
4370 | _exit4: | 4381 | _exit4: |
4371 | iounmap(attr.bar1); | 4382 | iounmap(attr.bar1); |
@@ -4429,6 +4440,8 @@ vxge_remove(struct pci_dev *pdev) | |||
4429 | iounmap(vdev->bar0); | 4440 | iounmap(vdev->bar0); |
4430 | iounmap(vdev->bar1); | 4441 | iounmap(vdev->bar1); |
4431 | 4442 | ||
4443 | pci_disable_sriov(pdev); | ||
4444 | |||
4432 | /* we are safe to free it now */ | 4445 | /* we are safe to free it now */ |
4433 | free_netdev(dev); | 4446 | free_netdev(dev); |
4434 | 4447 | ||