FD.io VPP  v21.06-3-gbb25fbf28
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_create_flag_t { AF_XDP_CREATE_FLAGS_NO_SYSCALL_LOCK = 1 }
 
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)
 
void af_xdp_device_input_refill (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 at line 45 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") \
_ (3, LINK_UP, "link-up") \
_ (4, ZEROCOPY, "zero-copy") \
_ (5, SYSCALL_LOCK, "syscall-lock")

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") \
_ (SYSCALL_REQUIRED, "syscall required") \
_ (SYSCALL_FAILURES, "syscall failures")

Definition at line 186 of file af_xdp.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
foreach_af_xdp_device_flags 

Definition at line 38 of file af_xdp.h.

◆ af_xdp_create_flag_t

Enumerator
AF_XDP_CREATE_FLAGS_NO_SYSCALL_LOCK 

Definition at line 142 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 135 of file af_xdp.h.

◆ af_xdp_tx_func_error_t

Enumerator
AF_XDP_TX_N_ERROR 

Definition at line 191 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 365 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 90 of file device.c.

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

◆ af_xdp_device_input_refill()

void af_xdp_device_input_refill ( af_xdp_device_t ad)

Definition at line 347 of file input.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 357 of file input.c.

◆ af_xdp_main

af_xdp_main_t af_xdp_main

Definition at line 31 of file device.c.

◆ format_af_xdp_device

format_function_t format_af_xdp_device

Definition at line 173 of file af_xdp.h.

◆ format_af_xdp_device_name

format_function_t format_af_xdp_device_name

Definition at line 174 of file af_xdp.h.

◆ format_af_xdp_input_trace

format_function_t format_af_xdp_input_trace

Definition at line 175 of file af_xdp.h.

◆ unformat_af_xdp_create_if_args

unformat_function_t unformat_af_xdp_create_if_args

Definition at line 178 of file af_xdp.h.

error
Definition: cJSON.c:88
fmt
int cJSON_bool fmt
Definition: cJSON.h:160
clib_error_return_unix
#define clib_error_return_unix(e, args...)
Definition: error.h:102
clib_atomic_bool_cmp_and_swap
#define clib_atomic_bool_cmp_and_swap(addr, old, new)
Definition: atomics.h:38