FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
ixge.c File Reference
+ Include dependency graph for ixge.c:

Go to the source code of this file.

Data Structures

struct  ixge_rx_dma_trace_t
 
struct  ixge_tx_dma_trace_t
 
struct  ixge_tx_state_t
 

Macros

#define IXGE_ALWAYS_POLL   0
 
#define EVENT_SET_FLAGS   0
 
#define IXGE_HWBP_RACE_ELOG   0
 
#define PCI_VENDOR_ID_INTEL   0x8086
 
#define XGE_PHY_DEV_TYPE_PMA_PMD   1
 
#define XGE_PHY_DEV_TYPE_PHY_XS   4
 
#define XGE_PHY_ID1   0x2
 
#define XGE_PHY_ID2   0x3
 
#define XGE_PHY_CONTROL   0x0
 
#define XGE_PHY_CONTROL_RESET   (1 << 15)
 
#define foreach_ixge_error
 
#define IXGE_COUNTER_IS_64_BIT   (1 << 0)
 
#define IXGE_COUNTER_NOT_CLEAR_ON_READ   (1 << 1)
 
#define IXGE_N_BYTES_IN_RX_BUFFER   (2048)
 

Typedefs

typedef unsigned long long u32x4
 

Enumerations

enum  ixge_error_t { IXGE_N_ERROR }
 

Functions

static void ixge_semaphore_get (ixge_device_t *xd)
 
static void ixge_semaphore_release (ixge_device_t *xd)
 
static void ixge_software_firmware_sync (ixge_device_t *xd, u32 sw_mask)
 
static void ixge_software_firmware_sync_release (ixge_device_t *xd, u32 sw_mask)
 
u32 ixge_read_write_phy_reg (ixge_device_t *xd, u32 dev_type, u32 reg_index, u32 v, u32 is_read)
 
static u32 ixge_read_phy_reg (ixge_device_t *xd, u32 dev_type, u32 reg_index)
 
static void ixge_write_phy_reg (ixge_device_t *xd, u32 dev_type, u32 reg_index, u32 v)
 
static void ixge_i2c_put_bits (i2c_bus_t *b, int scl, int sda)
 
static void ixge_i2c_get_bits (i2c_bus_t *b, int *scl, int *sda)
 
static u16 ixge_read_eeprom (ixge_device_t *xd, u32 address)
 
static void ixge_sfp_enable_disable_laser (ixge_device_t *xd, uword enable)
 
static void ixge_sfp_enable_disable_10g (ixge_device_t *xd, uword enable)
 
static clib_error_tixge_sfp_phy_init_from_eeprom (ixge_device_t *xd, u16 sfp_type)
 
static void ixge_sfp_device_up_down (ixge_device_t *xd, uword is_up)
 
static ixge_dma_regs_tget_dma_regs (ixge_device_t *xd, vlib_rx_or_tx_t rt, u32 qi)
 
static clib_error_tixge_interface_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static void ixge_sfp_phy_init (ixge_device_t *xd)
 
static void ixge_phy_init (ixge_device_t *xd)
 
static u8format_ixge_rx_from_hw_descriptor (u8 *s, va_list *va)
 
static u8format_ixge_tx_descriptor (u8 *s, va_list *va)
 
static u8format_ixge_rx_dma_trace (u8 *s, va_list *va)
 
static void ixge_rx_next_and_error_from_status_x1 (ixge_device_t *xd, u32 s00, u32 s02, u8 *next0, u8 *error0, u32 *flags0)
 
static void ixge_rx_next_and_error_from_status_x2 (ixge_device_t *xd, u32 s00, u32 s02, u32 s10, u32 s12, u8 *next0, u8 *error0, u32 *flags0, u8 *next1, u8 *error1, u32 *flags1)
 
static void ixge_rx_trace (ixge_main_t *xm, ixge_device_t *xd, ixge_dma_queue_t *dq, ixge_descriptor_t *before_descriptors, u32 *before_buffers, ixge_descriptor_t *after_descriptors, uword n_descriptors)
 
