40 s =
format (s,
"GTPU decap from gtpu_tunnel%d teid %d next %d error %d",
45 s =
format (s,
"GTPU decap error - tunnel for teid %d does not exist",
63 u32 n_left_from, next_index, * from, * to_next;
67 u32 last_tunnel_index = ~0;
68 gtpu4_tunnel_key_t last_key4;
69 gtpu6_tunnel_key_t last_key6;
70 u32 pkts_decapsulated = 0;
72 u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
75 last_key4.as_u64 = ~0;
84 stats_n_packets = stats_n_bytes = 0;
86 while (n_left_from > 0)
91 to_next, n_left_to_next);
92 while (n_left_from >= 4 && n_left_to_next >= 2)
100 u32 gtpu_hdr_len0, gtpu_hdr_len1;
102 u32 tunnel_index0, tunnel_index1;
104 gtpu4_tunnel_key_t key4_0, key4_1;
105 gtpu6_tunnel_key_t key6_0, key6_1;
107 u32 sw_if_index0, sw_if_index1, len0, len1;
108 u8 has_space0, has_space1;
167 gtpu_hdr_len1 =
sizeof(
gtpu_header_t) - (((ver1 & GTPU_E_S_PN_BIT) == 0) * 4);
174 error0 = has_space0 ? GTPU_ERROR_BAD_VER : GTPU_ERROR_TOO_SMALL;
175 next0 = GTPU_INPUT_NEXT_DROP;
182 key4_0.teid = gtpu0->
teid;
191 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
192 next0 = GTPU_INPUT_NEXT_DROP;
195 last_key4.as_u64 = key4_0.as_u64;
196 tunnel_index0 = last_tunnel_index = p0[0];
199 tunnel_index0 = last_tunnel_index;
205 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
206 next0 = GTPU_INPUT_NEXT_DROP;
216 key4_0.teid = gtpu0->
teid;
225 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
226 next0 = GTPU_INPUT_NEXT_DROP;
230 key6_0.src.as_u64[0] = ip6_0->
src_address.as_u64[0];
231 key6_0.src.as_u64[1] = ip6_0->
src_address.as_u64[1];
232 key6_0.teid = gtpu0->
teid;
236 if (
PREDICT_FALSE (memcmp(&key6_0, &last_key6,
sizeof(last_key6)) != 0))
241 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
242 next0 = GTPU_INPUT_NEXT_DROP;
246 tunnel_index0 = last_tunnel_index = p0[0];
249 tunnel_index0 = last_tunnel_index;
255 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
256 next0 = GTPU_INPUT_NEXT_DROP;
266 key6_0.src.as_u64[0] = ip6_0->
dst_address.as_u64[0];
267 key6_0.src.as_u64[1] = ip6_0->
dst_address.as_u64[1];
268 key6_0.teid = gtpu0->
teid;
276 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
277 next0 = GTPU_INPUT_NEXT_DROP;
295 sw_if_index0 = (mt0) ? mt0->
sw_if_index : sw_if_index0;
297 pkts_decapsulated ++;
298 stats_n_packets += 1;
299 stats_n_bytes += len0;
305 stats_n_packets -= 1;
306 stats_n_bytes -= len0;
310 thread_index, stats_sw_if_index,
311 stats_n_packets, stats_n_bytes);
313 stats_n_bytes = len0;
314 stats_sw_if_index = sw_if_index0;
327 tr->
teid = has_space0 ? clib_net_to_host_u32(gtpu0->
teid) : ~0;
332 error1 = has_space1 ? GTPU_ERROR_BAD_VER : GTPU_ERROR_TOO_SMALL;
333 next1 = GTPU_INPUT_NEXT_DROP;
340 key4_1.teid = gtpu1->
teid;
349 error1 = GTPU_ERROR_NO_SUCH_TUNNEL;
350 next1 = GTPU_INPUT_NEXT_DROP;
353 last_key4.as_u64 = key4_1.as_u64;
354 tunnel_index1 = last_tunnel_index = p1[0];
357 tunnel_index1 = last_tunnel_index;
363 error1 = GTPU_ERROR_NO_SUCH_TUNNEL;
364 next1 = GTPU_INPUT_NEXT_DROP;
374 key4_1.teid = gtpu1->
teid;
383 error1 = GTPU_ERROR_NO_SUCH_TUNNEL;
384 next1 = GTPU_INPUT_NEXT_DROP;
388 key6_1.src.as_u64[0] = ip6_1->
src_address.as_u64[0];
389 key6_1.src.as_u64[1] = ip6_1->
src_address.as_u64[1];
390 key6_1.teid = gtpu1->
teid;
394 if (
PREDICT_FALSE (memcmp(&key6_1, &last_key6,
sizeof(last_key6)) != 0))
400 error1 = GTPU_ERROR_NO_SUCH_TUNNEL;
401 next1 = GTPU_INPUT_NEXT_DROP;
406 tunnel_index1 = last_tunnel_index = p1[0];
409 tunnel_index1 = last_tunnel_index;
415 error1 = GTPU_ERROR_NO_SUCH_TUNNEL;
416 next1 = GTPU_INPUT_NEXT_DROP;
426 key6_1.src.as_u64[0] = ip6_1->
dst_address.as_u64[0];
427 key6_1.src.as_u64[1] = ip6_1->
dst_address.as_u64[1];
428 key6_1.teid = gtpu1->
teid;
436 error1 = GTPU_ERROR_NO_SUCH_TUNNEL;
437 next1 = GTPU_INPUT_NEXT_DROP;
455 sw_if_index1 = (mt1) ? mt1->sw_if_index : sw_if_index1;
457 pkts_decapsulated ++;
458 stats_n_packets += 1;
459 stats_n_bytes += len1;
465 stats_n_packets -= 1;
466 stats_n_bytes -= len1;
470 thread_index, stats_sw_if_index,
471 stats_n_packets, stats_n_bytes);
473 stats_n_bytes = len1;
474 stats_sw_if_index = sw_if_index1;
487 tr->
teid = has_space1 ? clib_net_to_host_u32(gtpu1->
teid) : ~0;
491 to_next, n_left_to_next,
492 bi0, bi1, next0, next1);
495 while (n_left_from > 0 && n_left_to_next > 0)
507 gtpu4_tunnel_key_t key4_0;
508 gtpu6_tunnel_key_t key6_0;
510 u32 sw_if_index0, len0;
548 error0 = has_space0 ? GTPU_ERROR_BAD_VER : GTPU_ERROR_TOO_SMALL;
549 next0 = GTPU_INPUT_NEXT_DROP;
555 key4_0.teid = gtpu0->
teid;
564 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
565 next0 = GTPU_INPUT_NEXT_DROP;
568 last_key4.as_u64 = key4_0.as_u64;
569 tunnel_index0 = last_tunnel_index = p0[0];
572 tunnel_index0 = last_tunnel_index;
578 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
579 next0 = GTPU_INPUT_NEXT_DROP;
589 key4_0.teid = gtpu0->
teid;
598 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
599 next0 = GTPU_INPUT_NEXT_DROP;
603 key6_0.src.as_u64[0] = ip6_0->
src_address.as_u64[0];
604 key6_0.src.as_u64[1] = ip6_0->
src_address.as_u64[1];
605 key6_0.teid = gtpu0->
teid;
609 if (
PREDICT_FALSE (memcmp(&key6_0, &last_key6,
sizeof(last_key6)) != 0))
614 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
615 next0 = GTPU_INPUT_NEXT_DROP;
619 tunnel_index0 = last_tunnel_index = p0[0];
622 tunnel_index0 = last_tunnel_index;
628 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
629 next0 = GTPU_INPUT_NEXT_DROP;
639 key6_0.src.as_u64[0] = ip6_0->
dst_address.as_u64[0];
640 key6_0.src.as_u64[1] = ip6_0->
dst_address.as_u64[1];
641 key6_0.teid = gtpu0->
teid;
649 error0 = GTPU_ERROR_NO_SUCH_TUNNEL;
650 next0 = GTPU_INPUT_NEXT_DROP;
668 sw_if_index0 = (mt0) ? mt0->
sw_if_index : sw_if_index0;
670 pkts_decapsulated ++;
671 stats_n_packets += 1;
672 stats_n_bytes += len0;
678 stats_n_packets -= 1;
679 stats_n_bytes -= len0;
683 thread_index, stats_sw_if_index,
684 stats_n_packets, stats_n_bytes);
686 stats_n_bytes = len0;
687 stats_sw_if_index = sw_if_index0;
700 tr->
teid = has_space0 ? clib_net_to_host_u32(gtpu0->
teid) : ~0;
703 to_next, n_left_to_next,
712 GTPU_ERROR_DECAPSULATED,
720 thread_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
742 #define gtpu_error(n,s) s, 749 .name =
"gtpu4-input",
751 .vector_size =
sizeof (
u32),
758 #define _(s,n) [GTPU_INPUT_NEXT_##s] = n, 769 .name =
"gtpu6-input",
771 .vector_size =
sizeof (
u32),
778 #define _(s,n) [GTPU_INPUT_NEXT_##s] = n, 801 u32 * from, * to_next, n_left_from, n_left_to_next, next_index;
803 vtep4_key_t last_vtep4;
805 vtep6_key_t last_vtep6;
808 #ifdef CLIB_HAVE_VEC512 826 while (n_left_from > 0)
830 while (n_left_from >= 4 && n_left_to_next >= 2)
836 u32 bi0, ip_len0, udp_len0, flags0, next0;
837 u32 bi1, ip_len1, udp_len1, flags1, next1;
838 i32 len_diff0, len_diff1;
839 u8 error0, good_udp0, proto0;
840 u8 error1, good_udp1, proto1;
851 bi0 = to_next[0] = from[0];
852 bi1 = to_next[1] = from[1];
890 if (proto0 != IP_PROTOCOL_UDP)
898 if (udp0->
dst_port != clib_host_to_net_u16 (UDP_DST_PORT_GTPU))
904 #ifdef CLIB_HAVE_VEC512 906 (>m->
vtep_table, b0, ip40, &last_vtep4, &vtep4_u512))
919 good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
926 ip_len0 = clib_net_to_host_u16 (ip40->
length);
929 udp_len0 = clib_net_to_host_u16 (udp0->
length);
930 len_diff0 = ip_len0 - udp_len0;
935 if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
942 (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
948 error0 = good_udp0 ? 0 : IP4_ERROR_UDP_CHECKSUM;
949 error0 = (len_diff0 >= 0) ? error0 : IP4_ERROR_UDP_LENGTH;
953 error0 = good_udp0 ? 0 : IP6_ERROR_UDP_CHECKSUM;
954 error0 = (len_diff0 >= 0) ? error0 : IP6_ERROR_UDP_LENGTH;
959 b0->
error = error0 ? error_node->
errors[error0] : 0;
969 if (proto1 != IP_PROTOCOL_UDP)
977 if (udp1->
dst_port != clib_host_to_net_u16 (UDP_DST_PORT_GTPU))
983 #ifdef CLIB_HAVE_VEC512 985 (>m->
vtep_table, b1, ip41, &last_vtep4, &vtep4_u512))
998 good_udp1 = (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1005 ip_len1 = clib_net_to_host_u16 (ip41->
length);
1008 udp_len1 = clib_net_to_host_u16 (udp1->
length);
1009 len_diff1 = ip_len1 - udp_len1;
1014 if ((flags1 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
1021 (flags1 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1027 error1 = good_udp1 ? 0 : IP4_ERROR_UDP_CHECKSUM;
1028 error1 = (len_diff1 >= 0) ? error1 : IP4_ERROR_UDP_LENGTH;
1032 error1 = good_udp1 ? 0 : IP6_ERROR_UDP_CHECKSUM;
1033 error1 = (len_diff1 >= 0) ? error1 : IP6_ERROR_UDP_LENGTH;
1038 b1->
error = error1 ? error_node->
errors[error1] : 0;
1048 to_next, n_left_to_next,
1049 bi0, bi1, next0, next1);
1052 while (n_left_from > 0 && n_left_to_next > 0)
1058 u32 bi0, ip_len0, udp_len0, flags0, next0;
1060 u8 error0, good_udp0, proto0;
1062 bi0 = to_next[0] = from[0];
1066 n_left_to_next -= 1;
1085 if (proto0 != IP_PROTOCOL_UDP)
1093 if (udp0->
dst_port != clib_host_to_net_u16 (UDP_DST_PORT_GTPU))
1099 #ifdef CLIB_HAVE_VEC512 1101 (>m->
vtep_table, b0, ip40, &last_vtep4, &vtep4_u512))
1114 good_udp0 = (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1121 ip_len0 = clib_net_to_host_u16 (ip40->
length);
1124 udp_len0 = clib_net_to_host_u16 (udp0->
length);
1125 len_diff0 = ip_len0 - udp_len0;
1130 if ((flags0 & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
1137 (flags0 & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1143 error0 = good_udp0 ? 0 : IP4_ERROR_UDP_CHECKSUM;
1144 error0 = (len_diff0 >= 0) ? error0 : IP4_ERROR_UDP_LENGTH;
1148 error0 = good_udp0 ? 0 : IP6_ERROR_UDP_CHECKSUM;
1149 error0 = (len_diff0 >= 0) ? error0 : IP6_ERROR_UDP_LENGTH;
1154 b0->
error = error0 ? error_node->
errors[error0] : 0;
1164 to_next, n_left_to_next,
1182 .name =
"ip4-gtpu-bypass",
1183 .vector_size =
sizeof (
u32),
1195 #ifndef CLIB_MARCH_VARIANT 1211 .name =
"ip6-gtpu-bypass",
1212 .vector_size =
sizeof (
u32),
1224 #ifndef CLIB_MARCH_VARIANT 1231 #define foreach_gtpu_flow_error \ 1232 _(NONE, "no error") \ 1233 _(PAYLOAD_ERROR, "Payload type errors") \ 1234 _(IP_CHECKSUM_ERROR, "Rx ip checksum errors") \ 1235 _(IP_HEADER_ERROR, "Rx ip header errors") \ 1236 _(UDP_CHECKSUM_ERROR, "Rx udp checksum errors") \ 1237 _(UDP_LENGTH_ERROR, "Rx udp length errors") 1241 #define _(f,s) GTPU_FLOW_ERROR_##f, 1244 #define gtpu_error(n,s) GTPU_FLOW_ERROR_##n, 1254 #define gtpu_error(n,s) s, 1261 #define gtpu_local_need_csum_check(_b) \ 1262 (!(_b->flags & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED \ 1263 || _b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM)) 1265 #define gtpu_local_csum_is_valid(_b) \ 1266 ((_b->flags & VNET_BUFFER_F_L4_CHECKSUM_CORRECT \ 1267 || _b->flags & VNET_BUFFER_F_OFFLOAD_UDP_CKSUM) != 0) 1276 if ((flags & VNET_BUFFER_F_L4_CHECKSUM_COMPUTED) == 0)
1283 return (flags & VNET_BUFFER_F_L4_CHECKSUM_CORRECT) != 0;
1291 u16 ip_len = clib_net_to_host_u16 (ip4_hdr->
length);
1302 u16 ip_len = clib_net_to_host_u16 (ip4_hdr->
length);
1303 u16 udp_len = clib_net_to_host_u16 (udp_hdr->
length);
1304 return udp_len > ip_len;
1310 u8 error0 = GTPU_FLOW_ERROR_NONE;
1312 error0 = GTPU_FLOW_ERROR_IP_HEADER_ERROR;
1314 error0 = GTPU_FLOW_ERROR_UDP_LENGTH_ERROR;
1316 error0 = GTPU_FLOW_ERROR_UDP_CHECKSUM_ERROR;
1326 u32 n_left_from, next_index, * from, * to_next;
1330 u32 pkts_decapsulated = 0;
1332 u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
1333 u8 ip_err0, ip_err1, udp_err0, udp_err1, csum_err0, csum_err1;
1340 stats_n_packets = stats_n_bytes = 0;
1342 while (n_left_from > 0)
1347 to_next, n_left_to_next);
1349 while (n_left_from >= 4 && n_left_to_next >= 2)
1355 u32 gtpu_hdr_len0, gtpu_hdr_len1;
1356 u32 tunnel_index0, tunnel_index1;
1359 u32 sw_if_index0, sw_if_index1, len0, len1;
1360 u8 has_space0 = 0, has_space1 = 0;
1383 n_left_to_next -= 2;
1416 if (ip_err0 || udp_err0 || csum_err0)
1418 next0 = GTPU_INPUT_NEXT_DROP;
1436 error0 = has_space0 ? GTPU_ERROR_BAD_VER : GTPU_ERROR_TOO_SMALL;
1437 next0 = GTPU_INPUT_NEXT_DROP;
1454 error0 = GTPU_FLOW_ERROR_PAYLOAD_ERROR;
1455 next0 = GTPU_INPUT_NEXT_DROP;
1465 pkts_decapsulated ++;
1466 stats_n_packets += 1;
1467 stats_n_bytes += len0;
1473 stats_n_packets -= 1;
1474 stats_n_bytes -= len0;
1475 if (stats_n_packets)
1478 thread_index, stats_sw_if_index,
1479 stats_n_packets, stats_n_bytes);
1480 stats_n_packets = 1;
1481 stats_n_bytes = len0;
1482 stats_sw_if_index = sw_if_index0;
1495 tr->
teid = has_space0 ? clib_net_to_host_u32(gtpu0->
teid) : ~0;
1498 if (ip_err1 || udp_err1 || csum_err1)
1500 next1 = GTPU_INPUT_NEXT_DROP;
1513 gtpu_hdr_len1 =
sizeof(
gtpu_header_t) - (((ver1 & GTPU_E_S_PN_BIT) == 0) * 4);
1517 error1 = has_space1 ? GTPU_ERROR_BAD_VER : GTPU_ERROR_TOO_SMALL;
1518 next1 = GTPU_INPUT_NEXT_DROP;
1535 error1 = GTPU_FLOW_ERROR_PAYLOAD_ERROR;
1536 next1 = GTPU_INPUT_NEXT_DROP;
1552 pkts_decapsulated ++;
1553 stats_n_packets += 1;
1554 stats_n_bytes += len1;
1560 stats_n_packets -= 1;
1561 stats_n_bytes -= len1;
1562 if (stats_n_packets)
1565 thread_index, stats_sw_if_index,
1566 stats_n_packets, stats_n_bytes);
1567 stats_n_packets = 1;
1568 stats_n_bytes = len1;
1569 stats_sw_if_index = sw_if_index1;
1582 tr->
teid = has_space1 ? clib_net_to_host_u32(gtpu1->
teid) : ~0;
1586 to_next, n_left_to_next,
1587 bi0, bi1, next0, next1);
1590 while (n_left_from > 0 && n_left_to_next > 0)
1600 u32 sw_if_index0, len0;
1609 n_left_to_next -= 1;
1624 if (ip_err0 || udp_err0 || csum_err0)
1626 next0 = GTPU_INPUT_NEXT_DROP;
1647 error0 = has_space0 ? GTPU_ERROR_BAD_VER : GTPU_ERROR_TOO_SMALL;
1648 next0 = GTPU_INPUT_NEXT_DROP;
1664 error0 = GTPU_FLOW_ERROR_PAYLOAD_ERROR;
1665 next0 = GTPU_INPUT_NEXT_DROP;
1675 pkts_decapsulated ++;
1676 stats_n_packets += 1;
1677 stats_n_bytes += len0;
1683 stats_n_packets -= 1;
1684 stats_n_bytes -= len0;
1685 if (stats_n_packets)
1688 thread_index, stats_sw_if_index,
1689 stats_n_packets, stats_n_bytes);
1690 stats_n_packets = 1;
1691 stats_n_bytes = len0;
1692 stats_sw_if_index = sw_if_index0;
1704 tr->
teid = has_space0 ? clib_net_to_host_u32(gtpu0->
teid) : ~0;
1707 to_next, n_left_to_next,
1716 GTPU_ERROR_DECAPSULATED,
1720 if (stats_n_packets)
1724 thread_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
1740 #ifndef CLIB_MULTIARCH_VARIANT 1742 .name =
"gtpu4-flow-input",
1744 .vector_size =
sizeof (
u32),
1753 #define _(s,n) [GTPU_INPUT_NEXT_##s] = n, u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
vl_api_wireguard_peer_flags_t flags
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
u8 runtime_data[0]
Function dependent node-runtime data.
static u8 * format_gtpu_rx_trace(u8 *s, va_list *args)
vnet_interface_main_t interface_main
#define clib_memcpy_fast(a, b, c)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static u32 validate_gtpu_fib(vlib_buffer_t *b, gtpu_tunnel_t *t, u32 is_ip4)
vlib_node_registration_t ip6_gtpu_bypass_node
(constructor) VLIB_REGISTER_NODE (ip6_gtpu_bypass_node)
static_always_inline u8 gtpu_check_ip(vlib_buffer_t *b, u16 payload_len)
clib_error_t * ip6_gtpu_bypass_init(vlib_main_t *vm)
#define VLIB_NODE_FN(node)
static uword ip4_address_is_multicast(const ip4_address_t *a)
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static u32 vlib_buffer_get_ip_fib_index(vlib_buffer_t *b, u8 is_ip4)
static int ip4_is_fragment(const ip4_header_t *i)
#define static_always_inline
#define VLIB_INIT_FUNCTION(x)
vlib_node_registration_t ip4_gtpu_bypass_node
(constructor) VLIB_REGISTER_NODE (ip4_gtpu_bypass_node)
vlib_combined_counter_main_t * combined_sw_if_counters
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static void * ip4_next_header(ip4_header_t *i)
vlib_node_registration_t gtpu4_flow_input_node
(constructor) VLIB_REGISTER_NODE (gtpu4_flow_input_node)
static void vtep4_key_init(vtep4_key_t *k4)
static char * gtpu_flow_error_strings[]
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_node_registration_t ip4_input_node
Global ip4 input node.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static char * gtpu_error_strings[]
static uword ip_gtpu_bypass_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 is_ip4)
static_always_inline u8 gtpu_validate_udp_csum(vlib_main_t *vm, vlib_buffer_t *b)
u32 ip4_tcp_udp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_node_registration_t gtpu4_input_node
(constructor) VLIB_REGISTER_NODE (gtpu4_input_node)
static u8 vtep6_check(vtep_table_t *t, vlib_buffer_t *b0, ip6_header_t *ip60, vtep6_key_t *last_k6)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static u8 vtep4_check(vtep_table_t *t, vlib_buffer_t *b0, ip4_header_t *ip40, vtep4_key_t *last_k4)
clib_error_t * ip4_gtpu_bypass_init(vlib_main_t *vm)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
u32 flow_id
Generic flow identifier.
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static uword gtpu_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u32 is_ip4)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
static void * ip6_next_header(ip6_header_t *i)
vlib_main_t vlib_node_runtime_t * node
#define foreach_gtpu_input_next
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void vtep6_key_init(vtep6_key_t *k6)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define gtpu_local_need_csum_check(_b)
static uword ip6_address_is_equal(const ip6_address_t *a, const ip6_address_t *b)
static uword ip6_address_is_multicast(const ip6_address_t *a)
uword * gtpu4_tunnel_by_key
static_always_inline u8 gtpu_err_code(u8 ip_err0, u8 udp_err0, u8 csum_err0)
struct _vlib_node_registration vlib_node_registration_t
template key/value backing page structure
static u8 vlib_buffer_has_space(vlib_buffer_t *b, word l)
Check if there is enough space in buffer to advance.
u32 ip6_tcp_udp_icmp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
void ip4_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
uword * gtpu6_tunnel_by_key
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
static uword gtpu_flow_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define hash_get_mem(h, key)
u16 flags
Copy of main node flags.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static_always_inline u8 gtpu_check_ip_udp_len(vlib_buffer_t *b)
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
#define CLIB_CACHE_LINE_BYTES
vlib_node_registration_t gtpu6_input_node
(constructor) VLIB_REGISTER_NODE (gtpu6_input_node)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define foreach_gtpu_flow_error
#define gtpu_local_csum_is_valid(_b)
static u8 vtep4_check_vector(vtep_table_t *t, vlib_buffer_t *b0, ip4_header_t *ip40, vtep4_key_t *last_k4, vtep4_cache_t *vtep4_u512)
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)