@@ -32,13 +32,31 @@ extern char igc_driver_version[];
32
32
#define IGC_START_ITR 648 /* ~6000 ints/sec */
33
33
#define IGC_FLAG_HAS_MSI BIT(0)
34
34
#define IGC_FLAG_QUEUE_PAIRS BIT(4)
35
+ #define IGC_FLAG_NEED_LINK_UPDATE BIT(9)
35
36
#define IGC_FLAG_HAS_MSIX BIT(13)
37
+ #define IGC_FLAG_VLAN_PROMISC BIT(15)
36
38
37
39
#define IGC_START_ITR 648 /* ~6000 ints/sec */
38
40
#define IGC_4K_ITR 980
39
41
#define IGC_20K_ITR 196
40
42
#define IGC_70K_ITR 56
41
43
44
+ #define IGC_DEFAULT_ITR 3 /* dynamic */
45
+ #define IGC_MAX_ITR_USECS 10000
46
+ #define IGC_MIN_ITR_USECS 10
47
+ #define NON_Q_VECTORS 1
48
+ #define MAX_MSIX_ENTRIES 10
49
+
50
+ /* TX/RX descriptor defines */
51
+ #define IGC_DEFAULT_TXD 256
52
+ #define IGC_DEFAULT_TX_WORK 128
53
+ #define IGC_MIN_TXD 80
54
+ #define IGC_MAX_TXD 4096
55
+
56
+ #define IGC_DEFAULT_RXD 256
57
+ #define IGC_MIN_RXD 80
58
+ #define IGC_MAX_RXD 4096
59
+
42
60
/* Transmit and receive queues */
43
61
#define IGC_MAX_RX_QUEUES 4
44
62
#define IGC_MAX_TX_QUEUES 4
@@ -85,13 +103,44 @@ extern char igc_driver_version[];
85
103
#define IGC_MAX_FRAME_BUILD_SKB (IGC_RXBUFFER_2048 - IGC_TS_HDR_LEN)
86
104
#endif
87
105
106
+ /* How many Rx Buffers do we bundle into one write to the hardware ? */
107
+ #define IGC_RX_BUFFER_WRITE 16 /* Must be power of 2 */
108
+
109
+ /* igc_test_staterr - tests bits within Rx descriptor status and error fields */
110
+ static inline __le32 igc_test_staterr (union igc_adv_rx_desc * rx_desc ,
111
+ const u32 stat_err_bits )
112
+ {
113
+ return rx_desc -> wb .upper .status_error & cpu_to_le32 (stat_err_bits );
114
+ }
115
+
88
116
enum igc_state_t {
89
117
__IGC_TESTING ,
90
118
__IGC_RESETTING ,
91
119
__IGC_DOWN ,
92
120
__IGC_PTP_TX_IN_PROGRESS ,
93
121
};
94
122
123
+ enum igc_tx_flags {
124
+ /* cmd_type flags */
125
+ IGC_TX_FLAGS_VLAN = 0x01 ,
126
+ IGC_TX_FLAGS_TSO = 0x02 ,
127
+ IGC_TX_FLAGS_TSTAMP = 0x04 ,
128
+
129
+ /* olinfo flags */
130
+ IGC_TX_FLAGS_IPV4 = 0x10 ,
131
+ IGC_TX_FLAGS_CSUM = 0x20 ,
132
+ };
133
+
134
+ /* The largest size we can write to the descriptor is 65535. In order to
135
+ * maintain a power of two alignment we have to limit ourselves to 32K.
136
+ */
137
+ #define IGC_MAX_TXD_PWR 15
138
+ #define IGC_MAX_DATA_PER_TXD BIT(IGC_MAX_TXD_PWR)
139
+
140
+ /* Tx Descriptors needed, worst case */
141
+ #define TXD_USE_COUNT (S ) DIV_ROUND_UP((S), IGC_MAX_DATA_PER_TXD)
142
+ #define DESC_NEEDED (MAX_SKB_FRAGS + 4)
143
+
95
144
/* wrapper around a pointer to a socket buffer,
96
145
* so a DMA handle can be stored along with the buffer
97
146
*/
@@ -123,6 +172,7 @@ struct igc_tx_queue_stats {
123
172
u64 packets ;
124
173
u64 bytes ;
125
174
u64 restart_queue ;
175
+ u64 restart_queue2 ;
126
176
};
127
177
128
178
struct igc_rx_queue_stats {
@@ -181,11 +231,14 @@ struct igc_ring {
181
231
/* TX */
182
232
struct {
183
233
struct igc_tx_queue_stats tx_stats ;
234
+ struct u64_stats_sync tx_syncp ;
235
+ struct u64_stats_sync tx_syncp2 ;
184
236
};
185
237
/* RX */
186
238
struct {
187
239
struct igc_rx_queue_stats rx_stats ;
188
240
struct igc_rx_packet_stats pkt_stats ;
241
+ struct u64_stats_sync rx_syncp ;
189
242
struct sk_buff * skb ;
190
243
};
191
244
};
@@ -258,11 +311,17 @@ struct igc_adapter {
258
311
struct work_struct watchdog_task ;
259
312
struct work_struct dma_err_task ;
260
313
314
+ u8 tx_timeout_factor ;
315
+
261
316
int msg_enable ;
262
317
u32 max_frame_size ;
318
+ u32 min_frame_size ;
263
319
264
320
/* OS defined structs */
265
321
struct pci_dev * pdev ;
322
+ /* lock for statistics */
323
+ spinlock_t stats64_lock ;
324
+ struct rtnl_link_stats64 stats64 ;
266
325
267
326
/* structs defined in igc_hw.h */
268
327
struct igc_hw hw ;
@@ -275,8 +334,13 @@ struct igc_adapter {
275
334
u16 tx_ring_count ;
276
335
u16 rx_ring_count ;
277
336
337
+ u32 * shadow_vfta ;
338
+
278
339
u32 rss_queues ;
279
340
341
+ /* lock for RX network flow classification filter */
342
+ spinlock_t nfc_lock ;
343
+
280
344
struct igc_mac_addr * mac_table ;
281
345
};
282
346
@@ -332,6 +396,8 @@ static inline unsigned int igc_rx_pg_order(struct igc_ring *ring)
332
396
333
397
#define igc_rx_pg_size (_ring ) (PAGE_SIZE << igc_rx_pg_order(_ring))
334
398
399
+ #define IGC_TXD_DCMD (IGC_ADVTXD_DCMD_EOP | IGC_ADVTXD_DCMD_RS)
400
+
335
401
#define IGC_RX_DESC (R , i ) \
336
402
(&(((union igc_adv_rx_desc *)((R)->desc))[i]))
337
403
#define IGC_TX_DESC (R , i ) \
0 commit comments