static u8format_ixge_tx_dma_trace (u8 *s, va_list *va)
 
static void ixge_tx_trace (ixge_main_t *xm, ixge_device_t *xd, ixge_dma_queue_t *dq, ixge_tx_state_t *tx_state, ixge_tx_descriptor_t *descriptors, u32 *buffers, uword n_descriptors)
 
static uword ixge_ring_sub (ixge_dma_queue_t *q, u32 i0, u32 i1)
 
static uword ixge_ring_add (ixge_dma_queue_t *q, u32 i0, u32 i1)
 
static uword ixge_tx_descriptor_matches_template (ixge_main_t *xm, ixge_tx_descriptor_t *d)
 
static uword ixge_tx_no_wrap (ixge_main_t *xm, ixge_device_t *xd, ixge_dma_queue_t *dq, u32 *buffers, u32 start_descriptor_index, u32 n_descriptors, ixge_tx_state_t *tx_state)
 
static uword ixge_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static uword ixge_rx_queue_no_wrap (ixge_main_t *xm, ixge_device_t *xd, ixge_dma_queue_t *dq, u32 start_descriptor_index, u32 n_descriptors)
 
static uword ixge_rx_queue (ixge_main_t *xm, ixge_device_t *xd, vlib_node_runtime_t *node, u32 queue_index)
 
static void ixge_interrupt (ixge_main_t *xm, ixge_device_t *xd, u32 i)
 
static u32 clean_block (u32 *b, u32 *t, u32 n_left)
 
static void ixge_tx_queue (ixge_main_t *xm, ixge_device_t *xd, u32 queue_index)
 
static uword ixge_interrupt_is_rx_queue (uword i)
 
static uword ixge_interrupt_is_tx_queue (uword i)
 
static uword ixge_tx_queue_to_interrupt (uword i)
 
static uword ixge_rx_queue_to_interrupt (uword i)
 
static uword ixge_interrupt_rx_queue (uword i)
 
static uword ixge_interrupt_tx_queue (uword i)
 
static uword ixge_device_input (ixge_main_t *xm, ixge_device_t *xd, vlib_node_runtime_t *node)
 
static uword ixge_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static u8format_ixge_device_name (u8 *s, va_list *args)
 
static void ixge_update_counters (ixge_device_t *xd)
 
static u8format_ixge_device_id (u8 *s, va_list *args)
 
static u8format_ixge_link_status (u8 *s, va_list *args)
 
static u8format_ixge_device (u8 *s, va_list *args)
 
static void ixge_clear_hw_interface_counters (u32 instance)
 
