|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
22 #include <mss_clamp/mss_clamp.api_enum.h>
66 u8 opt_len, opts_len, kind;
71 data = (
const u8 *) (tcp0 + 1);
73 for (; opts_len > 0; opts_len -= opt_len,
data += opt_len)
93 if (opt_len < 2 || opt_len > opts_len)
100 if (clib_net_to_host_u16 (mss0) > max_mss0)
102 new_mss0 = clib_host_to_net_u16 (max_mss0);
103 *((
u16 *) (
data + 2)) = new_mss0;
104 sum0 = tcp0->checksum;
125 u32 pkts_clamped = 0;
136 u32 sw_if_index0, sw_if_index1;
138 u32 clamped0, clamped1;
150 clamped0 = clamped1 = 0;
169 if (IP_PROTOCOL_TCP == ip0->
protocol)
172 cm->max_mss4[sw_if_index0]);
174 if (IP_PROTOCOL_TCP == ip1->
protocol)
177 cm->max_mss4[sw_if_index1]);
185 if (IP_PROTOCOL_TCP == ip0->
protocol)
188 cm->max_mss6[sw_if_index0]);
190 if (IP_PROTOCOL_TCP == ip1->
protocol)
193 cm->max_mss6[sw_if_index1]);
197 pkts_clamped += clamped0 + clamped1;
201 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
207 cm->max_mss4[sw_if_index0] :
208 cm->max_mss6[sw_if_index0];
211 if (
b[1]->
flags & VLIB_BUFFER_IS_TRACED)
217 cm->max_mss4[sw_if_index1] :
218 cm->max_mss6[sw_if_index1];
248 if (IP_PROTOCOL_TCP == ip0->
protocol)
251 cm->max_mss4[sw_if_index0]);
258 if (IP_PROTOCOL_TCP == ip0->
protocol)
261 cm->max_mss6[sw_if_index0]);
265 pkts_clamped += clamped0;
268 (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)))
274 cm->max_mss4[sw_if_index0] :
275 cm->max_mss6[sw_if_index0];
288 return frame->n_vectors;
318 .name =
"tcp-mss-clamping-ip4-in",
319 .vector_size =
sizeof (
u32),
323 .n_errors = MSS_CLAMP_N_ERROR,
324 .error_counters = mss_clamp_error_counters,
335 .name =
"tcp-mss-clamping-ip4-out",
336 .vector_size =
sizeof (
u32),
340 .n_errors = MSS_CLAMP_N_ERROR,
341 .error_counters = mss_clamp_error_counters,
352 .name =
"tcp-mss-clamping-ip6-in",
353 .vector_size =
sizeof (
u32),
357 .n_errors = MSS_CLAMP_N_ERROR,
358 .error_counters = mss_clamp_error_counters,
369 .name =
"tcp-mss-clamping-ip6-out",
370 .vector_size =
sizeof (
u32),
374 .n_errors = MSS_CLAMP_N_ERROR,
375 .error_counters = mss_clamp_error_counters,
384 .arc_name =
"ip4-unicast",
385 .node_name =
"tcp-mss-clamping-ip4-in",
390 .arc_name =
"ip4-output",
391 .node_name =
"tcp-mss-clamping-ip4-out",
395 .arc_name =
"ip6-unicast",
396 .node_name =
"tcp-mss-clamping-ip6-in",
401 .arc_name =
"ip6-output",
402 .node_name =
"tcp-mss-clamping-ip6-out",
struct mssc_trace_t_ mssc_trace_t
@ TCP_OPTION_EOL
End of options.
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
struct _tcp_header tcp_header_t
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
@ TCP_OPTION_NOOP
No operation.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static void * ip6_next_header(ip6_header_t *i)
static u8 * format_mssc_trace(u8 *s, va_list *args)
static_always_inline void vnet_feature_next_u16(u16 *next0, vlib_buffer_t *b0)
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static uword mssc_ip6_out(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
vlib_node_registration_t mssc_ip6_out_node
(constructor) VLIB_REGISTER_NODE (mssc_ip6_out_node)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
vnet_feature_config_main_t * cm
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
VNET_FEATURE_INIT(mssc_ip4_in_feat, static)
struct _vlib_node_registration vlib_node_registration_t
vlib_node_registration_t mssc_ip4_in_node
(constructor) VLIB_REGISTER_NODE (mssc_ip4_in_node)
vlib_node_registration_t mssc_ip6_in_node
(constructor) VLIB_REGISTER_NODE (mssc_ip6_in_node)
static uword mssc_ip4_in(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
description fragment has unexpected format
static uword mssc_ip6_in(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword mssc_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_dir_t dir, fib_protocol_t fproto)
@ TCP_OPTION_MSS
Limit MSS.
vlib_node_registration_t mssc_ip4_out_node
(constructor) VLIB_REGISTER_NODE (mssc_ip4_out_node)
#define ip_csum_update(sum, old, new, type, field)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VNET_FEATURES(...)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static uword mssc_ip4_out(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u32 mssc_mss_fixup(vlib_buffer_t *b0, tcp_header_t *tcp0, u16 max_mss0)
u16 nexts[VLIB_FRAME_SIZE]
static u16 ip_csum_fold(ip_csum_t c)
vl_api_fib_path_type_t type
#define vlib_prefetch_buffer_data(b, type)
static void * ip4_next_header(ip4_header_t *i)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags