Skip to content

Commit

Permalink
ixgbe: Use netif_set_real_num_{rx,tx}_queues()
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Sep 28, 2010
1 parent 21adef3 commit 847f53f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4088,7 +4088,7 @@ static inline bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
* fallthrough conditions.
*
**/
static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
static int ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
{
/* Start with base case */
adapter->num_rx_queues = 1;
Expand All @@ -4097,7 +4097,7 @@ static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
adapter->num_rx_queues_per_pool = 1;

if (ixgbe_set_sriov_queues(adapter))
return;
goto done;

#ifdef IXGBE_FCOE
if (ixgbe_set_fcoe_queues(adapter))
Expand All @@ -4120,8 +4120,10 @@ static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
adapter->num_tx_queues = 1;

done:
/* Notify the stack of the (possibly) reduced Tx Queue count. */
/* Notify the stack of the (possibly) reduced queue counts. */
netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
return netif_set_real_num_rx_queues(adapter->netdev,
adapter->num_rx_queues);
}

static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter,
Expand Down Expand Up @@ -4550,7 +4552,9 @@ static int ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
ixgbe_disable_sriov(adapter);

ixgbe_set_num_queues(adapter);
err = ixgbe_set_num_queues(adapter);
if (err)
return err;

err = pci_enable_msi(adapter->pdev);
if (!err) {
Expand Down Expand Up @@ -4675,7 +4679,9 @@ int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter)
int err;

/* Number of supported queues */
ixgbe_set_num_queues(adapter);
err = ixgbe_set_num_queues(adapter);
if (err)
return err;

err = ixgbe_set_interrupt_capability(adapter);
if (err) {
Expand Down

0 comments on commit 847f53f

Please sign in to comment.