static void ixge_set_interface_next_node (vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
 
 VNET_DEVICE_CLASS (ixge_device_class)
 
static clib_error_tixge_dma_init (ixge_device_t *xd, vlib_rx_or_tx_t rt, u32 queue_index)
 
static u32 ixge_flag_change (vnet_main_t *vnm, vnet_hw_interface_t *hw, u32 flags)
 
static void ixge_device_init (ixge_main_t *xm)
 
static uword ixge_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
clib_error_tixge_init (vlib_main_t *vm)
 
static void ixge_pci_intr_handler (vlib_pci_device_t *dev)
 
static clib_error_tixge_pci_init (vlib_main_t *vm, vlib_pci_device_t *dev)
 
 PCI_REGISTER_DEVICE (ixge_pci_device_registration, static)
 
void ixge_set_next_node (ixge_rx_next_t next, char *name)
 

Variables

ixge_main_t ixge_main
 
static vlib_node_registration_t ixge_input_node
 (constructor) VLIB_REGISTER_NODE (ixge_input_node) More...
 
static vlib_node_registration_t ixge_process_node
 
static char * ixge_error_strings []
 
static u8 ixge_counter_flags []
 

Macro Definition Documentation

#define EVENT_SET_FLAGS   0

Definition at line 40 of file ixge.c.

#define foreach_ixge_error
Value:
_ (none, "no error") \
_ (tx_full_drops, "tx ring full drops") \
_ (ip4_checksum_error, "ip4 checksum errors") \
_ (rx_alloc_fail, "rx buf alloc from free list failed") \
_ (rx_alloc_no_physmem, "rx buf alloc failed no physmem")

Definition at line 614 of file ixge.c.

#define IXGE_ALWAYS_POLL   0

Definition at line 38 of file ixge.c.

#define IXGE_COUNTER_IS_64_BIT   (1 << 0)

Definition at line 2258 of file ixge.c.

#define IXGE_COUNTER_NOT_CLEAR_ON_READ   (1 << 1)

Definition at line 2259 of file ixge.c.

#define IXGE_HWBP_RACE_ELOG   0

Definition at line 41 of file ixge.c.

#define IXGE_N_BYTES_IN_RX_BUFFER   (2048)

Definition at line 2458 of file ixge.c.

#define PCI_VENDOR_ID_INTEL   0x8086

Definition at line 43 of file ixge.c.

#define XGE_PHY_CONTROL   0x0

Definition at line 50 of file ixge.c.

#define XGE_PHY_CONTROL_RESET   (1 << 15)

Definition at line 51 of file ixge.c.

#define XGE_PHY_DEV_TYPE_PHY_XS   4

Definition at line 47 of file ixge.c.

#define XGE_PHY_DEV_TYPE_PMA_PMD   1

Definition at line 46 of file ixge.c.

#define XGE_PHY_ID1   0x2

Definition at line 48 of file ixge.c.

#define XGE_PHY_ID2   0x3

Definition at line 49 of file ixge.c.

Typedef Documentation

typedef unsigned long long u32x4

Definition at line 28 of file ixge.c.

Enumeration Type Documentation

Enumerator
IXGE_N_ERROR 

Definition at line 621 of file ixge.c.

Function Documentation

static u32 clean_block ( u32 b,
u32 t,
u32  n_left 
)
inlinestatic

Definition at line 1956 of file ixge.c.

+ Here is the caller graph for this function:

static u8* format_ixge_device ( u8 s,
va_list *  args 
)
static

Definition at line 2338 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ixge_device_id ( u8 s,
va_list *  args 
)
static

Definition at line 2295 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ixge_device_name ( u8 s,
va_list *  args 
)
static

Definition at line 2249 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ixge_link_status ( u8 s,
va_list *  args 
)
static

Definition at line 2316 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ixge_rx_dma_trace ( u8 s,
va_list *  va 
)
static

Definition at line 574 of file ixge.c.

+ Here is the call graph for this function:

static u8* format_ixge_rx_from_hw_descriptor ( u8 s,
va_list *  va 
)
static

Definition at line 443 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ixge_tx_descriptor ( u8 s,
va_list *  va 
)
static

Definition at line 514 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_ixge_tx_dma_trace ( u8 s,
va_list *  va 
)
static

Definition at line 861 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ixge_dma_regs_t* get_dma_regs ( ixge_device_t xd,
vlib_rx_or_tx_t  rt,
u32  qi 
)
inlinestatic

Definition at line 308 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_clear_hw_interface_counters ( u32  instance)
static

Definition at line 2413 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_device_init ( ixge_main_t xm)
static

Definition at line 2624 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_device_input ( ixge_main_t xm,
ixge_device_t xd,
vlib_node_runtime_t node 
)
static

Definition at line 2144 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ixge_dma_init ( ixge_device_t xd,
vlib_rx_or_tx_t  rt,
u32  queue_index 
)
static

Definition at line 2461 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ixge_flag_change ( vnet_main_t vnm,
vnet_hw_interface_t hw,
u32  flags 
)
static

Definition at line 2603 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_i2c_get_bits ( i2c_bus_t b,
int *  scl,
int *  sda 
)
static

Definition at line 182 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_i2c_put_bits ( i2c_bus_t b,
int  scl,
int  sda 
)
static

Definition at line 169 of file ixge.c.

+ Here is the caller graph for this function:

clib_error_t* ixge_init ( vlib_main_t vm)

Definition at line 2796 of file ixge.c.

+ Here is the call graph for this function:

static uword ixge_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 2172 of file ixge.c.

+ Here is the call graph for this function:

static clib_error_t* ixge_interface_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 319 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_interface_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 1201 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_interrupt ( ixge_main_t xm,
ixge_device_t xd,
u32  i 
)
static

Definition at line 1896 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_interrupt_is_rx_queue ( uword  i)
inlinestatic

Definition at line 2106 of file ixge.c.

+ Here is the caller graph for this function:

static uword ixge_interrupt_is_tx_queue ( uword  i)
inlinestatic

Definition at line 2112 of file ixge.c.

+ Here is the caller graph for this function:

static uword ixge_interrupt_rx_queue ( uword  i)
inlinestatic

Definition at line 2130 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_interrupt_tx_queue ( uword  i)
inlinestatic

Definition at line 2137 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ixge_pci_init ( vlib_main_t vm,
vlib_pci_device_t dev 
)
static

Definition at line 2844 of file ixge.c.

+ Here is the call graph for this function:

static void ixge_pci_intr_handler ( vlib_pci_device_t dev)
static

Definition at line 2828 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_phy_init ( ixge_device_t xd)
static

Definition at line 374 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 2713 of file ixge.c.

+ Here is the call graph for this function:

static u16 ixge_read_eeprom ( ixge_device_t xd,
u32  address 
)
static

Definition at line 194 of file ixge.c.

+ Here is the caller graph for this function:

static u32 ixge_read_phy_reg ( ixge_device_t xd,
u32  dev_type,
u32  reg_index 
)
static

Definition at line 155 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 ixge_read_write_phy_reg ( ixge_device_t xd,
u32  dev_type,
u32  reg_index,
u32  v,
u32  is_read 
)

Definition at line 118 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_ring_add ( ixge_dma_queue_t q,
u32  i0,
u32  i1 
)
inlinestatic

Definition at line 1005 of file ixge.c.

+ Here is the caller graph for this function:

static uword ixge_ring_sub ( ixge_dma_queue_t q,
u32  i0,
u32  i1 
)
inlinestatic

Definition at line 996 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_rx_next_and_error_from_status_x1 ( ixge_device_t xd,
u32  s00,
u32  s02,
u8 next0,
u8 error0,
u32 flags0 
)
inlinestatic

Definition at line 630 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_rx_next_and_error_from_status_x2 ( ixge_device_t xd,
u32  s00,
u32  s02,
u32  s10,
u32  s12,
u8 next0,
u8 error0,
u32 flags0,
u8 next1,
u8 error1,
u32 flags1 
)
inlinestatic

Definition at line 669 of file ixge.c.

+ Here is the caller graph for this function:

static uword ixge_rx_queue ( ixge_main_t xm,
ixge_device_t xd,
vlib_node_runtime_t node,
u32  queue_index 
)
static

Definition at line 1823 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_rx_queue_no_wrap ( ixge_main_t xm,
ixge_device_t xd,
ixge_dma_queue_t dq,
u32  start_descriptor_index,
u32  n_descriptors 
)
static

Definition at line 1343 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_rx_queue_to_interrupt ( uword  i)
inlinestatic

Definition at line 2124 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_rx_trace ( ixge_main_t xm,
ixge_device_t xd,
ixge_dma_queue_t dq,
ixge_descriptor_t before_descriptors,
u32 before_buffers,
ixge_descriptor_t after_descriptors,
uword  n_descriptors 
)
static

Definition at line 733 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_semaphore_get ( ixge_device_t xd)
static

Definition at line 58 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_semaphore_release ( ixge_device_t xd)
static

Definition at line 80 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_set_interface_next_node ( vnet_main_t vnm,
u32  hw_if_index,
u32  node_index 
)
static

Definition at line 2426 of file ixge.c.

+ Here is the call graph for this function:

void ixge_set_next_node ( ixge_rx_next_t  next,
char *  name 
)

Definition at line 2912 of file ixge.c.

static void ixge_sfp_device_up_down ( ixge_device_t xd,
uword  is_up 
)
static

Definition at line 265 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_sfp_enable_disable_10g ( ixge_device_t xd,
uword  enable 
)
static

Definition at line 216 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_sfp_enable_disable_laser ( ixge_device_t xd,
uword  enable 
)
static

Definition at line 206 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_sfp_phy_init ( ixge_device_t xd)
static

Definition at line 347 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ixge_sfp_phy_init_from_eeprom ( ixge_device_t xd,
u16  sfp_type 
)
static

Definition at line 226 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_software_firmware_sync ( ixge_device_t xd,
u32  sw_mask 
)
static

Definition at line 87 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_software_firmware_sync_release ( ixge_device_t xd,
u32  sw_mask 
)
static

Definition at line 109 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_tx_descriptor_matches_template ( ixge_main_t xm,
ixge_tx_descriptor_t d 
)
inlinestatic

Definition at line 1015 of file ixge.c.

+ Here is the caller graph for this function:

static uword ixge_tx_no_wrap ( ixge_main_t xm,
ixge_device_t xd,
ixge_dma_queue_t dq,
u32 buffers,
u32  start_descriptor_index,
u32  n_descriptors,
ixge_tx_state_t tx_state 
)
static

Definition at line 1033 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_tx_queue ( ixge_main_t xm,
ixge_device_t xd,
u32  queue_index 
)
static

Definition at line 1999 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ixge_tx_queue_to_interrupt ( uword  i)
inlinestatic

Definition at line 2118 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_tx_trace ( ixge_main_t xm,
ixge_device_t xd,
ixge_dma_queue_t dq,
ixge_tx_state_t tx_state,
ixge_tx_descriptor_t descriptors,
u32 buffers,
uword  n_descriptors 
)
static

Definition at line 910 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ixge_update_counters ( ixge_device_t xd)
static

Definition at line 2270 of file ixge.c.

+ Here is the caller graph for this function:

static void ixge_write_phy_reg ( ixge_device_t xd,
u32  dev_type,
u32  reg_index,
u32  v 
)
static

Definition at line 162 of file ixge.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PCI_REGISTER_DEVICE ( ixge_pci_device_registration  ,
static   
)

+ Here is the caller graph for this function:

VNET_DEVICE_CLASS ( ixge_device_class  )

+ Here is the caller graph for this function:

Variable Documentation

u8 ixge_counter_flags[]
static
Initial value:
= {
#define _(a,f)
#define _64(a,f)
}
#define foreach_ixge_counter
Definition: ixge.h:1016

Definition at line 2261 of file ixge.c.

char* ixge_error_strings[]
static
Initial value:
= {
#define _(n,s)
}
#define foreach_ixge_error
Definition: ixge.c:614

Definition at line 2214 of file ixge.c.

static vlib_node_registration_t ixge_input_node
static
Initial value:
= {
.function = ixge_input,
.name = "ixge-input",
.state = VLIB_NODE_STATE_DISABLED,
.format_trace = format_ixge_rx_dma_trace,
.n_errors = IXGE_N_ERROR,
.error_strings = ixge_error_strings,
.n_next_nodes = IXGE_RX_N_NEXT,
.next_nodes = {
[IXGE_RX_NEXT_DROP] = "error-drop",
[IXGE_RX_NEXT_ETHERNET_INPUT] = "ethernet-input",
[IXGE_RX_NEXT_IP4_INPUT] = "ip4-input",
[IXGE_RX_NEXT_IP6_INPUT] = "ip6-input",
},
}
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
Definition: format.c:115
static u8 * format_ixge_rx_dma_trace(u8 *s, va_list *va)
Definition: ixge.c:574
static char * ixge_error_strings[]
Definition: ixge.c:2214
static uword ixge_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Definition: ixge.c:2172

(constructor) VLIB_REGISTER_NODE (ixge_input_node)

Definition at line 54 of file ixge.c.

ixge_main_t ixge_main

Definition at line 53 of file ixge.c.

static vlib_node_registration_t ixge_process_node
static
Initial value:
= {
.function = ixge_process,
.name = "ixge-process",
}
static uword ixge_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: ixge.c:2713

Definition at line 55 of file ixge.c.