aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/myricom/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/ethernet/myricom/myri10ge/myri10ge.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 68026f7e8ba3..130f6b204efa 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -2329,16 +2329,14 @@ static int myri10ge_request_irq(struct myri10ge_priv *mgp)
2329 status = 0; 2329 status = 0;
2330 if (myri10ge_msi) { 2330 if (myri10ge_msi) {
2331 if (mgp->num_slices > 1) { 2331 if (mgp->num_slices > 1) {
2332 status = 2332 status = pci_enable_msix_range(pdev, mgp->msix_vectors,
2333 pci_enable_msix(pdev, mgp->msix_vectors, 2333 mgp->num_slices, mgp->num_slices);
2334 mgp->num_slices); 2334 if (status < 0) {
2335 if (status == 0) {
2336 mgp->msix_enabled = 1;
2337 } else {
2338 dev_err(&pdev->dev, 2335 dev_err(&pdev->dev,
2339 "Error %d setting up MSI-X\n", status); 2336 "Error %d setting up MSI-X\n", status);
2340 return status; 2337 return status;
2341 } 2338 }
2339 mgp->msix_enabled = 1;
2342 } 2340 }
2343 if (mgp->msix_enabled == 0) { 2341 if (mgp->msix_enabled == 0) {
2344 status = pci_enable_msi(pdev); 2342 status = pci_enable_msi(pdev);
@@ -3895,32 +3893,34 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
3895 mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors), 3893 mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
3896 GFP_KERNEL); 3894 GFP_KERNEL);
3897 if (mgp->msix_vectors == NULL) 3895 if (mgp->msix_vectors == NULL)
3898 goto disable_msix; 3896 goto no_msix;
3899 for (i = 0; i < mgp->num_slices; i++) { 3897 for (i = 0; i < mgp->num_slices; i++) {
3900 mgp->msix_vectors[i].entry = i; 3898 mgp->msix_vectors[i].entry = i;
3901 } 3899 }
3902 3900
3903 while (mgp->num_slices > 1) { 3901 while (mgp->num_slices > 1) {
3904 /* make sure it is a power of two */ 3902 mgp->num_slices = rounddown_pow_of_two(mgp->num_slices);
3905 while (!is_power_of_2(mgp->num_slices))
3906 mgp->num_slices--;
3907 if (mgp->num_slices == 1) 3903 if (mgp->num_slices == 1)
3908 goto disable_msix; 3904 goto no_msix;
3909 status = pci_enable_msix(pdev, mgp->msix_vectors, 3905 status = pci_enable_msix_range(pdev,
3910 mgp->num_slices); 3906 mgp->msix_vectors,
3911 if (status == 0) { 3907 mgp->num_slices,
3912 pci_disable_msix(pdev); 3908 mgp->num_slices);
3909 if (status < 0)
3910 goto no_msix;
3911
3912 pci_disable_msix(pdev);
3913
3914 if (status == mgp->num_slices) {
3913 if (old_allocated) 3915 if (old_allocated)
3914 kfree(old_fw); 3916 kfree(old_fw);
3915 return; 3917 return;
3916 } 3918 } else {
3917 if (status > 0)
3918 mgp->num_slices = status; 3919 mgp->num_slices = status;
3919 else 3920 }
3920 goto disable_msix;
3921 } 3921 }
3922 3922
3923disable_msix: 3923no_msix:
3924 if (mgp->msix_vectors != NULL) { 3924 if (mgp->msix_vectors != NULL) {
3925 kfree(mgp->msix_vectors); 3925 kfree(mgp->msix_vectors);
3926 mgp->msix_vectors = NULL; 3926 mgp->msix_vectors = NULL;