diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index bd64387563f0..951b73cf5ca2 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/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 - 2009 Intel Corporation. | 4 | Copyright(c) 1999 - 2010 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, |
@@ -52,7 +52,7 @@ static const char ixgbe_driver_string[] = | |||
52 | 52 | ||
53 | #define DRV_VERSION "2.0.44-k2" | 53 | #define DRV_VERSION "2.0.44-k2" |
54 | const char ixgbe_driver_version[] = DRV_VERSION; | 54 | const char ixgbe_driver_version[] = DRV_VERSION; |
55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2009 Intel Corporation."; | 55 | static char ixgbe_copyright[] = "Copyright (c) 1999-2010 Intel Corporation."; |
56 | 56 | ||
57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { | 57 | static const struct ixgbe_info *ixgbe_info_tbl[] = { |
58 | [board_82598] = &ixgbe_82598_info, | 58 | [board_82598] = &ixgbe_82598_info, |
@@ -262,10 +262,12 @@ static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter, | |||
262 | int reg_idx = tx_ring->reg_idx; | 262 | int reg_idx = tx_ring->reg_idx; |
263 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; | 263 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; |
264 | 264 | ||
265 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) { | 265 | switch (adapter->hw.mac.type) { |
266 | case ixgbe_mac_82598EB: | ||
266 | tc = reg_idx >> 2; | 267 | tc = reg_idx >> 2; |
267 | txoff = IXGBE_TFCS_TXOFF0; | 268 | txoff = IXGBE_TFCS_TXOFF0; |
268 | } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | 269 | break; |
270 | case ixgbe_mac_82599EB: | ||
269 | tc = 0; | 271 | tc = 0; |
270 | txoff = IXGBE_TFCS_TXOFF; | 272 | txoff = IXGBE_TFCS_TXOFF; |
271 | if (dcb_i == 8) { | 273 | if (dcb_i == 8) { |
@@ -284,6 +286,9 @@ static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter, | |||
284 | tc += (reg_idx - 96) >> 4; | 286 | tc += (reg_idx - 96) >> 4; |
285 | } | 287 | } |
286 | } | 288 | } |
289 | break; | ||
290 | default: | ||
291 | tc = 0; | ||
287 | } | 292 | } |
288 | txoff <<= tc; | 293 | txoff <<= tc; |
289 | } | 294 | } |
@@ -4373,6 +4378,11 @@ static int ixgbe_resume(struct pci_dev *pdev) | |||
4373 | 4378 | ||
4374 | pci_set_power_state(pdev, PCI_D0); | 4379 | pci_set_power_state(pdev, PCI_D0); |
4375 | pci_restore_state(pdev); | 4380 | pci_restore_state(pdev); |
4381 | /* | ||
4382 | * pci_restore_state clears dev->state_saved so call | ||
4383 | * pci_save_state to restore it. | ||
4384 | */ | ||
4385 | pci_save_state(pdev); | ||
4376 | 4386 | ||
4377 | err = pci_enable_device_mem(pdev); | 4387 | err = pci_enable_device_mem(pdev); |
4378 | if (err) { | 4388 | if (err) { |
@@ -4918,7 +4928,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter, | |||
4918 | iph->daddr, 0, | 4928 | iph->daddr, 0, |
4919 | IPPROTO_TCP, | 4929 | IPPROTO_TCP, |
4920 | 0); | 4930 | 0); |
4921 | } else if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV6) { | 4931 | } else if (skb_is_gso_v6(skb)) { |
4922 | ipv6_hdr(skb)->payload_len = 0; | 4932 | ipv6_hdr(skb)->payload_len = 0; |
4923 | tcp_hdr(skb)->check = | 4933 | tcp_hdr(skb)->check = |
4924 | ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, | 4934 | ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, |
@@ -5157,19 +5167,19 @@ dma_error: | |||
5157 | tx_buffer_info->dma = 0; | 5167 | tx_buffer_info->dma = 0; |
5158 | tx_buffer_info->time_stamp = 0; | 5168 | tx_buffer_info->time_stamp = 0; |
5159 | tx_buffer_info->next_to_watch = 0; | 5169 | tx_buffer_info->next_to_watch = 0; |
5160 | count--; | 5170 | if (count) |
5171 | count--; | ||
5161 | 5172 | ||
5162 | /* clear timestamp and dma mappings for remaining portion of packet */ | 5173 | /* clear timestamp and dma mappings for remaining portion of packet */ |
5163 | while (count >= 0) { | 5174 | while (count--) { |
5164 | count--; | 5175 | if (i==0) |
5165 | i--; | ||
5166 | if (i < 0) | ||
5167 | i += tx_ring->count; | 5176 | i += tx_ring->count; |
5177 | i--; | ||
5168 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; | 5178 | tx_buffer_info = &tx_ring->tx_buffer_info[i]; |
5169 | ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info); | 5179 | ixgbe_unmap_and_free_tx_resource(adapter, tx_buffer_info); |
5170 | } | 5180 | } |
5171 | 5181 | ||
5172 | return count; | 5182 | return 0; |
5173 | } | 5183 | } |
5174 | 5184 | ||
5175 | static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, | 5185 | static void ixgbe_tx_queue(struct ixgbe_adapter *adapter, |
@@ -5319,8 +5329,11 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
5319 | struct ixgbe_adapter *adapter = netdev_priv(dev); | 5329 | struct ixgbe_adapter *adapter = netdev_priv(dev); |
5320 | int txq = smp_processor_id(); | 5330 | int txq = smp_processor_id(); |
5321 | 5331 | ||
5322 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) | 5332 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) { |
5333 | while (unlikely(txq >= dev->real_num_tx_queues)) | ||
5334 | txq -= dev->real_num_tx_queues; | ||
5323 | return txq; | 5335 | return txq; |
5336 | } | ||
5324 | 5337 | ||
5325 | #ifdef IXGBE_FCOE | 5338 | #ifdef IXGBE_FCOE |
5326 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && | 5339 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && |
@@ -5566,6 +5579,10 @@ static void ixgbe_netpoll(struct net_device *netdev) | |||
5566 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5579 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5567 | int i; | 5580 | int i; |
5568 | 5581 | ||
5582 | /* if interface is down do nothing */ | ||
5583 | if (test_bit(__IXGBE_DOWN, &adapter->state)) | ||
5584 | return; | ||
5585 | |||
5569 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; | 5586 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; |
5570 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { | 5587 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { |
5571 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | 5588 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
@@ -5746,6 +5763,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5746 | if (err) | 5763 | if (err) |
5747 | goto err_sw_init; | 5764 | goto err_sw_init; |
5748 | 5765 | ||
5766 | /* Make it possible the adapter to be woken up via WOL */ | ||
5767 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | ||
5768 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0); | ||
5769 | |||
5749 | /* | 5770 | /* |
5750 | * If there is a fan on this device and it has failed log the | 5771 | * If there is a fan on this device and it has failed log the |
5751 | * failure. | 5772 | * failure. |