Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340731
b: refs/heads/master
c: e45dd5f
h: refs/heads/master
i:
  340729: b26691a
  340727: 1149348
v: v3
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Nov 13, 2012
1 parent ee65003 commit 969be1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7c405618c41f6d00fdd24311dea9ed8305bf66a
refs/heads/master: e45dd5fe654b2f8e52ea9f8dacfe2b2444c87c07
26 changes: 13 additions & 13 deletions trunk/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,8 +1721,8 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter)
}
}

static void ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter,
int vectors)
static int ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter,
int vectors)
{
int err, vector_threshold;

Expand All @@ -1740,21 +1740,18 @@ static void ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter,
while (vectors >= vector_threshold) {
err = pci_enable_msix(adapter->pdev, adapter->msix_entries,
vectors);
if (!err) /* Success in acquiring all requested vectors. */
if (!err || err < 0) /* Success or a nasty failure. */
break;
else if (err < 0)
vectors = 0; /* Nasty failure, quit now */
else /* err == number of vectors we should try again with */
vectors = err;
}

if (vectors < vector_threshold) {
/* Can't allocate enough MSI-X interrupts? Oh well.
* This just means we'll go with either a single MSI
* vector or fall back to legacy interrupts.
*/
hw_dbg(&adapter->hw,
"Unable to allocate MSI-X interrupts\n");
if (vectors < vector_threshold)
err = -ENOMEM;

if (err) {
dev_err(&adapter->pdev->dev,
"Unable to allocate MSI-X interrupts\n");
kfree(adapter->msix_entries);
adapter->msix_entries = NULL;
} else {
Expand All @@ -1765,6 +1762,7 @@ static void ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter,
*/
adapter->num_msix_vectors = vectors;
}
return err;
}

/**
Expand Down Expand Up @@ -1868,7 +1866,9 @@ static int ixgbevf_set_interrupt_capability(struct ixgbevf_adapter *adapter)
for (vector = 0; vector < v_budget; vector++)
adapter->msix_entries[vector].entry = vector;

ixgbevf_acquire_msix_vectors(adapter, v_budget);
err = ixgbevf_acquire_msix_vectors(adapter, v_budget);
if (err)
goto out;

err = netif_set_real_num_tx_queues(netdev, adapter->num_tx_queues);
if (err)
Expand Down

0 comments on commit 969be1d

Please sign in to comment.