FD.io VPP  v20.01-48-g3e0dafb74
Vector Packet Processing
af_packet.c File Reference
+ Include dependency graph for af_packet.c:

Go to the source code of this file.

Macros

#define AF_PACKET_TX_FRAMES_PER_BLOCK   1024
 
#define AF_PACKET_TX_FRAME_SIZE   (2048 * 5)
 
#define AF_PACKET_TX_BLOCK_NR   1
 
#define AF_PACKET_TX_FRAME_NR
 
#define AF_PACKET_TX_BLOCK_SIZE
 
#define AF_PACKET_RX_FRAMES_PER_BLOCK   1024
 
#define AF_PACKET_RX_FRAME_SIZE   (2048 * 5)
 
#define AF_PACKET_RX_BLOCK_NR   1
 
#define AF_PACKET_RX_FRAME_NR
 
#define AF_PACKET_RX_BLOCK_SIZE
 

Typedefs

typedef struct tpacket_req tpacket_req_t
 

Functions

unsigned int if_nametoindex (const char *ifname)
 
static u32 af_packet_eth_flag_change (vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags)
 
static clib_error_taf_packet_fd_read_ready (clib_file_t *uf)
 
static int is_bridge (const u8 *host_if_name)
 
static int create_packet_v2_sock (int host_if_index, tpacket_req_t *rx_req, tpacket_req_t *tx_req, int *fd, u8 **ring)
 
int af_packet_create_if (vlib_main_t *vm, u8 *host_if_name, u8 *hw_addr_set, u32 *sw_if_index)
 
int af_packet_delete_if (vlib_main_t *vm, u8 *host_if_name)
 
int af_packet_set_l4_cksum_offload (vlib_main_t *vm, u32 sw_if_index, u8 set)
 
int af_packet_dump_ifs (af_packet_if_detail_t **out_af_packet_ifs)
 
static clib_error_taf_packet_init (vlib_main_t *vm)
 

Variables

af_packet_main_t af_packet_main
 

Macro Definition Documentation

◆ AF_PACKET_RX_BLOCK_NR

#define AF_PACKET_RX_BLOCK_NR   1

Definition at line 49 of file af_packet.c.

◆ AF_PACKET_RX_BLOCK_SIZE

#define AF_PACKET_RX_BLOCK_SIZE
Value:
AF_PACKET_RX_FRAMES_PER_BLOCK)
#define AF_PACKET_RX_FRAME_SIZE
Definition: af_packet.c:48

Definition at line 52 of file af_packet.c.

◆ AF_PACKET_RX_FRAME_NR

#define AF_PACKET_RX_FRAME_NR
Value:
AF_PACKET_RX_FRAMES_PER_BLOCK)
#define AF_PACKET_RX_BLOCK_NR
Definition: af_packet.c:49

Definition at line 50 of file af_packet.c.

◆ AF_PACKET_RX_FRAME_SIZE

#define AF_PACKET_RX_FRAME_SIZE   (2048 * 5)

Definition at line 48 of file af_packet.c.

◆ AF_PACKET_RX_FRAMES_PER_BLOCK

#define AF_PACKET_RX_FRAMES_PER_BLOCK   1024

Definition at line 47 of file af_packet.c.

◆ AF_PACKET_TX_BLOCK_NR

#define AF_PACKET_TX_BLOCK_NR   1

Definition at line 41 of file af_packet.c.

◆ AF_PACKET_TX_BLOCK_SIZE

#define AF_PACKET_TX_BLOCK_SIZE
Value:
AF_PACKET_TX_FRAMES_PER_BLOCK)
#define AF_PACKET_TX_FRAME_SIZE
Definition: af_packet.c:40

Definition at line 44 of file af_packet.c.

◆ AF_PACKET_TX_FRAME_NR

#define AF_PACKET_TX_FRAME_NR
Value:
AF_PACKET_TX_FRAMES_PER_BLOCK)
#define AF_PACKET_TX_BLOCK_NR
Definition: af_packet.c:41

Definition at line 42 of file af_packet.c.

◆ AF_PACKET_TX_FRAME_SIZE

#define AF_PACKET_TX_FRAME_SIZE   (2048 * 5)

Definition at line 40 of file af_packet.c.

◆ AF_PACKET_TX_FRAMES_PER_BLOCK

#define AF_PACKET_TX_FRAMES_PER_BLOCK   1024

Definition at line 39 of file af_packet.c.

Typedef Documentation

◆ tpacket_req_t

typedef struct tpacket_req tpacket_req_t

Definition at line 58 of file af_packet.c.

Function Documentation

◆ af_packet_create_if()

int af_packet_create_if ( vlib_main_t vm,
u8 host_if_name,
u8 hw_addr_set,
u32 sw_if_index 
)

Definition at line 220 of file af_packet.c.

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

◆ af_packet_delete_if()

int af_packet_delete_if ( vlib_main_t vm,
u8 host_if_name 
)

Definition at line 421 of file af_packet.c.

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

◆ af_packet_dump_ifs()

int af_packet_dump_ifs ( af_packet_if_detail_t **  out_af_packet_ifs)

Definition at line 501 of file af_packet.c.

+ Here is the caller graph for this function:

◆ af_packet_eth_flag_change()

static u32 af_packet_eth_flag_change ( vnet_main_t vnm,
vnet_hw_interface_t hi,
u32  flags 
)
static

Definition at line 61 of file af_packet.c.

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

◆ af_packet_fd_read_ready()

static clib_error_t* af_packet_fd_read_ready ( clib_file_t uf)
static

Definition at line 91 of file af_packet.c.

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

◆ af_packet_init()

static clib_error_t* af_packet_init ( vlib_main_t vm)
static

Definition at line 528 of file af_packet.c.

+ Here is the call graph for this function:

◆ af_packet_set_l4_cksum_offload()

int af_packet_set_l4_cksum_offload ( vlib_main_t vm,
u32  sw_if_index,
u8  set 
)

Definition at line 482 of file af_packet.c.

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

◆ create_packet_v2_sock()

static int create_packet_v2_sock ( int  host_if_index,
tpacket_req_t rx_req,
tpacket_req_t tx_req,
int *  fd,
u8 **  ring 
)
static

Definition at line 127 of file af_packet.c.

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

◆ if_nametoindex()

unsigned int if_nametoindex ( const char *  ifname)
+ Here is the caller graph for this function:

◆ is_bridge()

static int is_bridge ( const u8 host_if_name)
static

Definition at line 108 of file af_packet.c.

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

Variable Documentation

◆ af_packet_main

af_packet_main_t af_packet_main

Definition at line 37 of file af_packet.c.