diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 1ee5d0fbb905..3dc6cef58107 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2011 Intel Corporation. | 4 | Copyright(c) 1999 - 2012 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -64,7 +64,7 @@ char ixgbe_default_device_descr[] = | |||
64 | __stringify(BUILD) "-k" | 64 | __stringify(BUILD) "-k" |
65 | const char ixgbe_driver_version[] = DRV_VERSION; | 65 | const char ixgbe_driver_version[] = DRV_VERSION; |
66 | static const char ixgbe_copyright[] = | 66 | static const char ixgbe_copyright[] = |
67 | "Copyright (c) 1999-2011 Intel Corporation."; | 67 | "Copyright (c) 1999-2012 Intel Corporation."; |
68 | 68 | ||
69 | static const struct ixgbe_info *ixgbe_info_tbl[] = { | 69 | static const struct ixgbe_info *ixgbe_info_tbl[] = { |
70 | [board_82598] = &ixgbe_82598_info, | 70 | [board_82598] = &ixgbe_82598_info, |
@@ -2633,22 +2633,22 @@ static void ixgbe_configure_rscctl(struct ixgbe_adapter *adapter, | |||
2633 | /* | 2633 | /* |
2634 | * we must limit the number of descriptors so that the | 2634 | * we must limit the number of descriptors so that the |
2635 | * total size of max desc * buf_len is not greater | 2635 | * total size of max desc * buf_len is not greater |
2636 | * than 65535 | 2636 | * than 65536 |
2637 | */ | 2637 | */ |
2638 | if (ring_is_ps_enabled(ring)) { | 2638 | if (ring_is_ps_enabled(ring)) { |
2639 | #if (MAX_SKB_FRAGS > 16) | 2639 | #if (PAGE_SIZE < 8192) |
2640 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | 2640 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; |
2641 | #elif (MAX_SKB_FRAGS > 8) | 2641 | #elif (PAGE_SIZE < 16384) |
2642 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; | 2642 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; |
2643 | #elif (MAX_SKB_FRAGS > 4) | 2643 | #elif (PAGE_SIZE < 32768) |
2644 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | 2644 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; |
2645 | #else | 2645 | #else |
2646 | rscctrl |= IXGBE_RSCCTL_MAXDESC_1; | 2646 | rscctrl |= IXGBE_RSCCTL_MAXDESC_1; |
2647 | #endif | 2647 | #endif |
2648 | } else { | 2648 | } else { |
2649 | if (rx_buf_len < IXGBE_RXBUFFER_4K) | 2649 | if (rx_buf_len <= IXGBE_RXBUFFER_4K) |
2650 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | 2650 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; |
2651 | else if (rx_buf_len < IXGBE_RXBUFFER_8K) | 2651 | else if (rx_buf_len <= IXGBE_RXBUFFER_8K) |
2652 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; | 2652 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; |
2653 | else | 2653 | else |
2654 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | 2654 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; |
@@ -2830,7 +2830,7 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter) | |||
2830 | IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits); | 2830 | IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl | vt_reg_bits); |
2831 | 2831 | ||
2832 | vf_shift = adapter->num_vfs % 32; | 2832 | vf_shift = adapter->num_vfs % 32; |
2833 | reg_offset = (adapter->num_vfs > 32) ? 1 : 0; | 2833 | reg_offset = (adapter->num_vfs >= 32) ? 1 : 0; |
2834 | 2834 | ||
2835 | /* Enable only the PF's pool for Tx/Rx */ | 2835 | /* Enable only the PF's pool for Tx/Rx */ |
2836 | IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift)); | 2836 | IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset), (1 << vf_shift)); |
@@ -4330,6 +4330,10 @@ static int ixgbe_set_num_queues(struct ixgbe_adapter *adapter) | |||
4330 | adapter->num_tx_queues = 1; | 4330 | adapter->num_tx_queues = 1; |
4331 | 4331 | ||
4332 | done: | 4332 | done: |
4333 | if ((adapter->netdev->reg_state == NETREG_UNREGISTERED) || | ||
4334 | (adapter->netdev->reg_state == NETREG_UNREGISTERING)) | ||
4335 | return 0; | ||
4336 | |||
4333 | /* Notify the stack of the (possibly) reduced queue counts. */ | 4337 | /* Notify the stack of the (possibly) reduced queue counts. */ |
4334 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); | 4338 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
4335 | return netif_set_real_num_rx_queues(adapter->netdev, | 4339 | return netif_set_real_num_rx_queues(adapter->netdev, |