FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  gso_trace_t
 

Macros

#define foreach_gso_error
 

Enumerations

enum  gso_error_t { GSO_N_ERROR }
 
enum  gso_next_t { GSO_NEXT_DROP, GSO_N_NEXT }
 

Functions

static u8format_gso_trace (u8 *s, va_list *args)
 
static_always_inline u16 tso_segment_ipip_tunnel_fixup (vlib_main_t *vm, vnet_interface_per_thread_data_t *ptd, vlib_buffer_t *sb0, generic_header_offset_t *gho)
 
static_always_inline void tso_segment_vxlan_tunnel_headers_fixup (vlib_main_t *vm, vlib_buffer_t *b, generic_header_offset_t *gho)
 
static_always_inline u16 tso_segment_vxlan_tunnel_fixup (vlib_main_t *vm, vnet_interface_per_thread_data_t *ptd, vlib_buffer_t *sb0, generic_header_offset_t *gho)
 
static_always_inline u16 tso_alloc_tx_bufs (vlib_main_t *vm, vnet_interface_per_thread_data_t *ptd, vlib_buffer_t *b0, u32 n_bytes_b0, u16 l234_sz, u16 gso_size, u16 first_data_size, generic_header_offset_t *gho)
 
static_always_inline void tso_init_buf_from_template_base (vlib_buffer_t *nb0, vlib_buffer_t *b0, u32 flags, u16 length)
 
static_always_inline void tso_init_buf_from_template (vlib_main_t *vm, vlib_buffer_t *nb0, vlib_buffer_t *b0, u16 template_data_sz, u16 gso_size, u8 **p_dst_ptr, u16 *p_dst_left, u32 next_tcp_seq, u32 flags, generic_header_offset_t *gho)
 
static_always_inline void tso_fixup_segmented_buf (vlib_main_t *vm, vlib_buffer_t *b0, u8 tcp_flags, int is_l2, int is_ip6, generic_header_offset_t *gho)
 
static_always_inline u32 tso_segment_buffer (vlib_main_t *vm, vnet_interface_per_thread_data_t *ptd, u32 sbi0, vlib_buffer_t *sb0, generic_header_offset_t *gho, u32 n_bytes_b0, int is_l2, int is_ip6)
 Allocate the necessary number of ptd->split_buffers, and segment the possibly chained buffer(s) from b0 into there. More...
 
static_always_inline void drop_one_buffer_and_count (vlib_main_t *vm, vnet_main_t *vnm, vlib_node_runtime_t *node, u32 *pbi0, u32 sw_if_index, u32 drop_error_code)
 
static_always_inline uword vnet_gso_node_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vnet_main_t *vnm, vnet_hw_interface_t *hi, int is_l2, int is_ip4, int is_ip6, int do_segmentation)
 
static_always_inline uword vnet_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_l2, int is_ip4, int is_ip6)
 
VLIB_NODE_FN() gso_l2_ip4_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() gso_l2_ip6_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() gso_ip4_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() gso_ip6_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (gso_l2_ip4_node, static)
 
 VNET_FEATURE_INIT (gso_l2_ip6_node, static)
 
 VNET_FEATURE_INIT (gso_ip4_node, static)
 
 VNET_FEATURE_INIT (gso_ip6_node, static)
 

Variables

static char * gso_error_strings []
 
vlib_node_registration_t gso_l2_ip4_node
 (constructor) VLIB_REGISTER_NODE (gso_l2_ip4_node) More...
 
vlib_node_registration_t gso_l2_ip6_node
 (constructor) VLIB_REGISTER_NODE (gso_l2_ip6_node) More...
 
vlib_node_registration_t gso_ip4_node
 (constructor) VLIB_REGISTER_NODE (gso_ip4_node) More...
 
vlib_node_registration_t gso_ip6_node
 (constructor) VLIB_REGISTER_NODE (gso_ip6_node) More...
 

Macro Definition Documentation

◆ foreach_gso_error

