|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef included_gro_func_h
17 #define included_gro_func_h
65 if (b0->
flags & VNET_BUFFER_F_IS_IP4)
66 return VNET_BUFFER_F_IS_IP4;
67 if (b0->
flags & VNET_BUFFER_F_IS_IP6)
68 return VNET_BUFFER_F_IS_IP6;
73 u16 ethertype = clib_net_to_host_u16 (eh->
type);
79 ethertype = clib_net_to_host_u16 (vlan->
type);
80 if (ethertype == ETHERNET_TYPE_VLAN)
83 ethertype = clib_net_to_host_u16 (vlan->
type);
86 if (ethertype == ETHERNET_TYPE_IP4)
87 return VNET_BUFFER_F_IS_IP4;
88 if (ethertype == ETHERNET_TYPE_IP6)
89 return VNET_BUFFER_F_IS_IP6;
94 return VNET_BUFFER_F_IS_IP4;
96 return VNET_BUFFER_F_IS_IP6;
113 u32 next_tcp_seq0 = clib_net_to_host_u32 (tcp0->seq_number);
114 u32 next_tcp_seq1 = clib_net_to_host_u32 (tcp1->seq_number);
117 if (
PREDICT_TRUE (next_tcp_seq0 + payload_len0 == next_tcp_seq1))
134 while (pb->
flags & VLIB_BUFFER_NEXT_PRESENT)
138 pb->
flags |= VLIB_BUFFER_NEXT_PRESENT;
141 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
150 if (b0->
flags & VNET_BUFFER_F_OFFLOAD)
151 return VNET_BUFFER_F_L4_CHECKSUM_CORRECT;
176 if (is_ip0 & VNET_BUFFER_F_IS_IP4)
179 else if (is_ip0 & VNET_BUFFER_F_IS_IP6)
217 if ((
flags & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) == 0)
237 u16 l234_sz0, l234_sz1;
238 u32 pkt_len0, pkt_len1, payload_len0, payload_len1;
245 if (is_ip0 & VNET_BUFFER_F_IS_IP4)
248 else if (is_ip0 & VNET_BUFFER_F_IS_IP6)
254 if (is_ip1 & VNET_BUFFER_F_IS_IP4)
257 else if (is_ip1 & VNET_BUFFER_F_IS_IP6)
315 payload_len0 = pkt_len0 - l234_sz0;
316 payload_len1 = pkt_len1 - l234_sz1;
326 return tcp1->ack_number;
340 if (is_ip0 & VNET_BUFFER_F_IS_IP4)
343 else if (is_ip0 & VNET_BUFFER_F_IS_IP6)
356 b0->
flags |= (VNET_BUFFER_F_GSO | VNET_BUFFER_F_IS_IP4);
358 VNET_BUFFER_OFFLOAD_F_IP_CKSUM));
364 ip6->payload_length =
367 b0->
flags |= (VNET_BUFFER_F_GSO | VNET_BUFFER_F_IS_IP6);
373 tcp0->ack_number = ack_number;
374 b0->
flags &= ~VLIB_BUFFER_IS_TRACED;
447 int is_l2 = flow_table->
is_l2;
491 u16 l234_sz0, l234_sz_s;
492 u32 pkt_len_s, payload_len0, payload_len_s;
497 if (is_ip_s & VNET_BUFFER_F_IS_IP4)
500 else if (is_ip_s & VNET_BUFFER_F_IS_IP6)
510 payload_len0 = pkt_len0 - l234_sz0;
511 payload_len_s = pkt_len_s - l234_sz_s;
579 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
static_always_inline void gro_fixup_header(vlib_main_t *vm, vlib_buffer_t *b0, u32 ack_number, int is_l2)
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 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)
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)
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
sll srl srl sll sra u16x4 i
ip46_address_t dst_address
#define GRO_FLOW_TABLE_MAX_SIZE
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 u32 gro_is_ip4_or_ip6_packet(vlib_buffer_t *b0, int is_l2)
static_always_inline u8 gro_flow_is_equal(gro_flow_key_t *first, gro_flow_key_t *second)
#define GRO_FLOW_N_BUFFERS
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, int is_l2)
#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 u32 gro_coalesce_buffers(vlib_main_t *vm, vlib_buffer_t *b0, vlib_buffer_t *b1, u32 bi1, int is_l2)
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 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