|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef included_gro_func_h
17 #define included_gro_func_h
66 if (b0->
flags & VNET_BUFFER_F_IS_IP4)
67 return VNET_BUFFER_F_IS_IP4;
68 if (b0->
flags & VNET_BUFFER_F_IS_IP6)
69 return VNET_BUFFER_F_IS_IP6;
74 u16 ethertype = clib_net_to_host_u16 (eh->
type);
80 ethertype = clib_net_to_host_u16 (vlan->
type);
81 if (ethertype == ETHERNET_TYPE_VLAN)
84 ethertype = clib_net_to_host_u16 (vlan->
type);
87 if (ethertype == ETHERNET_TYPE_IP4)
88 return VNET_BUFFER_F_IS_IP4;
89 if (ethertype == ETHERNET_TYPE_IP6)
90 return VNET_BUFFER_F_IS_IP6;
95 return VNET_BUFFER_F_IS_IP4;
97 return VNET_BUFFER_F_IS_IP6;
114 u32 next_tcp_seq0 = clib_net_to_host_u32 (tcp0->seq_number);
115 u32 next_tcp_seq1 = clib_net_to_host_u32 (tcp1->seq_number);
118 if (
PREDICT_TRUE (next_tcp_seq0 + payload_len0 == next_tcp_seq1))
135 while (pb->
flags & VLIB_BUFFER_NEXT_PRESENT)
139 pb->
flags |= VLIB_BUFFER_NEXT_PRESENT;
142 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
151 if (b0->
flags & VNET_BUFFER_F_OFFLOAD)
152 return VNET_BUFFER_F_L4_CHECKSUM_CORRECT;
177 if (is_ip0 & VNET_BUFFER_F_IS_IP4)
180 else if (is_ip0 & VNET_BUFFER_F_IS_IP6)
238 u16 l234_sz0, l234_sz1;
239 u32 pkt_len0, pkt_len1, payload_len0, payload_len1;
246 if (is_ip0 & VNET_BUFFER_F_IS_IP4)
249 else if (is_ip0 & VNET_BUFFER_F_IS_IP6)
255 if (is_ip1 & VNET_BUFFER_F_IS_IP4)
258 else if (is_ip1 & VNET_BUFFER_F_IS_IP6)
316 payload_len0 = pkt_len0 - l234_sz0;
317 payload_len1 = pkt_len1 - l234_sz1;
327 tcp0->flags |= tcp1->flags;
328 return tcp1->ack_number;
341 if (is_ip0 & VNET_BUFFER_F_IS_IP4)
344 else if (is_ip0 & VNET_BUFFER_F_IS_IP6)
357 b0->
flags |= (VNET_BUFFER_F_GSO | VNET_BUFFER_F_IS_IP4);
359 VNET_BUFFER_OFFLOAD_F_IP_CKSUM));
365 ip6->payload_length =
368 b0->
flags |= (VNET_BUFFER_F_GSO | VNET_BUFFER_F_IS_IP6);
374 tcp0->ack_number = ack_number;
375 b0->
flags &= ~VLIB_BUFFER_IS_TRACED;
512 u16 l234_sz0, l234_sz_s;
513 u32 pkt_len_s, payload_len0, payload_len_s;
518 if (is_ip_s & VNET_BUFFER_F_IS_IP4)
521 else if (is_ip_s & VNET_BUFFER_F_IS_IP6)
531 payload_len0 = pkt_len0 - l234_sz0;
532 payload_len_s = pkt_len_s - l234_sz_s;
548 tcp_s->flags |= tcp0->flags;
560 to, bi_s, bi0, is_l2);
608 u32 bi = 1, ack_number = 0;
u32 next_buffer
Next buffer for this linked-list of buffers.
static_always_inline u32 vnet_gro_inline(vlib_main_t *vm, gro_flow_table_t *flow_table, u32 *from, u16 n_left_from, u32 *to)
coalesce buffers with flow tables
@ GRO_PACKET_ACTION_ENQUEUE
u32 ip6_tcp_udp_icmp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
static_always_inline gro_flow_t * gro_flow_table_find_or_add_flow(gro_flow_table_t *flow_table, gro_flow_key_t *flow_key)
static_always_inline u8 gro_flow_table_is_timeout(vlib_main_t *vm, gro_flow_table_t *flow_table)
gro_flow_t gro_flow[GRO_FLOW_TABLE_MAX_SIZE]
static_always_inline u32 gro_get_packet_data(vlib_main_t *vm, vlib_buffer_t *b0, generic_header_offset_t *gho0, gro_flow_key_t *flow_key0, u8 is_l2)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
ip46_address_t src_address
static void ip46_address_set_ip4(ip46_address_t *ip46, const ip4_address_t *ip)
static_always_inline int ethernet_frame_is_tagged(u16 type)
struct _tcp_header tcp_header_t
vlib_get_buffers(vm, from, b, n_left_from)
static_always_inline void ip46_address_set_ip6(ip46_address_t *dst, const ip6_address_t *src)
static_always_inline void vnet_buffer_offload_flags_set(vlib_buffer_t *b, vnet_buffer_oflags_t oflags)
static_always_inline u8 gro_flow_table_is_enable(gro_flow_table_t *flow_table)
static_always_inline void gro_fixup_header(vlib_main_t *vm, vlib_buffer_t *b0, u32 ack_number, u8 is_l2)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ GRO_PACKET_ACTION_FLUSH
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline void gro_flow_table_reset_flow(gro_flow_table_t *flow_table, gro_flow_t *gro_flow)
static_always_inline u8 gro_flow_is_timeout(vlib_main_t *vm, gro_flow_t *gro_flow)
static_always_inline gro_packet_action_t gro_tcp_sequence_check(tcp_header_t *tcp0, tcp_header_t *tcp1, u32 payload_len0)
static_always_inline void gro_merge_buffers(vlib_main_t *vm, vlib_buffer_t *b0, vlib_buffer_t *b1, u32 bi1, u32 payload_len1, u16 l234_sz1)
static_always_inline u32 vnet_gro_flow_table_inline(vlib_main_t *vm, gro_flow_table_t *flow_table, u32 bi0, u32 *to)
static_always_inline void gro_flow_store_packet(gro_flow_t *gro_flow, u32 bi0)
static_always_inline u32 vnet_gro_flush_all_packets(vlib_main_t *vm, gro_flow_table_t *flow_table, gro_flow_t *gro_flow, vlib_buffer_t *b_s, u32 *to, u32 bi_s, u32 bi0, u8 is_l2)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static_always_inline void gro_flow_set_timeout(vlib_main_t *vm, gro_flow_t *gro_flow, f64 timeout_expire)
timeout_expire is in between 3 to 10 microseconds 3e-6 1e-5
static_always_inline void gro_get_ip4_flow_from_packet(u32 *sw_if_index, ip4_header_t *ip4, tcp_header_t *tcp, gro_flow_key_t *flow_key, int is_l2)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define static_always_inline
ip46_address_t dst_address
#define GRO_FLOW_TABLE_MAX_SIZE
static_always_inline gro_flow_t * gro_flow_table_get_flow(gro_flow_table_t *flow_table, gro_flow_key_t *flow_key)
static_always_inline u32 gro_is_ip4_or_ip6_packet(vlib_buffer_t *b0, u8 is_l2)
u16 current_length
Nbytes between current data and the end of this buffer.
static_always_inline void gro_get_ip6_flow_from_packet(u32 *sw_if_index, ip6_header_t *ip6, tcp_header_t *tcp, gro_flow_key_t *flow_key, int is_l2)
u32 ip4_tcp_udp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
static_always_inline u32 gro_validate_checksum(vlib_main_t *vm, vlib_buffer_t *b0, generic_header_offset_t *gho0, int is_ip4)
static_always_inline void vnet_gro_flow_table_schedule_node_on_dispatcher(vlib_main_t *vm, gro_flow_table_t *flow_table)
static_always_inline u8 gro_flow_is_equal(gro_flow_key_t *first, gro_flow_key_t *second)
#define GRO_FLOW_N_BUFFERS
#define GRO_FLOW_TABLE_FLUSH
static_always_inline u32 vnet_gro_flow_table_flush(vlib_main_t *vm, gro_flow_table_t *flow_table, u32 *to)
static_always_inline u8 gro_is_bad_packet(vlib_buffer_t *b, u8 flags, i16 l234_sz)
static_always_inline void vnet_generic_header_offset_parser(vlib_buffer_t *b0, generic_header_offset_t *gho, int is_l2, int is_ip4, int is_ip6)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static_always_inline void gro_flow_table_set_timeout(vlib_main_t *vm, gro_flow_table_t *flow_table, f64 timeout_expire)
static_always_inline u32 gro_coalesce_buffers(vlib_main_t *vm, vlib_buffer_t *b0, vlib_buffer_t *b1, u32 bi1, u8 is_l2)
static_always_inline u32 vnet_gro_simple_inline(vlib_main_t *vm, u32 *from, u16 n_left_from, int is_l2)
coalesce buffers in opportunistic way without flow tables
vl_api_mac_event_action_t action
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
vl_api_interface_index_t sw_if_index
u32 sw_if_index[VLIB_N_RX_TX]
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags