aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe.h')
-rw-r--r--drivers/net/ixgbe/ixgbe.h161
1 files changed, 139 insertions, 22 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index c26433d14605..cd22323cfd22 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -36,6 +36,10 @@
36#include "ixgbe_type.h" 36#include "ixgbe_type.h"
37#include "ixgbe_common.h" 37#include "ixgbe_common.h"
38#include "ixgbe_dcb.h" 38#include "ixgbe_dcb.h"
39#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
40#define IXGBE_FCOE
41#include "ixgbe_fcoe.h"
42#endif /* CONFIG_FCOE or CONFIG_FCOE_MODULE */
39#ifdef CONFIG_IXGBE_DCA 43#ifdef CONFIG_IXGBE_DCA
40#include <linux/dca.h> 44#include <linux/dca.h>
41#endif 45#endif
@@ -71,6 +75,8 @@
71#define IXGBE_RXBUFFER_128 128 /* Used for packet split */ 75#define IXGBE_RXBUFFER_128 128 /* Used for packet split */
72#define IXGBE_RXBUFFER_256 256 /* Used for packet split */ 76#define IXGBE_RXBUFFER_256 256 /* Used for packet split */
73#define IXGBE_RXBUFFER_2048 2048 77#define IXGBE_RXBUFFER_2048 2048
78#define IXGBE_RXBUFFER_4096 4096
79#define IXGBE_RXBUFFER_8192 8192
74#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */ 80#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */
75 81
76#define IXGBE_RX_HDR_SIZE IXGBE_RXBUFFER_256 82#define IXGBE_RX_HDR_SIZE IXGBE_RXBUFFER_256
@@ -84,6 +90,8 @@
84#define IXGBE_TX_FLAGS_VLAN (u32)(1 << 1) 90#define IXGBE_TX_FLAGS_VLAN (u32)(1 << 1)
85#define IXGBE_TX_FLAGS_TSO (u32)(1 << 2) 91#define IXGBE_TX_FLAGS_TSO (u32)(1 << 2)
86#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 3) 92#define IXGBE_TX_FLAGS_IPV4 (u32)(1 << 3)
93#define IXGBE_TX_FLAGS_FCOE (u32)(1 << 4)
94#define IXGBE_TX_FLAGS_FSO (u32)(1 << 5)
87#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000 95#define IXGBE_TX_FLAGS_VLAN_MASK 0xffff0000
88#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000 96#define IXGBE_TX_FLAGS_VLAN_PRIO_MASK 0x0000e000
89#define IXGBE_TX_FLAGS_VLAN_SHIFT 16 97#define IXGBE_TX_FLAGS_VLAN_SHIFT 16
@@ -113,17 +121,18 @@ struct ixgbe_queue_stats {
113 121
114struct ixgbe_ring { 122struct ixgbe_ring {
115 void *desc; /* descriptor ring memory */ 123 void *desc; /* descriptor ring memory */
116 dma_addr_t dma; /* phys. address of descriptor ring */
117 unsigned int size; /* length in bytes */
118 unsigned int count; /* amount of descriptors */
119 unsigned int next_to_use;
120 unsigned int next_to_clean;
121
122 int queue_index; /* needed for multiqueue queue management */
123 union { 124 union {
124 struct ixgbe_tx_buffer *tx_buffer_info; 125 struct ixgbe_tx_buffer *tx_buffer_info;
125 struct ixgbe_rx_buffer *rx_buffer_info; 126 struct ixgbe_rx_buffer *rx_buffer_info;
126 }; 127 };
128 u8 atr_sample_rate;
129 u8 atr_count;
130 u16 count; /* amount of descriptors */
131 u16 rx_buf_len;
132 u16 next_to_use;
133 u16 next_to_clean;
134
135 u8 queue_index; /* needed for multiqueue queue management */
127 136
128 u16 head; 137 u16 head;
129 u16 tail; 138 u16 tail;
@@ -131,22 +140,24 @@ struct ixgbe_ring {
131 unsigned int total_bytes; 140 unsigned int total_bytes;
132 unsigned int total_packets; 141 unsigned int total_packets;
133 142
134 u16 reg_idx; /* holds the special value that gets the hardware register
135 * offset associated with this ring, which is different
136 * for DCB and RSS modes */
137
138#ifdef CONFIG_IXGBE_DCA 143#ifdef CONFIG_IXGBE_DCA
139 /* cpu for tx queue */ 144 /* cpu for tx queue */
140 int cpu; 145 int cpu;
141#endif 146#endif
142 struct ixgbe_queue_stats stats;
143 u64 v_idx; /* maps directly to the index for this ring in the hardware
144 * vector array, can also be used for finding the bit in EICR
145 * and friends that represents the vector for this ring */
146 147
148 u16 work_limit; /* max work per interrupt */
149 u16 reg_idx; /* holds the special value that gets
150 * the hardware register offset
151 * associated with this ring, which is
152 * different for DCB and RSS modes
153 */
147 154
148 u16 work_limit; /* max work per interrupt */ 155 struct ixgbe_queue_stats stats;
149 u16 rx_buf_len; 156 unsigned long reinit_state;
157 u64 rsc_count; /* stat for coalesced packets */
158
159 unsigned int size; /* length in bytes */
160 dma_addr_t dma; /* phys. address of descriptor ring */
150}; 161};
151 162
152enum ixgbe_ring_f_enum { 163enum ixgbe_ring_f_enum {
@@ -154,6 +165,10 @@ enum ixgbe_ring_f_enum {
154 RING_F_DCB, 165 RING_F_DCB,
155 RING_F_VMDQ, 166 RING_F_VMDQ,
156 RING_F_RSS, 167 RING_F_RSS,
168 RING_F_FDIR,
169#ifdef IXGBE_FCOE
170 RING_F_FCOE,
171#endif /* IXGBE_FCOE */
157 172
158 RING_F_ARRAY_SIZE /* must be last in enum set */ 173 RING_F_ARRAY_SIZE /* must be last in enum set */
159}; 174};
@@ -161,6 +176,10 @@ enum ixgbe_ring_f_enum {
161#define IXGBE_MAX_DCB_INDICES 8 176#define IXGBE_MAX_DCB_INDICES 8
162#define IXGBE_MAX_RSS_INDICES 16 177#define IXGBE_MAX_RSS_INDICES 16
163#define IXGBE_MAX_VMDQ_INDICES 16 178#define IXGBE_MAX_VMDQ_INDICES 16
179#define IXGBE_MAX_FDIR_INDICES 64
180#ifdef IXGBE_FCOE
181#define IXGBE_MAX_FCOE_INDICES 8
182#endif /* IXGBE_FCOE */
164struct ixgbe_ring_feature { 183struct ixgbe_ring_feature {
165 int indices; 184 int indices;
166 int mask; 185 int mask;
@@ -178,6 +197,9 @@ struct ixgbe_ring_feature {
178 */ 197 */
179struct ixgbe_q_vector { 198struct ixgbe_q_vector {
180 struct ixgbe_adapter *adapter; 199 struct ixgbe_adapter *adapter;
200 unsigned int v_idx; /* index of q_vector within array, also used for
201 * finding the bit in EICR and friends that
202 * represents the vector for this ring */
181 struct napi_struct napi; 203 struct napi_struct napi;
182 DECLARE_BITMAP(rxr_idx, MAX_RX_QUEUES); /* Rx ring indices */ 204 DECLARE_BITMAP(rxr_idx, MAX_RX_QUEUES); /* Rx ring indices */
183 DECLARE_BITMAP(txr_idx, MAX_TX_QUEUES); /* Tx ring indices */ 205 DECLARE_BITMAP(txr_idx, MAX_TX_QUEUES); /* Tx ring indices */
@@ -207,7 +229,15 @@ struct ixgbe_q_vector {
207#define IXGBE_TX_CTXTDESC_ADV(R, i) \ 229#define IXGBE_TX_CTXTDESC_ADV(R, i) \
208 (&(((struct ixgbe_adv_tx_context_desc *)((R).desc))[i])) 230 (&(((struct ixgbe_adv_tx_context_desc *)((R).desc))[i]))
209 231
232#define IXGBE_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i]))
233#define IXGBE_TX_DESC(R, i) IXGBE_GET_DESC(R, i, ixgbe_legacy_tx_desc)
234#define IXGBE_RX_DESC(R, i) IXGBE_GET_DESC(R, i, ixgbe_legacy_rx_desc)
235
210#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128 236#define IXGBE_MAX_JUMBO_FRAME_SIZE 16128
237#ifdef IXGBE_FCOE
238/* Use 3K as the baby jumbo frame size for FCoE */
239#define IXGBE_FCOE_JUMBO_FRAME_SIZE 3072
240#endif /* IXGBE_FCOE */
211 241
212#define OTHER_VECTOR 1 242#define OTHER_VECTOR 1
213#define NON_Q_VECTORS (OTHER_VECTOR) 243#define NON_Q_VECTORS (OTHER_VECTOR)
@@ -229,11 +259,12 @@ struct ixgbe_adapter {
229 struct vlan_group *vlgrp; 259 struct vlan_group *vlgrp;
230 u16 bd_number; 260 u16 bd_number;
231 struct work_struct reset_task; 261 struct work_struct reset_task;
232 struct ixgbe_q_vector q_vector[MAX_MSIX_Q_VECTORS]; 262 struct ixgbe_q_vector *q_vector[MAX_MSIX_Q_VECTORS];
233 char name[MAX_MSIX_COUNT][IFNAMSIZ + 9]; 263 char name[MAX_MSIX_COUNT][IFNAMSIZ + 9];
234 struct ixgbe_dcb_config dcb_cfg; 264 struct ixgbe_dcb_config dcb_cfg;
235 struct ixgbe_dcb_config temp_dcb_cfg; 265 struct ixgbe_dcb_config temp_dcb_cfg;
236 u8 dcb_set_bitmap; 266 u8 dcb_set_bitmap;
267 enum ixgbe_fc_mode last_lfc_mode;
237 268
238 /* Interrupt Throttle Rate */ 269 /* Interrupt Throttle Rate */
239 u32 itr_setting; 270 u32 itr_setting;
@@ -294,7 +325,13 @@ struct ixgbe_adapter {
294#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23) 325#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23)
295#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 24) 326#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 24)
296#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25) 327#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25)
328#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26)
329#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27)
330#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29)
297 331
332 u32 flags2;
333#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1)
334#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1)
298/* default to trying for four seconds */ 335/* default to trying for four seconds */
299#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ) 336#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ)
300 337
@@ -303,6 +340,10 @@ struct ixgbe_adapter {
303 struct pci_dev *pdev; 340 struct pci_dev *pdev;
304 struct net_device_stats net_stats; 341 struct net_device_stats net_stats;
305 342
343 u32 test_icr;
344 struct ixgbe_ring test_tx_ring;
345 struct ixgbe_ring test_rx_ring;
346
306 /* structs defined in ixgbe_hw.h */ 347 /* structs defined in ixgbe_hw.h */
307 struct ixgbe_hw hw; 348 struct ixgbe_hw hw;
308 u16 msg_enable; 349 u16 msg_enable;
@@ -325,6 +366,14 @@ struct ixgbe_adapter {
325 struct timer_list sfp_timer; 366 struct timer_list sfp_timer;
326 struct work_struct multispeed_fiber_task; 367 struct work_struct multispeed_fiber_task;
327 struct work_struct sfp_config_module_task; 368 struct work_struct sfp_config_module_task;
369 u32 fdir_pballoc;
370 u32 atr_sample_rate;
371 spinlock_t fdir_perfect_lock;
372 struct work_struct fdir_reinit_task;
373#ifdef IXGBE_FCOE
374 struct ixgbe_fcoe fcoe;
375#endif /* IXGBE_FCOE */
376 u64 rsc_count;
328 u32 wol; 377 u32 wol;
329 u16 eeprom_version; 378 u16 eeprom_version;
330}; 379};
@@ -333,6 +382,7 @@ enum ixbge_state_t {
333 __IXGBE_TESTING, 382 __IXGBE_TESTING,
334 __IXGBE_RESETTING, 383 __IXGBE_RESETTING,
335 __IXGBE_DOWN, 384 __IXGBE_DOWN,
385 __IXGBE_FDIR_INIT_DONE,
336 __IXGBE_SFP_MODULE_NOT_FOUND 386 __IXGBE_SFP_MODULE_NOT_FOUND
337}; 387};
338 388
@@ -363,10 +413,77 @@ extern int ixgbe_setup_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *)
363extern void ixgbe_free_rx_resources(struct ixgbe_adapter *, struct ixgbe_ring *); 413extern void ixgbe_free_rx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
364extern void ixgbe_free_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *); 414extern void ixgbe_free_tx_resources(struct ixgbe_adapter *, struct ixgbe_ring *);
365extern void ixgbe_update_stats(struct ixgbe_adapter *adapter); 415extern void ixgbe_update_stats(struct ixgbe_adapter *adapter);
366extern void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter);
367extern int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter); 416extern int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);
368void ixgbe_napi_add_all(struct ixgbe_adapter *adapter); 417extern void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter);
369void ixgbe_napi_del_all(struct ixgbe_adapter *adapter); 418extern void ixgbe_write_eitr(struct ixgbe_q_vector *);
370extern void ixgbe_write_eitr(struct ixgbe_adapter *, int, u32); 419extern int ethtool_ioctl(struct ifreq *ifr);
420extern s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw);
421extern s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc);
422extern s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc);
423extern s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
424 struct ixgbe_atr_input *input,
425 u8 queue);
426extern s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
427 struct ixgbe_atr_input *input,
428 u16 soft_id,
429 u8 queue);
430extern u16 ixgbe_atr_compute_hash_82599(struct ixgbe_atr_input *input, u32 key);
431extern s32 ixgbe_atr_set_vlan_id_82599(struct ixgbe_atr_input *input,
432 u16 vlan_id);
433extern s32 ixgbe_atr_set_src_ipv4_82599(struct ixgbe_atr_input *input,
434 u32 src_addr);
435extern s32 ixgbe_atr_set_dst_ipv4_82599(struct ixgbe_atr_input *input,
436 u32 dst_addr);
437extern s32 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input,
438 u32 src_addr_1, u32 src_addr_2,
439 u32 src_addr_3, u32 src_addr_4);
440extern s32 ixgbe_atr_set_dst_ipv6_82599(struct ixgbe_atr_input *input,
441 u32 dst_addr_1, u32 dst_addr_2,
442 u32 dst_addr_3, u32 dst_addr_4);
443extern s32 ixgbe_atr_set_src_port_82599(struct ixgbe_atr_input *input,
444 u16 src_port);
445extern s32 ixgbe_atr_set_dst_port_82599(struct ixgbe_atr_input *input,
446 u16 dst_port);
447extern s32 ixgbe_atr_set_flex_byte_82599(struct ixgbe_atr_input *input,
448 u16 flex_byte);
449extern s32 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input,
450 u8 vm_pool);
451extern s32 ixgbe_atr_set_l4type_82599(struct ixgbe_atr_input *input,
452 u8 l4type);
453extern s32 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input,
454 u16 *vlan_id);
455extern s32 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input,
456 u32 *src_addr);
457extern s32 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input,
458 u32 *dst_addr);
459extern s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
460 u32 *src_addr_1, u32 *src_addr_2,
461 u32 *src_addr_3, u32 *src_addr_4);
462extern s32 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input,
463 u32 *dst_addr_1, u32 *dst_addr_2,
464 u32 *dst_addr_3, u32 *dst_addr_4);
465extern s32 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input,
466 u16 *src_port);
467extern s32 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input,
468 u16 *dst_port);
469extern s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input,
470 u16 *flex_byte);
471extern s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input,
472 u8 *vm_pool);
473extern s32 ixgbe_atr_get_l4type_82599(struct ixgbe_atr_input *input,
474 u8 *l4type);
475#ifdef IXGBE_FCOE
476extern void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter);
477extern int ixgbe_fso(struct ixgbe_adapter *adapter,
478 struct ixgbe_ring *tx_ring, struct sk_buff *skb,
479 u32 tx_flags, u8 *hdr_len);
480extern void ixgbe_cleanup_fcoe(struct ixgbe_adapter *adapter);
481extern int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
482 union ixgbe_adv_rx_desc *rx_desc,
483 struct sk_buff *skb);
484extern int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid,
485 struct scatterlist *sgl, unsigned int sgc);
486extern int ixgbe_fcoe_ddp_put(struct net_device *netdev, u16 xid);
487#endif /* IXGBE_FCOE */
371 488
372#endif /* _IXGBE_H_ */ 489#endif /* _IXGBE_H_ */