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 | |
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')
-rw-r--r-- | drivers/net/vxge/vxge-config.c | 12 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-main.c | 13 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-version.h | 4 |
3 files changed, 22 insertions, 7 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c index 26cde573af43..58d2551c78ed 100644 --- a/drivers/net/vxge/vxge-config.c +++ b/drivers/net/vxge/vxge-config.c | |||
@@ -454,7 +454,7 @@ __vxge_hw_verify_pci_e_info(struct __vxge_hw_device *hldev) | |||
454 | return VXGE_HW_OK; | 454 | return VXGE_HW_OK; |
455 | } | 455 | } |
456 | 456 | ||
457 | static enum vxge_hw_status | 457 | enum vxge_hw_status |
458 | __vxge_hw_device_is_privilaged(struct __vxge_hw_device *hldev) | 458 | __vxge_hw_device_is_privilaged(struct __vxge_hw_device *hldev) |
459 | { | 459 | { |
460 | if ((hldev->host_type == VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION || | 460 | if ((hldev->host_type == VXGE_HW_NO_MR_NO_SR_NORMAL_FUNCTION || |
@@ -676,10 +676,12 @@ enum vxge_hw_status __vxge_hw_device_initialize(struct __vxge_hw_device *hldev) | |||
676 | { | 676 | { |
677 | enum vxge_hw_status status = VXGE_HW_OK; | 677 | enum vxge_hw_status status = VXGE_HW_OK; |
678 | 678 | ||
679 | /* Validate the pci-e link width and speed */ | 679 | if (VXGE_HW_OK == __vxge_hw_device_is_privilaged(hldev)) { |
680 | status = __vxge_hw_verify_pci_e_info(hldev); | 680 | /* Validate the pci-e link width and speed */ |
681 | if (status != VXGE_HW_OK) | 681 | status = __vxge_hw_verify_pci_e_info(hldev); |
682 | goto exit; | 682 | if (status != VXGE_HW_OK) |
683 | goto exit; | ||
684 | } | ||
683 | 685 | ||
684 | vxge_hw_wrr_rebalance(hldev); | 686 | vxge_hw_wrr_rebalance(hldev); |
685 | exit: | 687 | exit: |
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 | ||
diff --git a/drivers/net/vxge/vxge-version.h b/drivers/net/vxge/vxge-version.h index 7da02c545ed5..82786ffb7dd9 100644 --- a/drivers/net/vxge/vxge-version.h +++ b/drivers/net/vxge/vxge-version.h | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #define VXGE_VERSION_MAJOR "2" | 18 | #define VXGE_VERSION_MAJOR "2" |
19 | #define VXGE_VERSION_MINOR "0" | 19 | #define VXGE_VERSION_MINOR "0" |
20 | #define VXGE_VERSION_FIX "1" | 20 | #define VXGE_VERSION_FIX "4" |
21 | #define VXGE_VERSION_BUILD "17129" | 21 | #define VXGE_VERSION_BUILD "17795" |
22 | #define VXGE_VERSION_FOR "k" | 22 | #define VXGE_VERSION_FOR "k" |
23 | #endif | 23 | #endif |