diff options
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 3 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82598.c | 67 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_dcb_nl.c | 36 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 12 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 128 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 8 |
7 files changed, 199 insertions, 58 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index cd22323cfd2..e11d83d5852 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -96,6 +96,8 @@ | |||
96 | #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 | 96 | #define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 |
97 | #define IXGBE_TX_FLAGS_VLAN_SHIFT 16 | 97 | #define IXGBE_TX_FLAGS_VLAN_SHIFT 16 |
98 | 98 | ||
99 | #define IXGBE_MAX_RSC_INT_RATE 162760 | ||
100 | |||
99 | /* wrapper around a pointer to a socket buffer, | 101 | /* wrapper around a pointer to a socket buffer, |
100 | * so a DMA handle can be stored along with the buffer */ | 102 | * so a DMA handle can be stored along with the buffer */ |
101 | struct ixgbe_tx_buffer { | 103 | struct ixgbe_tx_buffer { |
@@ -327,6 +329,7 @@ struct ixgbe_adapter { | |||
327 | #define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) | 329 | #define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) |
328 | #define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) | 330 | #define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26) |
329 | #define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) | 331 | #define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27) |
332 | #define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28) | ||
330 | #define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) | 333 | #define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29) |
331 | 334 | ||
332 | u32 flags2; | 335 | u32 flags2; |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index b9923047ce1..522c03bc1da 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -50,6 +50,51 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, | |||
50 | u8 *eeprom_data); | 50 | u8 *eeprom_data); |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout | ||
54 | * @hw: pointer to the HW structure | ||
55 | * | ||
56 | * The defaults for 82598 should be in the range of 50us to 50ms, | ||
57 | * however the hardware default for these parts is 500us to 1ms which is less | ||
58 | * than the 10ms recommended by the pci-e spec. To address this we need to | ||
59 | * increase the value to either 10ms to 250ms for capability version 1 config, | ||
60 | * or 16ms to 55ms for version 2. | ||
61 | **/ | ||
62 | void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw) | ||
63 | { | ||
64 | struct ixgbe_adapter *adapter = hw->back; | ||
65 | u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR); | ||
66 | u16 pcie_devctl2; | ||
67 | |||
68 | /* only take action if timeout value is defaulted to 0 */ | ||
69 | if (gcr & IXGBE_GCR_CMPL_TMOUT_MASK) | ||
70 | goto out; | ||
71 | |||
72 | /* | ||
73 | * if capababilities version is type 1 we can write the | ||
74 | * timeout of 10ms to 250ms through the GCR register | ||
75 | */ | ||
76 | if (!(gcr & IXGBE_GCR_CAP_VER2)) { | ||
77 | gcr |= IXGBE_GCR_CMPL_TMOUT_10ms; | ||
78 | goto out; | ||
79 | } | ||
80 | |||
81 | /* | ||
82 | * for version 2 capabilities we need to write the config space | ||
83 | * directly in order to set the completion timeout value for | ||
84 | * 16ms to 55ms | ||
85 | */ | ||
86 | pci_read_config_word(adapter->pdev, | ||
87 | IXGBE_PCI_DEVICE_CONTROL2, &pcie_devctl2); | ||
88 | pcie_devctl2 |= IXGBE_PCI_DEVICE_CONTROL2_16ms; | ||
89 | pci_write_config_word(adapter->pdev, | ||
90 | IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2); | ||
91 | out: | ||
92 | /* disable completion timeout resend */ | ||
93 | gcr &= ~IXGBE_GCR_CMPL_TMOUT_RESEND; | ||
94 | IXGBE_WRITE_REG(hw, IXGBE_GCR, gcr); | ||
95 | } | ||
96 | |||
97 | /** | ||
53 | * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count | 98 | * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count |
54 | * @hw: pointer to hardware structure | 99 | * @hw: pointer to hardware structure |
55 | * | 100 | * |
@@ -153,6 +198,26 @@ out: | |||
153 | } | 198 | } |
154 | 199 | ||
155 | /** | 200 | /** |
201 | * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx | ||
202 | * @hw: pointer to hardware structure | ||
203 | * | ||
204 | * Starts the hardware using the generic start_hw function. | ||
205 | * Then set pcie completion timeout | ||
206 | **/ | ||
207 | s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) | ||
208 | { | ||
209 | s32 ret_val = 0; | ||
210 | |||
211 | ret_val = ixgbe_start_hw_generic(hw); | ||
212 | |||
213 | /* set the completion timeout for interface */ | ||
214 | if (ret_val == 0) | ||
215 | ixgbe_set_pcie_completion_timeout(hw); | ||
216 | |||
217 | return ret_val; | ||
218 | } | ||
219 | |||
220 | /** | ||
156 | * ixgbe_get_link_capabilities_82598 - Determines link capabilities | 221 | * ixgbe_get_link_capabilities_82598 - Determines link capabilities |
157 | * @hw: pointer to hardware structure | 222 | * @hw: pointer to hardware structure |
158 | * @speed: pointer to link speed | 223 | * @speed: pointer to link speed |
@@ -1085,7 +1150,7 @@ out: | |||
1085 | static struct ixgbe_mac_operations mac_ops_82598 = { | 1150 | static struct ixgbe_mac_operations mac_ops_82598 = { |
1086 | .init_hw = &ixgbe_init_hw_generic, | 1151 | .init_hw = &ixgbe_init_hw_generic, |
1087 | .reset_hw = &ixgbe_reset_hw_82598, | 1152 | .reset_hw = &ixgbe_reset_hw_82598, |
1088 | .start_hw = &ixgbe_start_hw_generic, | 1153 | .start_hw = &ixgbe_start_hw_82598, |
1089 | .clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic, | 1154 | .clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic, |
1090 | .get_media_type = &ixgbe_get_media_type_82598, | 1155 | .get_media_type = &ixgbe_get_media_type_82598, |
1091 | .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598, | 1156 | .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598, |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index d56890f5c9d..1c726573290 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
@@ -106,8 +106,6 @@ static u8 ixgbe_dcbnl_get_state(struct net_device *netdev) | |||
106 | { | 106 | { |
107 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 107 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
108 | 108 | ||
109 | DPRINTK(DRV, INFO, "Get DCB Admin Mode.\n"); | ||
110 | |||
111 | return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED); | 109 | return !!(adapter->flags & IXGBE_FLAG_DCB_ENABLED); |
112 | } | 110 | } |
113 | 111 | ||
@@ -116,8 +114,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
116 | u8 err = 0; | 114 | u8 err = 0; |
117 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 115 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
118 | 116 | ||
119 | DPRINTK(DRV, INFO, "Set DCB Admin Mode.\n"); | ||
120 | |||
121 | if (state > 0) { | 117 | if (state > 0) { |
122 | /* Turn on DCB */ | 118 | /* Turn on DCB */ |
123 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) | 119 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) |
@@ -138,7 +134,23 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
138 | adapter->hw.fc.requested_mode = ixgbe_fc_none; | 134 | adapter->hw.fc.requested_mode = ixgbe_fc_none; |
139 | } | 135 | } |
140 | adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; | 136 | adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; |
137 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | ||
138 | adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
139 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | ||
140 | } | ||
141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; | 141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; |
142 | #ifdef IXGBE_FCOE | ||
143 | /* Turn on FCoE offload */ | ||
144 | if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) && | ||
145 | (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) { | ||
146 | adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; | ||
147 | adapter->ring_feature[RING_F_FCOE].indices = | ||
148 | IXGBE_FCRETA_SIZE; | ||
149 | netdev->features |= NETIF_F_FCOE_CRC; | ||
150 | netdev->features |= NETIF_F_FSO; | ||
151 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | ||
152 | } | ||
153 | #endif /* IXGBE_FCOE */ | ||
142 | ixgbe_init_interrupt_scheme(adapter); | 154 | ixgbe_init_interrupt_scheme(adapter); |
143 | if (netif_running(netdev)) | 155 | if (netif_running(netdev)) |
144 | netdev->netdev_ops->ndo_open(netdev); | 156 | netdev->netdev_ops->ndo_open(netdev); |
@@ -154,6 +166,20 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
154 | adapter->dcb_cfg.pfc_mode_enable = false; | 166 | adapter->dcb_cfg.pfc_mode_enable = false; |
155 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; | 167 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; |
156 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 168 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
169 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | ||
170 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
171 | |||
172 | #ifdef IXGBE_FCOE | ||
173 | /* Turn off FCoE offload */ | ||
174 | if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE | | ||
175 | IXGBE_FLAG_FCOE_ENABLED)) { | ||
176 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | ||
177 | adapter->ring_feature[RING_F_FCOE].indices = 0; | ||
178 | netdev->features &= ~NETIF_F_FCOE_CRC; | ||
179 | netdev->features &= ~NETIF_F_FSO; | ||
180 | netdev->fcoe_ddp_xid = 0; | ||
181 | } | ||
182 | #endif /* IXGBE_FCOE */ | ||
157 | ixgbe_init_interrupt_scheme(adapter); | 183 | ixgbe_init_interrupt_scheme(adapter); |
158 | if (netif_running(netdev)) | 184 | if (netif_running(netdev)) |
159 | netdev->netdev_ops->ndo_open(netdev); | 185 | netdev->netdev_ops->ndo_open(netdev); |
@@ -169,6 +195,8 @@ static void ixgbe_dcbnl_get_perm_hw_addr(struct net_device *netdev, | |||
169 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 195 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
170 | int i, j; | 196 | int i, j; |
171 | 197 | ||
198 | memset(perm_addr, 0xff, MAX_ADDR_LEN); | ||
199 | |||
172 | for (i = 0; i < netdev->addr_len; i++) | 200 | for (i = 0; i < netdev->addr_len; i++) |
173 | perm_addr[i] = adapter->hw.mac.perm_addr[i]; | 201 | perm_addr[i] = adapter->hw.mac.perm_addr[i]; |
174 | 202 | ||
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 0f7b6a3a2e6..79144e950a3 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -1830,7 +1830,6 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter, | |||
1830 | break; | 1830 | break; |
1831 | default: | 1831 | default: |
1832 | wol->supported = 0; | 1832 | wol->supported = 0; |
1833 | retval = 0; | ||
1834 | } | 1833 | } |
1835 | 1834 | ||
1836 | return retval; | 1835 | return retval; |
@@ -1976,7 +1975,10 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
1976 | * any other value means disable eitr, which is best | 1975 | * any other value means disable eitr, which is best |
1977 | * served by setting the interrupt rate very high | 1976 | * served by setting the interrupt rate very high |
1978 | */ | 1977 | */ |
1979 | adapter->eitr_param = IXGBE_MAX_INT_RATE; | 1978 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) |
1979 | adapter->eitr_param = IXGBE_MAX_RSC_INT_RATE; | ||
1980 | else | ||
1981 | adapter->eitr_param = IXGBE_MAX_INT_RATE; | ||
1980 | adapter->itr_setting = 0; | 1982 | adapter->itr_setting = 0; |
1981 | } | 1983 | } |
1982 | 1984 | ||
@@ -2000,13 +2002,13 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
2000 | 2002 | ||
2001 | ethtool_op_set_flags(netdev, data); | 2003 | ethtool_op_set_flags(netdev, data); |
2002 | 2004 | ||
2003 | if (!(adapter->flags & IXGBE_FLAG2_RSC_CAPABLE)) | 2005 | if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) |
2004 | return 0; | 2006 | return 0; |
2005 | 2007 | ||
2006 | /* if state changes we need to update adapter->flags and reset */ | 2008 | /* if state changes we need to update adapter->flags and reset */ |
2007 | if ((!!(data & ETH_FLAG_LRO)) != | 2009 | if ((!!(data & ETH_FLAG_LRO)) != |
2008 | (!!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED))) { | 2010 | (!!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) { |
2009 | adapter->flags ^= IXGBE_FLAG2_RSC_ENABLED; | 2011 | adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED; |
2010 | if (netif_running(netdev)) | 2012 | if (netif_running(netdev)) |
2011 | ixgbe_reinit_locked(adapter); | 2013 | ixgbe_reinit_locked(adapter); |
2012 | else | 2014 | else |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 5588ef493a3..110c65ab5cb 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/in.h> | 34 | #include <linux/in.h> |
35 | #include <linux/ip.h> | 35 | #include <linux/ip.h> |
36 | #include <linux/tcp.h> | 36 | #include <linux/tcp.h> |
37 | #include <linux/pkt_sched.h> | ||
37 | #include <linux/ipv6.h> | 38 | #include <linux/ipv6.h> |
38 | #include <net/checksum.h> | 39 | #include <net/checksum.h> |
39 | #include <net/ip6_checksum.h> | 40 | #include <net/ip6_checksum.h> |
@@ -510,8 +511,11 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector, | |||
510 | * @skb: skb currently being received and modified | 511 | * @skb: skb currently being received and modified |
511 | **/ | 512 | **/ |
512 | static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, | 513 | static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, |
513 | u32 status_err, struct sk_buff *skb) | 514 | union ixgbe_adv_rx_desc *rx_desc, |
515 | struct sk_buff *skb) | ||
514 | { | 516 | { |
517 | u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error); | ||
518 | |||
515 | skb->ip_summed = CHECKSUM_NONE; | 519 | skb->ip_summed = CHECKSUM_NONE; |
516 | 520 | ||
517 | /* Rx csum disabled */ | 521 | /* Rx csum disabled */ |
@@ -529,6 +533,16 @@ static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, | |||
529 | return; | 533 | return; |
530 | 534 | ||
531 | if (status_err & IXGBE_RXDADV_ERR_TCPE) { | 535 | if (status_err & IXGBE_RXDADV_ERR_TCPE) { |
536 | u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info; | ||
537 | |||
538 | /* | ||
539 | * 82599 errata, UDP frames with a 0 checksum can be marked as | ||
540 | * checksum errors. | ||
541 | */ | ||
542 | if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) && | ||
543 | (adapter->hw.mac.type == ixgbe_mac_82599EB)) | ||
544 | return; | ||
545 | |||
532 | adapter->hw_csum_rx_error++; | 546 | adapter->hw_csum_rx_error++; |
533 | return; | 547 | return; |
534 | } | 548 | } |
@@ -766,7 +780,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
766 | prefetch(next_rxd); | 780 | prefetch(next_rxd); |
767 | cleaned_count++; | 781 | cleaned_count++; |
768 | 782 | ||
769 | if (adapter->flags & IXGBE_FLAG2_RSC_CAPABLE) | 783 | if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) |
770 | rsc_count = ixgbe_get_rsc_count(rx_desc); | 784 | rsc_count = ixgbe_get_rsc_count(rx_desc); |
771 | 785 | ||
772 | if (rsc_count) { | 786 | if (rsc_count) { |
@@ -802,7 +816,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
802 | goto next_desc; | 816 | goto next_desc; |
803 | } | 817 | } |
804 | 818 | ||
805 | ixgbe_rx_checksum(adapter, staterr, skb); | 819 | ixgbe_rx_checksum(adapter, rx_desc, skb); |
806 | 820 | ||
807 | /* probably a little skewed due to removing CRC */ | 821 | /* probably a little skewed due to removing CRC */ |
808 | total_rx_bytes += skb->len; | 822 | total_rx_bytes += skb->len; |
@@ -2022,7 +2036,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
2022 | IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype); | 2036 | IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype); |
2023 | } | 2037 | } |
2024 | } else { | 2038 | } else { |
2025 | if (!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED) && | 2039 | if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) && |
2026 | (netdev->mtu <= ETH_DATA_LEN)) | 2040 | (netdev->mtu <= ETH_DATA_LEN)) |
2027 | rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE; | 2041 | rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE; |
2028 | else | 2042 | else |
@@ -2151,7 +2165,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
2151 | IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); | 2165 | IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); |
2152 | } | 2166 | } |
2153 | 2167 | ||
2154 | if (adapter->flags & IXGBE_FLAG2_RSC_ENABLED) { | 2168 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
2155 | /* Enable 82599 HW-RSC */ | 2169 | /* Enable 82599 HW-RSC */ |
2156 | for (i = 0; i < adapter->num_rx_queues; i++) { | 2170 | for (i = 0; i < adapter->num_rx_queues; i++) { |
2157 | j = adapter->rx_ring[i].reg_idx; | 2171 | j = adapter->rx_ring[i].reg_idx; |
@@ -2697,19 +2711,23 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
2697 | 2711 | ||
2698 | /* | 2712 | /* |
2699 | * For hot-pluggable SFP+ devices, a new SFP+ module may have | 2713 | * For hot-pluggable SFP+ devices, a new SFP+ module may have |
2700 | * arrived before interrupts were enabled. We need to kick off | 2714 | * arrived before interrupts were enabled but after probe. Such |
2701 | * the SFP+ module setup first, then try to bring up link. | 2715 | * devices wouldn't have their type identified yet. We need to |
2716 | * kick off the SFP+ module setup first, then try to bring up link. | ||
2702 | * If we're not hot-pluggable SFP+, we just need to configure link | 2717 | * If we're not hot-pluggable SFP+, we just need to configure link |
2703 | * and bring it up. | 2718 | * and bring it up. |
2704 | */ | 2719 | */ |
2705 | err = hw->phy.ops.identify(hw); | 2720 | if (hw->phy.type == ixgbe_phy_unknown) { |
2706 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 2721 | err = hw->phy.ops.identify(hw); |
2707 | dev_err(&adapter->pdev->dev, "failed to initialize because " | 2722 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
2708 | "an unsupported SFP+ module type was detected.\n" | 2723 | /* |
2709 | "Reload the driver after installing a supported " | 2724 | * Take the device down and schedule the sfp tasklet |
2710 | "module.\n"); | 2725 | * which will unregister_netdev and log it. |
2711 | ixgbe_down(adapter); | 2726 | */ |
2712 | return err; | 2727 | ixgbe_down(adapter); |
2728 | schedule_work(&adapter->sfp_config_module_task); | ||
2729 | return err; | ||
2730 | } | ||
2713 | } | 2731 | } |
2714 | 2732 | ||
2715 | if (ixgbe_is_sfp(hw)) { | 2733 | if (ixgbe_is_sfp(hw)) { |
@@ -3126,7 +3144,11 @@ static inline bool ixgbe_set_fcoe_queues(struct ixgbe_adapter *adapter) | |||
3126 | #endif | 3144 | #endif |
3127 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { | 3145 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { |
3128 | DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); | 3146 | DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); |
3129 | ixgbe_set_rss_queues(adapter); | 3147 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || |
3148 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) | ||
3149 | ixgbe_set_fdir_queues(adapter); | ||
3150 | else | ||
3151 | ixgbe_set_rss_queues(adapter); | ||
3130 | } | 3152 | } |
3131 | /* adding FCoE rx rings to the end */ | 3153 | /* adding FCoE rx rings to the end */ |
3132 | f->mask = adapter->num_rx_queues; | 3154 | f->mask = adapter->num_rx_queues; |
@@ -3384,7 +3406,12 @@ static inline bool ixgbe_cache_ring_fcoe(struct ixgbe_adapter *adapter) | |||
3384 | } | 3406 | } |
3385 | #endif /* CONFIG_IXGBE_DCB */ | 3407 | #endif /* CONFIG_IXGBE_DCB */ |
3386 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { | 3408 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { |
3387 | ixgbe_cache_ring_rss(adapter); | 3409 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || |
3410 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) | ||
3411 | ixgbe_cache_ring_fdir(adapter); | ||
3412 | else | ||
3413 | ixgbe_cache_ring_rss(adapter); | ||
3414 | |||
3388 | fcoe_i = f->mask; | 3415 | fcoe_i = f->mask; |
3389 | } | 3416 | } |
3390 | for (i = 0; i < f->indices; i++, fcoe_i++) | 3417 | for (i = 0; i < f->indices; i++, fcoe_i++) |
@@ -3724,7 +3751,7 @@ static void ixgbe_sfp_task(struct work_struct *work) | |||
3724 | if ((hw->phy.type == ixgbe_phy_nl) && | 3751 | if ((hw->phy.type == ixgbe_phy_nl) && |
3725 | (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { | 3752 | (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { |
3726 | s32 ret = hw->phy.ops.identify_sfp(hw); | 3753 | s32 ret = hw->phy.ops.identify_sfp(hw); |
3727 | if (ret) | 3754 | if (ret == IXGBE_ERR_SFP_NOT_PRESENT) |
3728 | goto reschedule; | 3755 | goto reschedule; |
3729 | ret = hw->phy.ops.reset(hw); | 3756 | ret = hw->phy.ops.reset(hw); |
3730 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 3757 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
@@ -3785,16 +3812,17 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
3785 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; | 3812 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; |
3786 | } else if (hw->mac.type == ixgbe_mac_82599EB) { | 3813 | } else if (hw->mac.type == ixgbe_mac_82599EB) { |
3787 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; | 3814 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; |
3788 | adapter->flags |= IXGBE_FLAG2_RSC_CAPABLE; | 3815 | adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE; |
3789 | adapter->flags |= IXGBE_FLAG2_RSC_ENABLED; | 3816 | adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED; |
3790 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | 3817 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; |
3791 | adapter->ring_feature[RING_F_FDIR].indices = | 3818 | adapter->ring_feature[RING_F_FDIR].indices = |
3792 | IXGBE_MAX_FDIR_INDICES; | 3819 | IXGBE_MAX_FDIR_INDICES; |
3793 | adapter->atr_sample_rate = 20; | 3820 | adapter->atr_sample_rate = 20; |
3794 | adapter->fdir_pballoc = 0; | 3821 | adapter->fdir_pballoc = 0; |
3795 | #ifdef IXGBE_FCOE | 3822 | #ifdef IXGBE_FCOE |
3796 | adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; | 3823 | adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE; |
3797 | adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; | 3824 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; |
3825 | adapter->ring_feature[RING_F_FCOE].indices = 0; | ||
3798 | #endif /* IXGBE_FCOE */ | 3826 | #endif /* IXGBE_FCOE */ |
3799 | } | 3827 | } |
3800 | 3828 | ||
@@ -4534,13 +4562,17 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) | |||
4534 | u32 err; | 4562 | u32 err; |
4535 | 4563 | ||
4536 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; | 4564 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; |
4565 | |||
4566 | /* Time for electrical oscillations to settle down */ | ||
4567 | msleep(100); | ||
4537 | err = hw->phy.ops.identify_sfp(hw); | 4568 | err = hw->phy.ops.identify_sfp(hw); |
4569 | |||
4538 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 4570 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4539 | dev_err(&adapter->pdev->dev, "failed to initialize because " | 4571 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
4540 | "an unsupported SFP+ module type was detected.\n" | 4572 | "an unsupported SFP+ module type was detected.\n" |
4541 | "Reload the driver after installing a supported " | 4573 | "Reload the driver after installing a supported " |
4542 | "module.\n"); | 4574 | "module.\n"); |
4543 | ixgbe_down(adapter); | 4575 | unregister_netdev(adapter->netdev); |
4544 | return; | 4576 | return; |
4545 | } | 4577 | } |
4546 | hw->mac.ops.setup_sfp(hw); | 4578 | hw->mac.ops.setup_sfp(hw); |
@@ -5108,9 +5140,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
5108 | int count = 0; | 5140 | int count = 0; |
5109 | unsigned int f; | 5141 | unsigned int f; |
5110 | 5142 | ||
5111 | r_idx = skb->queue_mapping; | ||
5112 | tx_ring = &adapter->tx_ring[r_idx]; | ||
5113 | |||
5114 | if (adapter->vlgrp && vlan_tx_tag_present(skb)) { | 5143 | if (adapter->vlgrp && vlan_tx_tag_present(skb)) { |
5115 | tx_flags |= vlan_tx_tag_get(skb); | 5144 | tx_flags |= vlan_tx_tag_get(skb); |
5116 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 5145 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
@@ -5120,11 +5149,19 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
5120 | tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; | 5149 | tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; |
5121 | tx_flags |= IXGBE_TX_FLAGS_VLAN; | 5150 | tx_flags |= IXGBE_TX_FLAGS_VLAN; |
5122 | } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 5151 | } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
5123 | tx_flags |= (skb->queue_mapping << 13); | 5152 | if (skb->priority != TC_PRIO_CONTROL) { |
5124 | tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; | 5153 | tx_flags |= (skb->queue_mapping << 13); |
5125 | tx_flags |= IXGBE_TX_FLAGS_VLAN; | 5154 | tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; |
5155 | tx_flags |= IXGBE_TX_FLAGS_VLAN; | ||
5156 | } else { | ||
5157 | skb->queue_mapping = | ||
5158 | adapter->ring_feature[RING_F_DCB].indices-1; | ||
5159 | } | ||
5126 | } | 5160 | } |
5127 | 5161 | ||
5162 | r_idx = skb->queue_mapping; | ||
5163 | tx_ring = &adapter->tx_ring[r_idx]; | ||
5164 | |||
5128 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && | 5165 | if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && |
5129 | (skb->protocol == htons(ETH_P_FCOE))) | 5166 | (skb->protocol == htons(ETH_P_FCOE))) |
5130 | tx_flags |= IXGBE_TX_FLAGS_FCOE; | 5167 | tx_flags |= IXGBE_TX_FLAGS_FCOE; |
@@ -5323,12 +5360,19 @@ static int ixgbe_del_sanmac_netdev(struct net_device *dev) | |||
5323 | static void ixgbe_netpoll(struct net_device *netdev) | 5360 | static void ixgbe_netpoll(struct net_device *netdev) |
5324 | { | 5361 | { |
5325 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 5362 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
5363 | int i; | ||
5326 | 5364 | ||
5327 | disable_irq(adapter->pdev->irq); | ||
5328 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; | 5365 | adapter->flags |= IXGBE_FLAG_IN_NETPOLL; |
5329 | ixgbe_intr(adapter->pdev->irq, netdev); | 5366 | if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { |
5367 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | ||
5368 | for (i = 0; i < num_q_vectors; i++) { | ||
5369 | struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; | ||
5370 | ixgbe_msix_clean_many(0, q_vector); | ||
5371 | } | ||
5372 | } else { | ||
5373 | ixgbe_intr(adapter->pdev->irq, netdev); | ||
5374 | } | ||
5330 | adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL; | 5375 | adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL; |
5331 | enable_irq(adapter->pdev->irq); | ||
5332 | } | 5376 | } |
5333 | #endif | 5377 | #endif |
5334 | 5378 | ||
@@ -5563,29 +5607,18 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5563 | #endif | 5607 | #endif |
5564 | 5608 | ||
5565 | #ifdef IXGBE_FCOE | 5609 | #ifdef IXGBE_FCOE |
5566 | if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { | 5610 | if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) { |
5567 | if (hw->mac.ops.get_device_caps) { | 5611 | if (hw->mac.ops.get_device_caps) { |
5568 | hw->mac.ops.get_device_caps(hw, &device_caps); | 5612 | hw->mac.ops.get_device_caps(hw, &device_caps); |
5569 | if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) { | 5613 | if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS) |
5570 | netdev->features |= NETIF_F_FCOE_CRC; | 5614 | adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE; |
5571 | netdev->features |= NETIF_F_FSO; | ||
5572 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | ||
5573 | DPRINTK(DRV, INFO, "FCoE enabled, " | ||
5574 | "disabling Flow Director\n"); | ||
5575 | adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
5576 | adapter->flags &= | ||
5577 | ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | ||
5578 | adapter->atr_sample_rate = 0; | ||
5579 | } else { | ||
5580 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | ||
5581 | } | ||
5582 | } | 5615 | } |
5583 | } | 5616 | } |
5584 | #endif /* IXGBE_FCOE */ | 5617 | #endif /* IXGBE_FCOE */ |
5585 | if (pci_using_dac) | 5618 | if (pci_using_dac) |
5586 | netdev->features |= NETIF_F_HIGHDMA; | 5619 | netdev->features |= NETIF_F_HIGHDMA; |
5587 | 5620 | ||
5588 | if (adapter->flags & IXGBE_FLAG2_RSC_ENABLED) | 5621 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) |
5589 | netdev->features |= NETIF_F_LRO; | 5622 | netdev->features |= NETIF_F_LRO; |
5590 | 5623 | ||
5591 | /* make sure the EEPROM is good */ | 5624 | /* make sure the EEPROM is good */ |
@@ -5627,7 +5660,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5627 | adapter->wol = 0; | 5660 | adapter->wol = 0; |
5628 | break; | 5661 | break; |
5629 | } | 5662 | } |
5630 | device_init_wakeup(&adapter->pdev->dev, true); | ||
5631 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); | 5663 | device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); |
5632 | 5664 | ||
5633 | /* pick up the PCI bus settings for reporting later */ | 5665 | /* pick up the PCI bus settings for reporting later */ |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 453e966762f..9ecad17522c 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -60,6 +60,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) | |||
60 | 60 | ||
61 | if (hw->phy.type == ixgbe_phy_unknown) { | 61 | if (hw->phy.type == ixgbe_phy_unknown) { |
62 | for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { | 62 | for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { |
63 | hw->phy.mdio.prtad = phy_addr; | ||
63 | if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) { | 64 | if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) { |
64 | ixgbe_get_phy_id(hw); | 65 | ixgbe_get_phy_id(hw); |
65 | hw->phy.type = | 66 | hw->phy.type = |
@@ -68,6 +69,8 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) | |||
68 | break; | 69 | break; |
69 | } | 70 | } |
70 | } | 71 | } |
72 | /* clear value if nothing found */ | ||
73 | hw->phy.mdio.prtad = 0; | ||
71 | } else { | 74 | } else { |
72 | status = 0; | 75 | status = 0; |
73 | } | 76 | } |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index fa87309dc08..be90eb4575f 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -718,6 +718,12 @@ | |||
718 | #define IXGBE_ECC_STATUS_82599 0x110E0 | 718 | #define IXGBE_ECC_STATUS_82599 0x110E0 |
719 | #define IXGBE_BAR_CTRL_82599 0x110F4 | 719 | #define IXGBE_BAR_CTRL_82599 0x110F4 |
720 | 720 | ||
721 | /* PCI Express Control */ | ||
722 | #define IXGBE_GCR_CMPL_TMOUT_MASK 0x0000F000 | ||
723 | #define IXGBE_GCR_CMPL_TMOUT_10ms 0x00001000 | ||
724 | #define IXGBE_GCR_CMPL_TMOUT_RESEND 0x00010000 | ||
725 | #define IXGBE_GCR_CAP_VER2 0x00040000 | ||
726 | |||
721 | /* Time Sync Registers */ | 727 | /* Time Sync Registers */ |
722 | #define IXGBE_TSYNCRXCTL 0x05188 /* Rx Time Sync Control register - RW */ | 728 | #define IXGBE_TSYNCRXCTL 0x05188 /* Rx Time Sync Control register - RW */ |
723 | #define IXGBE_TSYNCTXCTL 0x08C00 /* Tx Time Sync Control register - RW */ | 729 | #define IXGBE_TSYNCTXCTL 0x08C00 /* Tx Time Sync Control register - RW */ |
@@ -1521,6 +1527,7 @@ | |||
1521 | 1527 | ||
1522 | /* PCI Bus Info */ | 1528 | /* PCI Bus Info */ |
1523 | #define IXGBE_PCI_LINK_STATUS 0xB2 | 1529 | #define IXGBE_PCI_LINK_STATUS 0xB2 |
1530 | #define IXGBE_PCI_DEVICE_CONTROL2 0xC8 | ||
1524 | #define IXGBE_PCI_LINK_WIDTH 0x3F0 | 1531 | #define IXGBE_PCI_LINK_WIDTH 0x3F0 |
1525 | #define IXGBE_PCI_LINK_WIDTH_1 0x10 | 1532 | #define IXGBE_PCI_LINK_WIDTH_1 0x10 |
1526 | #define IXGBE_PCI_LINK_WIDTH_2 0x20 | 1533 | #define IXGBE_PCI_LINK_WIDTH_2 0x20 |
@@ -1531,6 +1538,7 @@ | |||
1531 | #define IXGBE_PCI_LINK_SPEED_5000 0x2 | 1538 | #define IXGBE_PCI_LINK_SPEED_5000 0x2 |
1532 | #define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E | 1539 | #define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E |
1533 | #define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80 | 1540 | #define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80 |
1541 | #define IXGBE_PCI_DEVICE_CONTROL2_16ms 0x0005 | ||
1534 | 1542 | ||
1535 | /* Number of 100 microseconds we wait for PCI Express master disable */ | 1543 | /* Number of 100 microseconds we wait for PCI Express master disable */ |
1536 | #define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800 | 1544 | #define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800 |