#define foreach_gso_error
Value:
_ (NO_BUFFERS, "no buffers to segment GSO") \
_ (UNHANDLED_TYPE, "unhandled gso type")

Definition at line 28 of file node.c.

Enumeration Type Documentation

◆ gso_error_t

Enumerator
GSO_N_ERROR 

Definition at line 38 of file node.c.

◆ gso_next_t

enum gso_next_t
Enumerator
GSO_NEXT_DROP 
GSO_N_NEXT 

Definition at line 46 of file node.c.

Function Documentation

◆ drop_one_buffer_and_count()

static_always_inline void drop_one_buffer_and_count ( vlib_main_t vm,
vnet_main_t vnm,
vlib_node_runtime_t node,
u32 pbi0,
u32  sw_if_index,
u32  drop_error_code 
)

Definition at line 472 of file node.c.

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

◆ format_gso_trace()

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

Definition at line 61 of file node.c.

+ Here is the call graph for this function:

◆ gso_ip4_node()

VLIB_NODE_FN() gso_ip4_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 829 of file node.c.

+ Here is the call graph for this function:

◆ gso_ip6_node()

VLIB_NODE_FN() gso_ip6_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 836 of file node.c.

+ Here is the call graph for this function:

◆ gso_l2_ip4_node()

VLIB_NODE_FN() gso_l2_ip4_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 815 of file node.c.

+ Here is the call graph for this function:

◆ gso_l2_ip6_node()

VLIB_NODE_FN() gso_l2_ip6_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 822 of file node.c.

+ Here is the call graph for this function:

◆ tso_alloc_tx_bufs()

static_always_inline u16 tso_alloc_tx_bufs ( vlib_main_t vm,
vnet_interface_per_thread_data_t ptd,
vlib_buffer_t b0,
u32  n_bytes_b0,
u16  l234_sz,
u16  gso_size,
u16  first_data_size,
generic_header_offset_t gho 
)

Definition at line 199 of file node.c.

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

◆ tso_fixup_segmented_buf()

static_always_inline void tso_fixup_segmented_buf ( vlib_main_t vm,
vlib_buffer_t b0,
u8  tcp_flags,
int  is_l2,
int  is_ip6,
generic_header_offset_t gho 
)

Definition at line 287 of file node.c.

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

◆ tso_init_buf_from_template()

static_always_inline void tso_init_buf_from_template ( vlib_main_t vm,
vlib_buffer_t nb0,
vlib_buffer_t b0,
u16  template_data_sz,
u16  gso_size,
u8 **  p_dst_ptr,
u16 p_dst_left,
u32  next_tcp_seq,
u32  flags,
generic_header_offset_t gho 
)

Definition at line 267 of file node.c.

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

◆ tso_init_buf_from_template_base()

static_always_inline void tso_init_buf_from_template_base ( vlib_buffer_t nb0,
vlib_buffer_t b0,
u32  flags,
u16  length 
)

Definition at line 245 of file node.c.

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

◆ tso_segment_buffer()

static_always_inline u32 tso_segment_buffer ( vlib_main_t vm,
vnet_interface_per_thread_data_t ptd,
u32  sbi0,
vlib_buffer_t sb0,
generic_header_offset_t gho,
u32  n_bytes_b0,
int  is_l2,
int  is_ip6 
)

Allocate the necessary number of ptd->split_buffers, and segment the possibly chained buffer(s) from b0 into there.

Return the cumulative number of bytes sent or zero if allocation failed.

Definition at line 352 of file node.c.

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

◆ tso_segment_ipip_tunnel_fixup()

static_always_inline u16 tso_segment_ipip_tunnel_fixup ( vlib_main_t vm,
vnet_interface_per_thread_data_t ptd,
vlib_buffer_t sb0,
generic_header_offset_t gho 
)

Definition at line 84 of file node.c.

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

◆ tso_segment_vxlan_tunnel_fixup()

