diff options
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index ec5855a10ffb..6ef0adb7a06d 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -543,6 +543,11 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter) | |||
543 | int err; | 543 | int err; |
544 | int numvecs, i; | 544 | int numvecs, i; |
545 | 545 | ||
546 | /* Number of supported queues. */ | ||
547 | /* Having more queues than CPUs doesn't make sense. */ | ||
548 | adapter->num_rx_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus()); | ||
549 | adapter->num_tx_queues = min_t(u32, IGB_MAX_TX_QUEUES, num_online_cpus()); | ||
550 | |||
546 | numvecs = adapter->num_tx_queues + adapter->num_rx_queues + 1; | 551 | numvecs = adapter->num_tx_queues + adapter->num_rx_queues + 1; |
547 | adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry), | 552 | adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry), |
548 | GFP_KERNEL); | 553 | GFP_KERNEL); |
@@ -1450,11 +1455,6 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter) | |||
1450 | adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; | 1455 | adapter->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; |
1451 | adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN; | 1456 | adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN; |
1452 | 1457 | ||
1453 | /* Number of supported queues. */ | ||
1454 | /* Having more queues than CPUs doesn't make sense. */ | ||
1455 | adapter->num_rx_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus()); | ||
1456 | adapter->num_tx_queues = min_t(u32, IGB_MAX_TX_QUEUES, num_online_cpus()); | ||
1457 | |||
1458 | /* This call may decrease the number of queues depending on | 1458 | /* This call may decrease the number of queues depending on |
1459 | * interrupt mode. */ | 1459 | * interrupt mode. */ |
1460 | igb_set_interrupt_capability(adapter); | 1460 | igb_set_interrupt_capability(adapter); |