Skip to content

Commit 59da45c

Browse files
committed
Merge git://github.com/Jkirsher/net-next
2 parents b53d63e + 1cc3bd8 commit 59da45c

3 files changed

Lines changed: 311 additions & 345 deletions

File tree

‎drivers/net/ethernet/intel/igb/igb.h‎

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -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

192188
struct 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 */
245242
static 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 */
254251
struct 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 *);
371372
extern void igb_configure_rx_ring(struct igb_adapter *, struct igb_ring *);
372373
extern void igb_setup_tctl(struct igb_adapter *);
373374
extern 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 *);
375376
extern 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);
378379
extern void igb_update_stats(struct igb_adapter *, struct rtnl_link_stats64 *);
379380
extern bool igb_has_link(struct igb_adapter *adapter);
380381
extern void igb_set_ethtool_ops(struct net_device *);

‎drivers/net/ethernet/intel/igb/igb_ethtool.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,6 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
13681368
rx_ring->count = IGB_DEFAULT_RXD;
13691369
rx_ring->dev = &adapter->pdev->dev;
13701370
rx_ring->netdev = adapter->netdev;
1371-
rx_ring->rx_buffer_len = IGB_RXBUFFER_2048;
13721371
rx_ring->reg_idx = adapter->vfs_allocated_count;
13731372

13741373
if (igb_setup_rx_resources(rx_ring)) {
@@ -1383,7 +1382,7 @@ static int igb_setup_desc_rings(struct igb_adapter *adapter)
13831382
igb_setup_rctl(adapter);
13841383
igb_configure_rx_ring(adapter, rx_ring);
13851384

1386-
igb_alloc_rx_buffers_adv(rx_ring, igb_desc_unused(rx_ring));
1385+
igb_alloc_rx_buffers(rx_ring, igb_desc_unused(rx_ring));
13871386

13881387
return 0;
13891388

@@ -1587,7 +1586,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
15871586
/* initialize next to clean and descriptor values */
15881587
rx_ntc = rx_ring->next_to_clean;
15891588
tx_ntc = tx_ring->next_to_clean;
1590-
rx_desc = E1000_RX_DESC_ADV(*rx_ring, rx_ntc);
1589+
rx_desc = IGB_RX_DESC(rx_ring, rx_ntc);
15911590
staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
15921591

15931592
while (staterr & E1000_RXD_STAT_DD) {
@@ -1597,7 +1596,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
15971596
/* unmap rx buffer, will be remapped by alloc_rx_buffers */
15981597
dma_unmap_single(rx_ring->dev,
15991598
buffer_info->dma,
1600-
rx_ring->rx_buffer_len,
1599+
IGB_RX_HDR_LEN,
16011600
DMA_FROM_DEVICE);
16021601
buffer_info->dma = 0;
16031602

@@ -1618,12 +1617,12 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
16181617
tx_ntc = 0;
16191618

16201619
/* fetch next descriptor */
1621-
rx_desc = E1000_RX_DESC_ADV(*rx_ring, rx_ntc);
1620+
rx_desc = IGB_RX_DESC(rx_ring, rx_ntc);
16221621
staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
16231622
}
16241623

16251624
/* re-map buffers to ring, store next to clean values */
1626-
igb_alloc_rx_buffers_adv(rx_ring, count);
1625+
igb_alloc_rx_buffers(rx_ring, count);
16271626
rx_ring->next_to_clean = rx_ntc;
16281627
tx_ring->next_to_clean = tx_ntc;
16291628

@@ -1635,7 +1634,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
16351634
struct igb_ring *tx_ring = &adapter->test_tx_ring;
16361635
struct igb_ring *rx_ring = &adapter->test_rx_ring;
16371636
int i, j, lc, good_cnt, ret_val = 0;
1638-
unsigned int size = 1024;
1637+
unsigned int size = IGB_RX_HDR_LEN;
16391638
netdev_tx_t tx_ret_val;
16401639
struct sk_buff *skb;
16411640

@@ -1666,7 +1665,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
16661665
/* place 64 packets on the transmit queue*/
16671666
for (i = 0; i < 64; i++) {
16681667
skb_get(skb);
1669-
tx_ret_val = igb_xmit_frame_ring_adv(skb, tx_ring);
1668+
tx_ret_val = igb_xmit_frame_ring(skb, tx_ring);
16701669
if (tx_ret_val == NETDEV_TX_OK)
16711670
good_cnt++;
16721671
}

0 commit comments

Comments
 (0)