static_always_inline u16 tso_segment_vxlan_tunnel_fixup ( vlib_main_t vm,
vnet_interface_per_thread_data_t ptd,
vlib_buffer_t sb0,
generic_header_offset_t gho 
)

Definition at line 176 of file node.c.

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

◆ tso_segment_vxlan_tunnel_headers_fixup()

static_always_inline void tso_segment_vxlan_tunnel_headers_fixup ( vlib_main_t vm,
vlib_buffer_t b,
generic_header_offset_t gho 
)

Definition at line 127 of file node.c.

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

◆ VNET_FEATURE_INIT() [1/4]

VNET_FEATURE_INIT ( gso_ip4_node  ,
static   
)

◆ VNET_FEATURE_INIT() [2/4]

VNET_FEATURE_INIT ( gso_ip6_node  ,
static   
)

◆ VNET_FEATURE_INIT() [3/4]

VNET_FEATURE_INIT ( gso_l2_ip4_node  ,
static   
)

◆ VNET_FEATURE_INIT() [4/4]

VNET_FEATURE_INIT ( gso_l2_ip6_node  ,
static   
)

◆ vnet_gso_inline()

static_always_inline uword vnet_gso_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_l2,
int  is_ip4,
int  is_ip6 
)

Definition at line 788 of file node.c.

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

◆ vnet_gso_node_inline()

static_always_inline uword vnet_gso_node_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
vnet_main_t vnm,
vnet_hw_interface_t hi,
int  is_l2,
int  is_ip4,
int  is_ip6,
int  do_segmentation 
)

Definition at line 491 of file node.c.

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

Variable Documentation

◆ gso_error_strings

char* gso_error_strings[]
static
Initial value:
= {
#define _(sym, string)
}

Definition at line 32 of file node.c.

◆ gso_ip4_node

Initial value:
= {
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.error_strings = gso_error_strings,
.n_next_nodes = GSO_N_NEXT,
.next_nodes = {
[GSO_NEXT_DROP] = "error-drop",
},
.name = "gso-ip4",
}

(constructor) VLIB_REGISTER_NODE (gso_ip4_node)

Definition at line 871 of file node.c.

◆ gso_ip6_node

Initial value:
= {
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.error_strings = gso_error_strings,
.n_next_nodes = GSO_N_NEXT,
.next_nodes = {
[GSO_NEXT_DROP] = "error-drop",
},
.name = "gso-ip6",
}

(constructor) VLIB_REGISTER_NODE (gso_ip6_node)

Definition at line 884 of file node.c.

◆ gso_l2_ip4_node

vlib_node_registration_t gso_l2_ip4_node
Initial value:
= {
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.error_strings = gso_error_strings,
.n_next_nodes = GSO_N_NEXT,
.next_nodes = {
[GSO_NEXT_DROP] = "error-drop",
},
.name = "gso-l2-ip4",
}

(constructor) VLIB_REGISTER_NODE (gso_l2_ip4_node)

Definition at line 845 of file node.c.

◆ gso_l2_ip6_node

vlib_node_registration_t gso_l2_ip6_node
Initial value:
= {
.vector_size = sizeof (u32),
.format_trace = format_gso_trace,
.error_strings = gso_error_strings,
.n_next_nodes = GSO_N_NEXT,
.next_nodes = {
[GSO_NEXT_DROP] = "error-drop",
},
.name = "gso-l2-ip6",
}

(constructor) VLIB_REGISTER_NODE (gso_l2_ip6_node)

Definition at line 858 of file node.c.

VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
GSO_NEXT_DROP
@ GSO_NEXT_DROP
Definition: node.c:48
foreach_gso_error
#define foreach_gso_error
Definition: node.c:28
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
gso_error_strings
static char * gso_error_strings[]
Definition: node.c:32
GSO_N_NEXT
@ GSO_N_NEXT
Definition: node.c:49
format_gso_trace
static u8 * format_gso_trace(u8 *s, va_list *args)
Definition: node.c:61
u32
unsigned int u32
Definition: types.h:88
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123