FD.io VPP  v21.01.1
Vector Packet Processing
af_xdp.h File Reference
+ Include dependency graph for af_xdp.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  af_xdp_rxq_t
 
struct  af_xdp_txq_t
 
struct  af_xdp_device_t
 
struct  af_xdp_main_t
 
struct  af_xdp_create_if_args_t
 
struct  af_xdp_input_trace_t
 

Macros

#define AF_XDP_NUM_RX_QUEUES_ALL   ((u16)-1)
 
#define af_xdp_log(lvl, dev, f, ...)   vlib_log(lvl, af_xdp_main.log_class, "%v: " f, (dev)->name, ##__VA_ARGS__)
 
#define foreach_af_xdp_device_flags
 
#define af_xdp_device_error(dev, fmt, ...)
 
#define foreach_af_xdp_tx_func_error
 

Enumerations

enum  { foreach_af_xdp_device_flags }
 
enum  af_xdp_mode_t { AF_XDP_MODE_AUTO = 0, AF_XDP_MODE_COPY = 1, AF_XDP_MODE_ZERO_COPY = 2 }
 
enum  af_xdp_tx_func_error_t { AF_XDP_TX_N_ERROR }
 

Functions

void af_xdp_create_if (vlib_main_t *vm, af_xdp_create_if_args_t *args)
 
void af_xdp_delete_if (vlib_main_t *vm, af_xdp_device_t *ad)
 

Variables

af_xdp_main_t af_xdp_main
 
vlib_node_registration_t af_xdp_input_node
 (constructor) VLIB_REGISTER_NODE (af_xdp_input_node) More...
 
vnet_device_class_t af_xdp_device_class
 
format_function_t format_af_xdp_device
 
format_function_t format_af_xdp_device_name
 
format_function_t format_af_xdp_input_trace
 
unformat_function_t unformat_af_xdp_create_if_args
 

Macro Definition Documentation

◆ af_xdp_device_error

#define af_xdp_device_error (   dev,
  fmt,
  ... 
)
Value:
if (!(dev)->error) \
{ \
clib_error_t *err_ = clib_error_return_unix (0, fmt, ## __VA_ARGS__); \
if (!clib_atomic_bool_cmp_and_swap (&(dev)->error, 0, err_)) \
clib_error_free(err_); \
}
Definition: cJSON.c:84
#define clib_error_return_unix(e, args...)
Definition: error.h:102
int cJSON_bool fmt
Definition: cJSON.h:160
#define clib_atomic_bool_cmp_and_swap(addr, old, new)
Definition: atomics.h:38

Definition at line 44 of file af_xdp.h.

◆ af_xdp_log

#define af_xdp_log (   lvl,
  dev,
  f,
  ... 
)    vlib_log(lvl, af_xdp_main.log_class, "%v: " f, (dev)->name, ##__VA_ARGS__)

Definition at line 27 of file af_xdp.h.

◆ AF_XDP_NUM_RX_QUEUES_ALL

#define AF_XDP_NUM_RX_QUEUES_ALL   ((u16)-1)

Definition at line 25 of file af_xdp.h.

◆ foreach_af_xdp_device_flags

#define foreach_af_xdp_device_flags
Value:
_(0, INITIALIZED, "initialized") \
_(1, ERROR, "error") \
_(2, ADMIN_UP, "admin-up") \
_(4, LINK_UP, "link-up") \
_(8, ZEROCOPY, "zero-copy") \

Definition at line 30 of file af_xdp.h.

◆ foreach_af_xdp_tx_func_error

#define foreach_af_xdp_tx_func_error
Value:
_(NO_FREE_SLOTS, "no free tx slots") \
_(SENDTO_REQUIRED, "sendto required") \
_(SENDTO_FAILURES, "sendto failures")

Definition at line 164 of file af_xdp.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
foreach_af_xdp_device_flags 

Definition at line 37 of file af_xdp.h.

◆ af_xdp_mode_t

Enumerator
AF_XDP_MODE_AUTO 
AF_XDP_MODE_COPY 
AF_XDP_MODE_ZERO_COPY 

Definition at line 121 of file af_xdp.h.

◆ af_xdp_tx_func_error_t

Enumerator
AF_XDP_TX_N_ERROR 

Definition at line 169 of file af_xdp.h.

Function Documentation

◆ af_xdp_create_if()

void af_xdp_create_if ( vlib_main_t vm,
af_xdp_create_if_args_t args 
)

Definition at line 305 of file device.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ af_xdp_delete_if()

void af_xdp_delete_if ( vlib_main_t vm,
af_xdp_device_t ad 
)

Definition at line 89 of file device.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ af_xdp_device_class

vnet_device_class_t af_xdp_device_class

◆ af_xdp_input_node

vlib_node_registration_t af_xdp_input_node

(constructor) VLIB_REGISTER_NODE (af_xdp_input_node)

Definition at line 349 of file input.c.

◆ af_xdp_main

af_xdp_main_t af_xdp_main

Definition at line 30 of file device.c.

◆ format_af_xdp_device

format_function_t format_af_xdp_device

Definition at line 151 of file af_xdp.h.

◆ format_af_xdp_device_name

format_function_t format_af_xdp_device_name

Definition at line 152 of file af_xdp.h.

◆ format_af_xdp_input_trace

format_function_t format_af_xdp_input_trace

Definition at line 153 of file af_xdp.h.

◆ unformat_af_xdp_create_if_args

unformat_function_t unformat_af_xdp_create_if_args

Definition at line 156 of file af_xdp.h.