@@ -63,8 +63,7 @@ struct igb_adapter;
6363/* Transmit and receive queues */
6464#define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? 2 : \
6565 (hw->mac.type > e1000_82575 ? 8 : 4))
66- #define IGB_ABS_MAX_TX_QUEUES 8
67- #define IGB_MAX_TX_QUEUES IGB_MAX_RX_QUEUES
66+ #define IGB_MAX_TX_QUEUES 16
6867
6968#define IGB_MAX_VF_MC_ENTRIES 30
7069#define IGB_MAX_VF_FUNCTIONS 8
@@ -100,23 +99,20 @@ struct vf_data_storage {
10099 */
101100#define IGB_RX_PTHRESH 8
102101#define IGB_RX_HTHRESH 8
103- #define IGB_RX_WTHRESH 1
104102#define IGB_TX_PTHRESH 8
105103#define IGB_TX_HTHRESH 1
104+ #define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
105+ adapter->msix_entries) ? 1 : 4)
106106#define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
107- adapter->msix_entries) ? 1 : 16)
107+ adapter->msix_entries) ? 1 : 16)
108108
109109/* this is the size past which hardware will drop packets when setting LPE=0 */
110110#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
111111
112112/* Supported Rx Buffer Sizes */
113- #define IGB_RXBUFFER_64 64 /* Used for packet split */
114- #define IGB_RXBUFFER_128 128 /* Used for packet split */
115- #define IGB_RXBUFFER_1024 1024
116- #define IGB_RXBUFFER_2048 2048
113+ #define IGB_RXBUFFER_512 512
117114#define IGB_RXBUFFER_16384 16384
118-
119- #define MAX_STD_JUMBO_FRAME_SIZE 9234
115+ #define IGB_RX_HDR_LEN IGB_RXBUFFER_512
120116
121117/* How many Tx Descriptors do we need to call netif_wake_queue ? */
122118#define IGB_TX_QUEUE_WAKE 16
@@ -190,26 +186,26 @@ struct igb_q_vector {
190186};
191187
192188struct igb_ring {
193- struct igb_q_vector * q_vector ; /* backlink to q_vector */
194- struct net_device * netdev ; /* back pointer to net_device */
195- struct device * dev ; /* device pointer for dma mapping */
196- dma_addr_t dma ; /* phys address of the ring */
197- void * desc ; /* descriptor ring memory */
198- unsigned int size ; /* length of desc. ring in bytes */
199- u16 count ; /* number of desc. in the ring */
189+ struct igb_q_vector * q_vector ; /* backlink to q_vector */
190+ struct net_device * netdev ; /* back pointer to net_device */
191+ struct device * dev ; /* device pointer for dma mapping */
192+ struct igb_buffer * buffer_info ; /* array of buffer info structs */
193+ void * desc ; /* descriptor ring memory */
194+ unsigned long flags ; /* ring specific flags */
195+ void __iomem * tail ; /* pointer to ring tail register */
196+
197+ u16 count ; /* number of desc. in the ring */
198+ u8 queue_index ; /* logical index of the ring*/
199+ u8 reg_idx ; /* physical index of the ring */
200+ u32 size ; /* length of desc. ring in bytes */
201+
202+ /* everything past this point are written often */
203+ u16 next_to_clean ____cacheline_aligned_in_smp ;
200204 u16 next_to_use ;
201- u16 next_to_clean ;
202- u8 queue_index ;
203- u8 reg_idx ;
204- void __iomem * head ;
205- void __iomem * tail ;
206- struct igb_buffer * buffer_info ; /* array of buffer info structs */
207205
208206 unsigned int total_bytes ;
209207 unsigned int total_packets ;
210208
211- u32 flags ;
212-
213209 union {
214210 /* TX */
215211 struct {
@@ -222,9 +218,10 @@ struct igb_ring {
222218 struct {
223219 struct igb_rx_queue_stats rx_stats ;
224220 struct u64_stats_sync rx_syncp ;
225- u32 rx_buffer_len ;
226221 };
227222 };
223+ /* Items past this point are only used during ring alloc / free */
224+ dma_addr_t dma ; /* phys address of the ring */
228225};
229226
230227#define IGB_RING_FLAG_RX_CSUM 0x00000001 /* RX CSUM enabled */
@@ -234,12 +231,12 @@ struct igb_ring {
234231
235232#define IGB_ADVTXD_DCMD (E1000_TXD_CMD_EOP | E1000_TXD_CMD_RS)
236233
237- #define E1000_RX_DESC_ADV (R , i ) \
238- (&(((union e1000_adv_rx_desc *)((R). desc))[i]))
239- #define E1000_TX_DESC_ADV (R , i ) \
240- (&(((union e1000_adv_tx_desc *)((R). desc))[i]))
241- #define E1000_TX_CTXTDESC_ADV (R , i ) \
242- (&(((struct e1000_adv_tx_context_desc *)((R). desc))[i]))
234+ #define IGB_RX_DESC (R , i ) \
235+ (&(((union e1000_adv_rx_desc *)((R)-> desc))[i]))
236+ #define IGB_TX_DESC (R , i ) \
237+ (&(((union e1000_adv_tx_desc *)((R)-> desc))[i]))
238+ #define IGB_TX_CTXTDESC (R , i ) \
239+ (&(((struct e1000_adv_tx_context_desc *)((R)-> desc))[i]))
243240
244241/* igb_desc_unused - calculate if we have unused descriptors */
245242static inline int igb_desc_unused (struct igb_ring * ring )
@@ -252,43 +249,52 @@ static inline int igb_desc_unused(struct igb_ring *ring)
252249
253250/* board specific private data structure */
254251struct igb_adapter {
255- struct timer_list watchdog_timer ;
256- struct timer_list phy_info_timer ;
257252 unsigned long active_vlans [BITS_TO_LONGS (VLAN_N_VID )];
258- u16 mng_vlan_id ;
259- u32 bd_number ;
260- u32 wol ;
261- u32 en_mng_pt ;
262- u16 link_speed ;
263- u16 link_duplex ;
253+
254+ struct net_device * netdev ;
255+
256+ unsigned long state ;
257+ unsigned int flags ;
258+
259+ unsigned int num_q_vectors ;
260+ struct msix_entry * msix_entries ;
264261
265262 /* Interrupt Throttle Rate */
266263 u32 rx_itr_setting ;
267264 u32 tx_itr_setting ;
268265 u16 tx_itr ;
269266 u16 rx_itr ;
270267
271- struct work_struct reset_task ;
272- struct work_struct watchdog_task ;
273- bool fc_autoneg ;
274- u8 tx_timeout_factor ;
275- struct timer_list blink_timer ;
276- unsigned long led_status ;
277-
278268 /* TX */
279- struct igb_ring * tx_ring [16 ];
280269 u32 tx_timeout_count ;
270+ int num_tx_queues ;
271+ struct igb_ring * tx_ring [16 ];
281272
282273 /* RX */
283- struct igb_ring * rx_ring [16 ];
284- int num_tx_queues ;
285274 int num_rx_queues ;
275+ struct igb_ring * rx_ring [16 ];
286276
287277 u32 max_frame_size ;
288278 u32 min_frame_size ;
289279
280+ struct timer_list watchdog_timer ;
281+ struct timer_list phy_info_timer ;
282+
283+ u16 mng_vlan_id ;
284+ u32 bd_number ;
285+ u32 wol ;
286+ u32 en_mng_pt ;
287+ u16 link_speed ;
288+ u16 link_duplex ;
289+
290+ struct work_struct reset_task ;
291+ struct work_struct watchdog_task ;
292+ bool fc_autoneg ;
293+ u8 tx_timeout_factor ;
294+ struct timer_list blink_timer ;
295+ unsigned long led_status ;
296+
290297 /* OS defined structs */
291- struct net_device * netdev ;
292298 struct pci_dev * pdev ;
293299 struct cyclecounter cycles ;
294300 struct timecounter clock ;
@@ -310,18 +316,13 @@ struct igb_adapter {
310316
311317 int msg_enable ;
312318
313- unsigned int num_q_vectors ;
314319 struct igb_q_vector * q_vector [MAX_Q_VECTORS ];
315- struct msix_entry * msix_entries ;
316320 u32 eims_enable_mask ;
317321 u32 eims_other ;
318322
319323 /* to not mess up cache alignment, always add to the bottom */
320- unsigned long state ;
321- unsigned int flags ;
322324 u32 eeprom_wol ;
323325
324- struct igb_ring * multi_tx_table [IGB_ABS_MAX_TX_QUEUES ];
325326 u16 tx_ring_count ;
326327 u16 rx_ring_count ;
327328 unsigned int vfs_allocated_count ;
@@ -371,10 +372,10 @@ extern void igb_configure_tx_ring(struct igb_adapter *, struct igb_ring *);
371372extern void igb_configure_rx_ring (struct igb_adapter * , struct igb_ring * );
372373extern void igb_setup_tctl (struct igb_adapter * );
373374extern void igb_setup_rctl (struct igb_adapter * );
374- extern netdev_tx_t igb_xmit_frame_ring_adv (struct sk_buff * , struct igb_ring * );
375+ extern netdev_tx_t igb_xmit_frame_ring (struct sk_buff * , struct igb_ring * );
375376extern void igb_unmap_and_free_tx_resource (struct igb_ring * ,
376377 struct igb_buffer * );
377- extern void igb_alloc_rx_buffers_adv (struct igb_ring * , int );
378+ extern void igb_alloc_rx_buffers (struct igb_ring * , u16 );
378379extern void igb_update_stats (struct igb_adapter * , struct rtnl_link_stats64 * );
379380extern bool igb_has_link (struct igb_adapter * adapter );
380381extern void igb_set_ethtool_ops (struct net_device * );
0 commit comments