diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 684af371462d..8f677cb86290 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/tcp.h> | 36 | #include <linux/tcp.h> |
37 | #include <linux/pkt_sched.h> | 37 | #include <linux/pkt_sched.h> |
38 | #include <linux/ipv6.h> | 38 | #include <linux/ipv6.h> |
39 | #include <linux/slab.h> | ||
39 | #include <net/checksum.h> | 40 | #include <net/checksum.h> |
40 | #include <net/ip6_checksum.h> | 41 | #include <net/ip6_checksum.h> |
41 | #include <linux/ethtool.h> | 42 | #include <linux/ethtool.h> |
@@ -935,10 +936,12 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
935 | if (skb->prev) | 936 | if (skb->prev) |
936 | skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); | 937 | skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); |
937 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | 938 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
938 | if (IXGBE_RSC_CB(skb)->dma) | 939 | if (IXGBE_RSC_CB(skb)->dma) { |
939 | pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma, | 940 | pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma, |
940 | rx_ring->rx_buf_len, | 941 | rx_ring->rx_buf_len, |
941 | PCI_DMA_FROMDEVICE); | 942 | PCI_DMA_FROMDEVICE); |
943 | IXGBE_RSC_CB(skb)->dma = 0; | ||
944 | } | ||
942 | if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) | 945 | if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) |
943 | rx_ring->rsc_count += skb_shinfo(skb)->nr_frags; | 946 | rx_ring->rsc_count += skb_shinfo(skb)->nr_frags; |
944 | else | 947 | else |
@@ -3054,6 +3057,14 @@ void ixgbe_reinit_locked(struct ixgbe_adapter *adapter) | |||
3054 | while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state)) | 3057 | while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state)) |
3055 | msleep(1); | 3058 | msleep(1); |
3056 | ixgbe_down(adapter); | 3059 | ixgbe_down(adapter); |
3060 | /* | ||
3061 | * If SR-IOV enabled then wait a bit before bringing the adapter | ||
3062 | * back up to give the VFs time to respond to the reset. The | ||
3063 | * two second wait is based upon the watchdog timer cycle in | ||
3064 | * the VF driver. | ||
3065 | */ | ||
3066 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) | ||
3067 | msleep(2000); | ||
3057 | ixgbe_up(adapter); | 3068 | ixgbe_up(adapter); |
3058 | clear_bit(__IXGBE_RESETTING, &adapter->state); | 3069 | clear_bit(__IXGBE_RESETTING, &adapter->state); |
3059 | } | 3070 | } |
@@ -3126,10 +3137,12 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, | |||
3126 | rx_buffer_info->skb = NULL; | 3137 | rx_buffer_info->skb = NULL; |
3127 | do { | 3138 | do { |
3128 | struct sk_buff *this = skb; | 3139 | struct sk_buff *this = skb; |
3129 | if (IXGBE_RSC_CB(this)->dma) | 3140 | if (IXGBE_RSC_CB(this)->dma) { |
3130 | pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma, | 3141 | pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma, |
3131 | rx_ring->rx_buf_len, | 3142 | rx_ring->rx_buf_len, |
3132 | PCI_DMA_FROMDEVICE); | 3143 | PCI_DMA_FROMDEVICE); |
3144 | IXGBE_RSC_CB(this)->dma = 0; | ||
3145 | } | ||
3133 | skb = skb->prev; | 3146 | skb = skb->prev; |
3134 | dev_kfree_skb(this); | 3147 | dev_kfree_skb(this); |
3135 | } while (skb); | 3148 | } while (skb); |
@@ -3232,13 +3245,15 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3232 | 3245 | ||
3233 | /* disable receive for all VFs and wait one second */ | 3246 | /* disable receive for all VFs and wait one second */ |
3234 | if (adapter->num_vfs) { | 3247 | if (adapter->num_vfs) { |
3235 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
3236 | adapter->vfinfo[i].clear_to_send = 0; | ||
3237 | |||
3238 | /* ping all the active vfs to let them know we are going down */ | 3248 | /* ping all the active vfs to let them know we are going down */ |
3239 | ixgbe_ping_all_vfs(adapter); | 3249 | ixgbe_ping_all_vfs(adapter); |
3250 | |||
3240 | /* Disable all VFTE/VFRE TX/RX */ | 3251 | /* Disable all VFTE/VFRE TX/RX */ |
3241 | ixgbe_disable_tx_rx(adapter); | 3252 | ixgbe_disable_tx_rx(adapter); |
3253 | |||
3254 | /* Mark all the VFs as inactive */ | ||
3255 | for (i = 0 ; i < adapter->num_vfs; i++) | ||
3256 | adapter->vfinfo[i].clear_to_send = 0; | ||
3242 | } | 3257 | } |
3243 | 3258 | ||
3244 | /* disable receives */ | 3259 | /* disable receives */ |
@@ -5018,6 +5033,7 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
5018 | autoneg = hw->phy.autoneg_advertised; | 5033 | autoneg = hw->phy.autoneg_advertised; |
5019 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | 5034 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
5020 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); | 5035 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
5036 | hw->mac.autotry_restart = false; | ||
5021 | if (hw->mac.ops.setup_link) | 5037 | if (hw->mac.ops.setup_link) |
5022 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); | 5038 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); |
5023 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 5039 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
@@ -5633,7 +5649,8 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
5633 | 5649 | ||
5634 | #ifdef IXGBE_FCOE | 5650 | #ifdef IXGBE_FCOE |
5635 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && | 5651 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && |
5636 | (skb->protocol == htons(ETH_P_FCOE))) { | 5652 | ((skb->protocol == htons(ETH_P_FCOE)) || |
5653 | (skb->protocol == htons(ETH_P_FIP)))) { | ||
5637 | txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1); | 5654 | txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1); |
5638 | txq += adapter->ring_feature[RING_F_FCOE].mask; | 5655 | txq += adapter->ring_feature[RING_F_FCOE].mask; |
5639 | return txq; | 5656 | return txq; |
@@ -5680,18 +5697,25 @@ static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb, | |||
5680 | 5697 | ||
5681 | tx_ring = adapter->tx_ring[skb->queue_mapping]; | 5698 | tx_ring = adapter->tx_ring[skb->queue_mapping]; |
5682 | 5699 | ||
5683 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && | ||
5684 | (skb->protocol == htons(ETH_P_FCOE))) { | ||
5685 | tx_flags |= IXGBE_TX_FLAGS_FCOE; | ||
5686 | #ifdef IXGBE_FCOE | 5700 | #ifdef IXGBE_FCOE |
5701 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { | ||
5687 | #ifdef CONFIG_IXGBE_DCB | 5702 | #ifdef CONFIG_IXGBE_DCB |
5688 | tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK | 5703 | /* for FCoE with DCB, we force the priority to what |
5689 | << IXGBE_TX_FLAGS_VLAN_SHIFT); | 5704 | * was specified by the switch */ |
5690 | tx_flags |= ((adapter->fcoe.up << 13) | 5705 | if ((skb->protocol == htons(ETH_P_FCOE)) || |
5691 | << IXGBE_TX_FLAGS_VLAN_SHIFT); | 5706 | (skb->protocol == htons(ETH_P_FIP))) { |
5692 | #endif | 5707 | tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK |
5708 | << IXGBE_TX_FLAGS_VLAN_SHIFT); | ||
5709 | tx_flags |= ((adapter->fcoe.up << 13) | ||
5710 | << IXGBE_TX_FLAGS_VLAN_SHIFT); | ||
5711 | } | ||
5693 | #endif | 5712 | #endif |
5713 | /* flag for FCoE offloads */ | ||
5714 | if (skb->protocol == htons(ETH_P_FCOE)) | ||
5715 | tx_flags |= IXGBE_TX_FLAGS_FCOE; | ||
5694 | } | 5716 | } |
5717 | #endif | ||
5718 | |||
5695 | /* four things can cause us to need a context descriptor */ | 5719 | /* four things can cause us to need a context descriptor */ |
5696 | if (skb_is_gso(skb) || | 5720 | if (skb_is_gso(skb) || |
5697 | (skb->ip_summed == CHECKSUM_PARTIAL) || | 5721 | (skb->ip_summed == CHECKSUM_PARTIAL) || |
@@ -6046,7 +6070,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6046 | indices += min_t(unsigned int, num_possible_cpus(), | 6070 | indices += min_t(unsigned int, num_possible_cpus(), |
6047 | IXGBE_MAX_FCOE_INDICES); | 6071 | IXGBE_MAX_FCOE_INDICES); |
6048 | #endif | 6072 | #endif |
6049 | indices = min_t(unsigned int, indices, MAX_TX_QUEUES); | ||
6050 | netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices); | 6073 | netdev = alloc_etherdev_mq(sizeof(struct ixgbe_adapter), indices); |
6051 | if (!netdev) { | 6074 | if (!netdev) { |
6052 | err = -ENOMEM; | 6075 | err = -ENOMEM; |
@@ -6245,9 +6268,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6245 | case IXGBE_DEV_ID_82599_KX4: | 6268 | case IXGBE_DEV_ID_82599_KX4: |
6246 | adapter->wol = (IXGBE_WUFC_MAG | IXGBE_WUFC_EX | | 6269 | adapter->wol = (IXGBE_WUFC_MAG | IXGBE_WUFC_EX | |
6247 | IXGBE_WUFC_MC | IXGBE_WUFC_BC); | 6270 | IXGBE_WUFC_MC | IXGBE_WUFC_BC); |
6248 | /* Enable ACPI wakeup in GRC */ | ||
6249 | IXGBE_WRITE_REG(hw, IXGBE_GRC, | ||
6250 | (IXGBE_READ_REG(hw, IXGBE_GRC) & ~IXGBE_GRC_APME)); | ||
6251 | break; | 6271 | break; |
6252 | default: | 6272 | default: |
6253 | adapter->wol = 0; | 6273 | adapter->wol = 0; |
@@ -6380,6 +6400,16 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) | |||
6380 | del_timer_sync(&adapter->sfp_timer); | 6400 | del_timer_sync(&adapter->sfp_timer); |
6381 | cancel_work_sync(&adapter->watchdog_task); | 6401 | cancel_work_sync(&adapter->watchdog_task); |
6382 | cancel_work_sync(&adapter->sfp_task); | 6402 | cancel_work_sync(&adapter->sfp_task); |
6403 | if (adapter->hw.phy.multispeed_fiber) { | ||
6404 | struct ixgbe_hw *hw = &adapter->hw; | ||
6405 | /* | ||
6406 | * Restart clause 37 autoneg, disable and re-enable | ||
6407 | * the tx laser, to clear & alert the link partner | ||
6408 | * that it needs to restart autotry | ||
6409 | */ | ||
6410 | hw->mac.autotry_restart = true; | ||
6411 | hw->mac.ops.flap_tx_laser(hw); | ||
6412 | } | ||
6383 | cancel_work_sync(&adapter->multispeed_fiber_task); | 6413 | cancel_work_sync(&adapter->multispeed_fiber_task); |
6384 | cancel_work_sync(&adapter->sfp_config_module_task); | 6414 | cancel_work_sync(&adapter->sfp_config_module_task); |
6385 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || | 6415 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || |