diff options
Diffstat (limited to 'drivers/net/e1000/e1000.h')
-rw-r--r-- | drivers/net/e1000/e1000.h | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index e02e9ba2e18b..27c77306193b 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -72,10 +72,6 @@ | |||
72 | #include <linux/mii.h> | 72 | #include <linux/mii.h> |
73 | #include <linux/ethtool.h> | 73 | #include <linux/ethtool.h> |
74 | #include <linux/if_vlan.h> | 74 | #include <linux/if_vlan.h> |
75 | #ifdef CONFIG_E1000_MQ | ||
76 | #include <linux/cpu.h> | ||
77 | #include <linux/smp.h> | ||
78 | #endif | ||
79 | 75 | ||
80 | #define BAR_0 0 | 76 | #define BAR_0 0 |
81 | #define BAR_1 1 | 77 | #define BAR_1 1 |
@@ -87,6 +83,10 @@ | |||
87 | struct e1000_adapter; | 83 | struct e1000_adapter; |
88 | 84 | ||
89 | #include "e1000_hw.h" | 85 | #include "e1000_hw.h" |
86 | #ifdef CONFIG_E1000_MQ | ||
87 | #include <linux/cpu.h> | ||
88 | #include <linux/smp.h> | ||
89 | #endif | ||
90 | 90 | ||
91 | #ifdef DBG | 91 | #ifdef DBG |
92 | #define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args) | 92 | #define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args) |
@@ -169,6 +169,13 @@ struct e1000_buffer { | |||
169 | uint16_t next_to_watch; | 169 | uint16_t next_to_watch; |
170 | }; | 170 | }; |
171 | 171 | ||
172 | #ifdef CONFIG_E1000_MQ | ||
173 | struct e1000_queue_stats { | ||
174 | uint64_t packets; | ||
175 | uint64_t bytes; | ||
176 | }; | ||
177 | #endif | ||
178 | |||
172 | struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; }; | 179 | struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; }; |
173 | struct e1000_ps_page_dma { uint64_t ps_page_dma[PS_PAGE_BUFFERS]; }; | 180 | struct e1000_ps_page_dma { uint64_t ps_page_dma[PS_PAGE_BUFFERS]; }; |
174 | 181 | ||
@@ -191,10 +198,12 @@ struct e1000_tx_ring { | |||
191 | spinlock_t tx_lock; | 198 | spinlock_t tx_lock; |
192 | uint16_t tdh; | 199 | uint16_t tdh; |
193 | uint16_t tdt; | 200 | uint16_t tdt; |
194 | uint64_t pkt; | ||
195 | 201 | ||
196 | boolean_t last_tx_tso; | 202 | boolean_t last_tx_tso; |
197 | 203 | ||
204 | #ifdef CONFIG_E1000_MQ | ||
205 | struct e1000_queue_stats tx_stats; | ||
206 | #endif | ||
198 | }; | 207 | }; |
199 | 208 | ||
200 | struct e1000_rx_ring { | 209 | struct e1000_rx_ring { |
@@ -216,9 +225,17 @@ struct e1000_rx_ring { | |||
216 | struct e1000_ps_page *ps_page; | 225 | struct e1000_ps_page *ps_page; |
217 | struct e1000_ps_page_dma *ps_page_dma; | 226 | struct e1000_ps_page_dma *ps_page_dma; |
218 | 227 | ||
228 | struct sk_buff *rx_skb_top; | ||
229 | struct sk_buff *rx_skb_prev; | ||
230 | |||
231 | /* cpu for rx queue */ | ||
232 | int cpu; | ||
233 | |||
219 | uint16_t rdh; | 234 | uint16_t rdh; |
220 | uint16_t rdt; | 235 | uint16_t rdt; |
221 | uint64_t pkt; | 236 | #ifdef CONFIG_E1000_MQ |
237 | struct e1000_queue_stats rx_stats; | ||
238 | #endif | ||
222 | }; | 239 | }; |
223 | 240 | ||
224 | #define E1000_DESC_UNUSED(R) \ | 241 | #define E1000_DESC_UNUSED(R) \ |
@@ -251,6 +268,9 @@ struct e1000_adapter { | |||
251 | uint16_t link_speed; | 268 | uint16_t link_speed; |
252 | uint16_t link_duplex; | 269 | uint16_t link_duplex; |
253 | spinlock_t stats_lock; | 270 | spinlock_t stats_lock; |
271 | #ifdef CONFIG_E1000_NAPI | ||
272 | spinlock_t tx_queue_lock; | ||
273 | #endif | ||
254 | atomic_t irq_sem; | 274 | atomic_t irq_sem; |
255 | struct work_struct tx_timeout_task; | 275 | struct work_struct tx_timeout_task; |
256 | struct work_struct watchdog_task; | 276 | struct work_struct watchdog_task; |
@@ -264,6 +284,7 @@ struct e1000_adapter { | |||
264 | #ifdef CONFIG_E1000_MQ | 284 | #ifdef CONFIG_E1000_MQ |
265 | struct e1000_tx_ring **cpu_tx_ring; /* per-cpu */ | 285 | struct e1000_tx_ring **cpu_tx_ring; /* per-cpu */ |
266 | #endif | 286 | #endif |
287 | unsigned long tx_queue_len; | ||
267 | uint32_t txd_cmd; | 288 | uint32_t txd_cmd; |
268 | uint32_t tx_int_delay; | 289 | uint32_t tx_int_delay; |
269 | uint32_t tx_abs_int_delay; | 290 | uint32_t tx_abs_int_delay; |
@@ -271,9 +292,11 @@ struct e1000_adapter { | |||
271 | uint64_t gotcl_old; | 292 | uint64_t gotcl_old; |
272 | uint64_t tpt_old; | 293 | uint64_t tpt_old; |
273 | uint64_t colc_old; | 294 | uint64_t colc_old; |
295 | uint32_t tx_timeout_count; | ||
274 | uint32_t tx_fifo_head; | 296 | uint32_t tx_fifo_head; |
275 | uint32_t tx_head_addr; | 297 | uint32_t tx_head_addr; |
276 | uint32_t tx_fifo_size; | 298 | uint32_t tx_fifo_size; |
299 | uint8_t tx_timeout_factor; | ||
277 | atomic_t tx_fifo_stall; | 300 | atomic_t tx_fifo_stall; |
278 | boolean_t pcix_82544; | 301 | boolean_t pcix_82544; |
279 | boolean_t detect_tx_hung; | 302 | boolean_t detect_tx_hung; |
@@ -281,14 +304,15 @@ struct e1000_adapter { | |||
281 | /* RX */ | 304 | /* RX */ |
282 | #ifdef CONFIG_E1000_NAPI | 305 | #ifdef CONFIG_E1000_NAPI |
283 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, | 306 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, |
284 | struct e1000_rx_ring *rx_ring, | 307 | struct e1000_rx_ring *rx_ring, |
285 | int *work_done, int work_to_do); | 308 | int *work_done, int work_to_do); |
286 | #else | 309 | #else |
287 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, | 310 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, |
288 | struct e1000_rx_ring *rx_ring); | 311 | struct e1000_rx_ring *rx_ring); |
289 | #endif | 312 | #endif |
290 | void (*alloc_rx_buf) (struct e1000_adapter *adapter, | 313 | void (*alloc_rx_buf) (struct e1000_adapter *adapter, |
291 | struct e1000_rx_ring *rx_ring); | 314 | struct e1000_rx_ring *rx_ring, |
315 | int cleaned_count); | ||
292 | struct e1000_rx_ring *rx_ring; /* One per active queue */ | 316 | struct e1000_rx_ring *rx_ring; /* One per active queue */ |
293 | #ifdef CONFIG_E1000_NAPI | 317 | #ifdef CONFIG_E1000_NAPI |
294 | struct net_device *polling_netdev; /* One per active queue */ | 318 | struct net_device *polling_netdev; /* One per active queue */ |
@@ -296,13 +320,15 @@ struct e1000_adapter { | |||
296 | #ifdef CONFIG_E1000_MQ | 320 | #ifdef CONFIG_E1000_MQ |
297 | struct net_device **cpu_netdev; /* per-cpu */ | 321 | struct net_device **cpu_netdev; /* per-cpu */ |
298 | struct call_async_data_struct rx_sched_call_data; | 322 | struct call_async_data_struct rx_sched_call_data; |
299 | int cpu_for_queue[4]; | 323 | cpumask_t cpumask; |
300 | #endif | 324 | #endif |
301 | int num_queues; | 325 | int num_tx_queues; |
326 | int num_rx_queues; | ||
302 | 327 | ||
303 | uint64_t hw_csum_err; | 328 | uint64_t hw_csum_err; |
304 | uint64_t hw_csum_good; | 329 | uint64_t hw_csum_good; |
305 | uint64_t rx_hdr_split; | 330 | uint64_t rx_hdr_split; |
331 | uint32_t alloc_rx_buff_failed; | ||
306 | uint32_t rx_int_delay; | 332 | uint32_t rx_int_delay; |
307 | uint32_t rx_abs_int_delay; | 333 | uint32_t rx_abs_int_delay; |
308 | boolean_t rx_csum; | 334 | boolean_t rx_csum; |
@@ -330,6 +356,7 @@ struct e1000_adapter { | |||
330 | struct e1000_rx_ring test_rx_ring; | 356 | struct e1000_rx_ring test_rx_ring; |
331 | 357 | ||
332 | 358 | ||
359 | u32 *config_space; | ||
333 | int msg_enable; | 360 | int msg_enable; |
334 | #ifdef CONFIG_PCI_MSI | 361 | #ifdef CONFIG_PCI_MSI |
335 | boolean_t have_msi; | 362 | boolean_t have_msi; |