diff options
author | Ole Troan <ot@cisco.com> | 2018-12-18 10:11:30 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-12-18 11:54:08 +0000 |
commit | 02782d6ebd13ce02f2d3facebb54fec3c2137c88 (patch) | |
tree | 6960723f611aaaa4b04e03baf3050f6dc22f2400 /src | |
parent | e78ac9debbe364f1bd6c59eb368d1f6bd38dfa32 (diff) |
MAP: Remove dual loop in MAP-T in preparation for refactor.
Change-Id: I3c77cadaa7b677073af00407f368bd48d703fdac
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/map/ip4_map.c | 1 | ||||
-rw-r--r-- | src/plugins/map/ip4_map_t.c | 197 | ||||
-rw-r--r-- | src/plugins/map/ip6_map_t.c | 389 |
3 files changed, 0 insertions, 587 deletions
diff --git a/src/plugins/map/ip4_map.c b/src/plugins/map/ip4_map.c index fc47d0fee46..487b9212681 100644 --- a/src/plugins/map/ip4_map.c +++ b/src/plugins/map/ip4_map.c @@ -15,7 +15,6 @@ /* * Defines used for testing various optimisation schemes */ -#define MAP_ENCAP_DUAL 0 #include "map.h" #include <vnet/ip/ip_frag.h> diff --git a/src/plugins/map/ip4_map_t.c b/src/plugins/map/ip4_map_t.c index 3d52ba4f3ea..67df6a087b9 100644 --- a/src/plugins/map/ip4_map_t.c +++ b/src/plugins/map/ip4_map_t.c @@ -17,8 +17,6 @@ #include <vnet/ip/ip_frag.h> #include <vnet/ip/ip4_to_ip6.h> -#define IP4_MAP_T_DUAL_LOOP 1 - typedef enum { IP4_MAPT_NEXT_MAPT_TCP_UDP, @@ -320,72 +318,6 @@ ip4_map_t_tcp_udp (vlib_main_t * vm, { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); -#ifdef IP4_MAP_T_DUAL_LOOP - while (n_left_from >= 4 && n_left_to_next >= 2) - { - u32 pi0, pi1; - vlib_buffer_t *p0, *p1; - ip4_mapt_pseudo_header_t *pheader0, *pheader1; - ip4_mapt_tcp_udp_next_t next0, next1; - - pi0 = to_next[0] = from[0]; - pi1 = to_next[1] = from[1]; - from += 2; - n_left_from -= 2; - to_next += 2; - n_left_to_next -= 2; - - next0 = IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP; - next1 = IP4_MAPT_TCP_UDP_NEXT_IP6_LOOKUP; - p0 = vlib_get_buffer (vm, pi0); - p1 = vlib_get_buffer (vm, pi1); - - //Accessing pseudo header - pheader0 = vlib_buffer_get_current (p0); - pheader1 = vlib_buffer_get_current (p1); - vlib_buffer_advance (p0, sizeof (*pheader0)); - vlib_buffer_advance (p1, sizeof (*pheader1)); - - if (ip4_to_ip6_tcp_udp (p0, ip4_to_ip6_set_cb, pheader0)) - { - p0->error = error_node->errors[MAP_ERROR_UNKNOWN]; - next0 = IP4_MAPT_TCP_UDP_NEXT_DROP; - } - else - { - if (vnet_buffer (p0)->map_t.mtu < p0->current_length) - { - //Send to fragmentation node if necessary - vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu; - vnet_buffer (p0)->ip_frag.next_index = - IP6_FRAG_NEXT_IP6_LOOKUP; - next0 = IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG; - } - } - - if (ip4_to_ip6_tcp_udp (p1, ip4_to_ip6_set_cb, pheader1)) - { - p1->error = error_node->errors[MAP_ERROR_UNKNOWN]; - next1 = IP4_MAPT_TCP_UDP_NEXT_DROP; - } - else - { - if (vnet_buffer (p1)->map_t.mtu < p1->current_length) - { - //Send to fragmentation node if necessary - vnet_buffer (p1)->ip_frag.mtu = vnet_buffer (p1)->map_t.mtu; - vnet_buffer (p1)->ip_frag.next_index = - IP6_FRAG_NEXT_IP6_LOOKUP; - next1 = IP4_MAPT_TCP_UDP_NEXT_IP6_FRAG; - } - } - - vlib_validate_buffer_enqueue_x2 (vm, node, next_index, - to_next, n_left_to_next, pi0, pi1, - next0, next1); - } -#endif - while (n_left_from > 0 && n_left_to_next > 0) { u32 pi0; @@ -498,135 +430,6 @@ ip4_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); -#ifdef IP4_MAP_T_DUAL_LOOP - while (n_left_from >= 4 && n_left_to_next >= 2) - { - u32 pi0, pi1; - vlib_buffer_t *p0, *p1; - ip4_header_t *ip40, *ip41; - map_domain_t *d0, *d1; - ip4_mapt_next_t next0 = 0, next1 = 0; - u16 ip4_len0, ip4_len1; - u8 error0, error1; - i32 dst_port0, dst_port1; - ip4_mapt_pseudo_header_t *pheader0, *pheader1; - - pi0 = to_next[0] = from[0]; - pi1 = to_next[1] = from[1]; - from += 2; - n_left_from -= 2; - to_next += 2; - n_left_to_next -= 2; - error0 = MAP_ERROR_NONE; - error1 = MAP_ERROR_NONE; - - p0 = vlib_get_buffer (vm, pi0); - p1 = vlib_get_buffer (vm, pi1); - ip40 = vlib_buffer_get_current (p0); - ip41 = vlib_buffer_get_current (p1); - ip4_len0 = clib_host_to_net_u16 (ip40->length); - ip4_len1 = clib_host_to_net_u16 (ip41->length); - - if (PREDICT_FALSE (p0->current_length < ip4_len0 || - ip40->ip_version_and_header_length != 0x45)) - { - error0 = MAP_ERROR_UNKNOWN; - next0 = IP4_MAPT_NEXT_DROP; - } - - if (PREDICT_FALSE (p1->current_length < ip4_len1 || - ip41->ip_version_and_header_length != 0x45)) - { - error1 = MAP_ERROR_UNKNOWN; - next1 = IP4_MAPT_NEXT_DROP; - } - - vnet_buffer (p0)->map_t.map_domain_index = - vnet_buffer (p0)->ip.adj_index[VLIB_TX]; - d0 = ip4_map_get_domain (vnet_buffer (p0)->map_t.map_domain_index); - vnet_buffer (p1)->map_t.map_domain_index = - vnet_buffer (p1)->ip.adj_index[VLIB_TX]; - d1 = ip4_map_get_domain (vnet_buffer (p1)->map_t.map_domain_index); - - vnet_buffer (p0)->map_t.mtu = d0->mtu ? d0->mtu : ~0; - vnet_buffer (p1)->map_t.mtu = d1->mtu ? d1->mtu : ~0; - - dst_port0 = -1; - dst_port1 = -1; - - ip4_map_t_classify (p0, d0, ip40, ip4_len0, &dst_port0, &error0, - &next0); - ip4_map_t_classify (p1, d1, ip41, ip4_len1, &dst_port1, &error1, - &next1); - - //Add MAP-T pseudo header in front of the packet - vlib_buffer_advance (p0, -sizeof (*pheader0)); - vlib_buffer_advance (p1, -sizeof (*pheader1)); - pheader0 = vlib_buffer_get_current (p0); - pheader1 = vlib_buffer_get_current (p1); - - //Save addresses within the packet - ip4_map_t_embedded_address (d0, &pheader0->saddr, - &ip40->src_address); - ip4_map_t_embedded_address (d1, &pheader1->saddr, - &ip41->src_address); - pheader0->daddr.as_u64[0] = - map_get_pfx_net (d0, ip40->dst_address.as_u32, (u16) dst_port0); - pheader0->daddr.as_u64[1] = - map_get_sfx_net (d0, ip40->dst_address.as_u32, (u16) dst_port0); - pheader1->daddr.as_u64[0] = - map_get_pfx_net (d1, ip41->dst_address.as_u32, (u16) dst_port1); - pheader1->daddr.as_u64[1] = - map_get_sfx_net (d1, ip41->dst_address.as_u32, (u16) dst_port1); - - if (PREDICT_FALSE - (ip4_is_first_fragment (ip40) && (dst_port0 != -1) - && (d0->ea_bits_len != 0 || !d0->rules) - && ip4_map_fragment_cache (ip40, dst_port0))) - { - error0 = MAP_ERROR_FRAGMENT_MEMORY; - } - - if (PREDICT_FALSE - (ip4_is_first_fragment (ip41) && (dst_port1 != -1) - && (d1->ea_bits_len != 0 || !d1->rules) - && ip4_map_fragment_cache (ip41, dst_port1))) - { - error1 = MAP_ERROR_FRAGMENT_MEMORY; - } - - if (PREDICT_TRUE - (error0 == MAP_ERROR_NONE && next0 != IP4_MAPT_NEXT_MAPT_ICMP)) - { - vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_TX, - thread_index, - vnet_buffer (p0)-> - map_t.map_domain_index, 1, - clib_net_to_host_u16 - (ip40->length)); - } - - if (PREDICT_TRUE - (error1 == MAP_ERROR_NONE && next1 != IP4_MAPT_NEXT_MAPT_ICMP)) - { - vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_TX, - thread_index, - vnet_buffer (p1)-> - map_t.map_domain_index, 1, - clib_net_to_host_u16 - (ip41->length)); - } - - next0 = (error0 != MAP_ERROR_NONE) ? IP4_MAPT_NEXT_DROP : next0; - next1 = (error1 != MAP_ERROR_NONE) ? IP4_MAPT_NEXT_DROP : next1; - p0->error = error_node->errors[error0]; - p1->error = error_node->errors[error1]; - vlib_validate_buffer_enqueue_x2 (vm, node, next_index, to_next, - n_left_to_next, pi0, pi1, next0, - next1); - } -#endif - while (n_left_from > 0 && n_left_to_next > 0) { u32 pi0; diff --git a/src/plugins/map/ip6_map_t.c b/src/plugins/map/ip6_map_t.c index 577dbe57001..069d392de09 100644 --- a/src/plugins/map/ip6_map_t.c +++ b/src/plugins/map/ip6_map_t.c @@ -18,8 +18,6 @@ #include <vnet/ip/ip6_to_ip4.h> #include <vnet/ip/ip4_to_ip6.h> -#define IP6_MAP_T_DUAL_LOOP - typedef enum { IP6_MAPT_NEXT_MAPT_TCP_UDP, @@ -268,65 +266,6 @@ ip6_map_t_fragmented (vlib_main_t * vm, { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); -#ifdef IP6_MAP_T_DUAL_LOOP - while (n_left_from >= 4 && n_left_to_next >= 2) - { - u32 pi0, pi1; - vlib_buffer_t *p0, *p1; - u32 next0, next1; - - pi0 = to_next[0] = from[0]; - pi1 = to_next[1] = from[1]; - from += 2; - n_left_from -= 2; - to_next += 2; - n_left_to_next -= 2; - - next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP; - next1 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP; - p0 = vlib_get_buffer (vm, pi0); - p1 = vlib_get_buffer (vm, pi1); - - if (ip6_to_ip4_fragmented (p0, ip6_to_ip4_set_cb, p0)) - { - p0->error = error_node->errors[MAP_ERROR_FRAGMENT_DROPPED]; - next0 = IP6_MAPT_FRAGMENTED_NEXT_DROP; - } - else - { - if (vnet_buffer (p0)->map_t.mtu < p0->current_length) - { - //Send to fragmentation node if necessary - vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu; - vnet_buffer (p0)->ip_frag.next_index = - IP4_FRAG_NEXT_IP4_LOOKUP; - next0 = IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG; - } - } - - if (ip6_to_ip4_fragmented (p1, ip6_to_ip4_set_cb, p1)) - { - p1->error = error_node->errors[MAP_ERROR_FRAGMENT_DROPPED]; - next1 = IP6_MAPT_FRAGMENTED_NEXT_DROP; - } - else - { - if (vnet_buffer (p1)->map_t.mtu < p1->current_length) - { - //Send to fragmentation node if necessary - vnet_buffer (p1)->ip_frag.mtu = vnet_buffer (p1)->map_t.mtu; - vnet_buffer (p1)->ip_frag.next_index = - IP4_FRAG_NEXT_IP4_LOOKUP; - next1 = IP6_MAPT_FRAGMENTED_NEXT_IP4_FRAG; - } - } - - vlib_validate_buffer_enqueue_x2 (vm, node, next_index, - to_next, n_left_to_next, pi0, pi1, - next0, next1); - } -#endif - while (n_left_from > 0 && n_left_to_next > 0) { u32 pi0; @@ -383,65 +322,6 @@ ip6_map_t_tcp_udp (vlib_main_t * vm, { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); -#ifdef IP6_MAP_T_DUAL_LOOP - while (n_left_from >= 4 && n_left_to_next >= 2) - { - u32 pi0, pi1; - vlib_buffer_t *p0, *p1; - ip6_mapt_tcp_udp_next_t next0, next1; - - pi0 = to_next[0] = from[0]; - pi1 = to_next[1] = from[1]; - from += 2; - n_left_from -= 2; - to_next += 2; - n_left_to_next -= 2; - next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP; - next1 = IP6_MAPT_TCP_UDP_NEXT_IP4_LOOKUP; - - p0 = vlib_get_buffer (vm, pi0); - p1 = vlib_get_buffer (vm, pi1); - - if (ip6_to_ip4_tcp_udp (p0, ip6_to_ip4_set_cb, p0, 1)) - { - p0->error = error_node->errors[MAP_ERROR_UNKNOWN]; - next0 = IP6_MAPT_TCP_UDP_NEXT_DROP; - } - else - { - if (vnet_buffer (p0)->map_t.mtu < p0->current_length) - { - //Send to fragmentation node if necessary - vnet_buffer (p0)->ip_frag.mtu = vnet_buffer (p0)->map_t.mtu; - vnet_buffer (p0)->ip_frag.next_index = - IP4_FRAG_NEXT_IP4_LOOKUP; - next0 = IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG; - } - } - - if (ip6_to_ip4_tcp_udp (p1, ip6_to_ip4_set_cb, p1, 1)) - { - p1->error = error_node->errors[MAP_ERROR_UNKNOWN]; - next1 = IP6_MAPT_TCP_UDP_NEXT_DROP; - } - else - { - if (vnet_buffer (p1)->map_t.mtu < p1->current_length) - { - //Send to fragmentation node if necessary - vnet_buffer (p1)->ip_frag.mtu = vnet_buffer (p1)->map_t.mtu; - vnet_buffer (p1)->ip_frag.next_index = - IP4_FRAG_NEXT_IP4_LOOKUP; - next1 = IP6_MAPT_TCP_UDP_NEXT_IP4_FRAG; - } - } - - vlib_validate_buffer_enqueue_x2 (vm, node, next_index, to_next, - n_left_to_next, pi0, pi1, next0, - next1); - } -#endif - while (n_left_from > 0 && n_left_to_next > 0) { u32 pi0; @@ -483,84 +363,6 @@ ip6_map_t_tcp_udp (vlib_main_t * vm, return frame->n_vectors; } -static_always_inline void -ip6_map_t_classify (vlib_buffer_t * p0, ip6_header_t * ip60, - map_domain_t * d0, i32 * src_port0, - u8 * error0, ip6_mapt_next_t * next0, - u32 l4_len0, ip6_frag_hdr_t * frag0) -{ - if (PREDICT_FALSE (vnet_buffer (p0)->map_t.v6.frag_offset && - ip6_frag_hdr_offset (frag0))) - { - *next0 = IP6_MAPT_NEXT_MAPT_FRAGMENTED; - if (d0->ea_bits_len == 0 && d0->rules) - { - *src_port0 = 0; - } - else - { - *src_port0 = ip6_map_fragment_get (ip60, frag0, d0); - *error0 = (*src_port0 != -1) ? *error0 : MAP_ERROR_FRAGMENT_DROPPED; - } - } - else - if (PREDICT_TRUE - (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_TCP)) - { - *error0 = - l4_len0 < sizeof (tcp_header_t) ? MAP_ERROR_MALFORMED : *error0; - vnet_buffer (p0)->map_t.checksum_offset = - vnet_buffer (p0)->map_t.v6.l4_offset + 16; - *next0 = IP6_MAPT_NEXT_MAPT_TCP_UDP; - *src_port0 = - (i32) * - ((u16 *) u8_ptr_add (ip60, vnet_buffer (p0)->map_t.v6.l4_offset)); - } - else - if (PREDICT_TRUE - (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_UDP)) - { - *error0 = - l4_len0 < sizeof (udp_header_t) ? MAP_ERROR_MALFORMED : *error0; - vnet_buffer (p0)->map_t.checksum_offset = - vnet_buffer (p0)->map_t.v6.l4_offset + 6; - *next0 = IP6_MAPT_NEXT_MAPT_TCP_UDP; - *src_port0 = - (i32) * - ((u16 *) u8_ptr_add (ip60, vnet_buffer (p0)->map_t.v6.l4_offset)); - } - else if (vnet_buffer (p0)->map_t.v6.l4_protocol == IP_PROTOCOL_ICMP6) - { - *error0 = - l4_len0 < sizeof (icmp46_header_t) ? MAP_ERROR_MALFORMED : *error0; - *next0 = IP6_MAPT_NEXT_MAPT_ICMP; - if (d0->ea_bits_len == 0 && d0->rules) - { - *src_port0 = 0; - } - else - if (((icmp46_header_t *) - u8_ptr_add (ip60, - vnet_buffer (p0)->map_t.v6.l4_offset))->code == - ICMP6_echo_reply - || ((icmp46_header_t *) - u8_ptr_add (ip60, - vnet_buffer (p0)->map_t.v6.l4_offset))->code == - ICMP6_echo_request) - { - *src_port0 = - (i32) * - ((u16 *) - u8_ptr_add (ip60, vnet_buffer (p0)->map_t.v6.l4_offset + 6)); - } - } - else - { - //TODO: In case of 1:1 mapping, it might be possible to do something with those packets. - *error0 = MAP_ERROR_BAD_PROTOCOL; - } -} - static uword ip6_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { @@ -577,197 +379,6 @@ ip6_map_t (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); -#ifdef IP6_MAP_T_DUAL_LOOP - while (n_left_from >= 4 && n_left_to_next >= 2) - { - u32 pi0, pi1; - vlib_buffer_t *p0, *p1; - ip6_header_t *ip60, *ip61; - u8 error0, error1; - ip6_mapt_next_t next0, next1; - u32 l4_len0, l4_len1; - i32 src_port0, src_port1; - map_domain_t *d0, *d1; - ip6_frag_hdr_t *frag0, *frag1; - u32 saddr0, saddr1; - next0 = next1 = 0; //Because compiler whines - - pi0 = to_next[0] = from[0]; - pi1 = to_next[1] = from[1]; - from += 2; - n_left_from -= 2; - to_next += 2; - n_left_to_next -= 2; - - error0 = MAP_ERROR_NONE; - error1 = MAP_ERROR_NONE; - - p0 = vlib_get_buffer (vm, pi0); - p1 = vlib_get_buffer (vm, pi1); - ip60 = vlib_buffer_get_current (p0); - ip61 = vlib_buffer_get_current (p1); - - saddr0 = 0; /* TODO */ - saddr1 = 0; /* TODO */ - /* NOTE: ip6_map_get_domain currently doesn't utilize second argument */ - - d0 = ip6_map_get_domain (vnet_buffer (p0)->ip.adj_index[VLIB_TX], - (ip4_address_t *) & saddr0, - &vnet_buffer (p0)->map_t.map_domain_index, - &error0); - d1 = - ip6_map_get_domain (vnet_buffer (p1)->ip.adj_index[VLIB_TX], - (ip4_address_t *) & saddr1, - &vnet_buffer (p1)->map_t.map_domain_index, - &error1); - - saddr0 = map_get_ip4 (&ip60->src_address, d0->flags); - saddr1 = map_get_ip4 (&ip61->src_address, d1->flags); - - vnet_buffer (p0)->map_t.v6.saddr = saddr0; - vnet_buffer (p1)->map_t.v6.saddr = saddr1; - vnet_buffer (p0)->map_t.v6.daddr = - ip6_map_t_embedded_address (d0, &ip60->dst_address); - vnet_buffer (p1)->map_t.v6.daddr = - ip6_map_t_embedded_address (d1, &ip61->dst_address); - vnet_buffer (p0)->map_t.mtu = d0->mtu ? d0->mtu : ~0; - vnet_buffer (p1)->map_t.mtu = d1->mtu ? d1->mtu : ~0; - - if (PREDICT_FALSE (ip6_parse (ip60, p0->current_length, - &(vnet_buffer (p0)->map_t. - v6.l4_protocol), - &(vnet_buffer (p0)->map_t. - v6.l4_offset), - &(vnet_buffer (p0)->map_t. - v6.frag_offset)))) - { - error0 = MAP_ERROR_MALFORMED; - next0 = IP6_MAPT_NEXT_DROP; - } - - if (PREDICT_FALSE (ip6_parse (ip61, p1->current_length, - &(vnet_buffer (p1)->map_t. - v6.l4_protocol), - &(vnet_buffer (p1)->map_t. - v6.l4_offset), - &(vnet_buffer (p1)->map_t. - v6.frag_offset)))) - { - error1 = MAP_ERROR_MALFORMED; - next1 = IP6_MAPT_NEXT_DROP; - } - - src_port0 = src_port1 = -1; - l4_len0 = (u32) clib_net_to_host_u16 (ip60->payload_length) + - sizeof (*ip60) - vnet_buffer (p0)->map_t.v6.l4_offset; - l4_len1 = (u32) clib_net_to_host_u16 (ip61->payload_length) + - sizeof (*ip60) - vnet_buffer (p1)->map_t.v6.l4_offset; - frag0 = - (ip6_frag_hdr_t *) u8_ptr_add (ip60, - vnet_buffer (p0)->map_t. - v6.frag_offset); - frag1 = - (ip6_frag_hdr_t *) u8_ptr_add (ip61, - vnet_buffer (p1)->map_t. - v6.frag_offset); - - ip6_map_t_classify (p0, ip60, d0, &src_port0, &error0, &next0, - l4_len0, frag0); - ip6_map_t_classify (p1, ip61, d1, &src_port1, &error1, &next1, - l4_len1, frag1); - - if (PREDICT_FALSE - ((src_port0 != -1) - && (ip60->src_address.as_u64[0] != - map_get_pfx_net (d0, vnet_buffer (p0)->map_t.v6.saddr, - src_port0) - || ip60->src_address.as_u64[1] != map_get_sfx_net (d0, - vnet_buffer - (p0)->map_t.v6.saddr, - src_port0)))) - { - error0 = MAP_ERROR_SEC_CHECK; - } - - if (PREDICT_FALSE - ((src_port1 != -1) - && (ip61->src_address.as_u64[0] != - map_get_pfx_net (d1, vnet_buffer (p1)->map_t.v6.saddr, - src_port1) - || ip61->src_address.as_u64[1] != map_get_sfx_net (d1, - vnet_buffer - (p1)->map_t.v6.saddr, - src_port1)))) - { - error1 = MAP_ERROR_SEC_CHECK; - } - - if (PREDICT_FALSE (vnet_buffer (p0)->map_t.v6.frag_offset && - !ip6_frag_hdr_offset ((ip6_frag_hdr_t *) - u8_ptr_add (ip60, - vnet_buffer - (p0)->map_t. - v6.frag_offset))) - && (src_port0 != -1) && (d0->ea_bits_len != 0 || !d0->rules) - && (error0 == MAP_ERROR_NONE)) - { - ip6_map_fragment_cache (ip60, - (ip6_frag_hdr_t *) u8_ptr_add (ip60, - vnet_buffer - (p0)->map_t. - v6.frag_offset), - d0, src_port0); - } - - if (PREDICT_FALSE (vnet_buffer (p1)->map_t.v6.frag_offset && - !ip6_frag_hdr_offset ((ip6_frag_hdr_t *) - u8_ptr_add (ip61, - vnet_buffer - (p1)->map_t. - v6.frag_offset))) - && (src_port1 != -1) && (d1->ea_bits_len != 0 || !d1->rules) - && (error1 == MAP_ERROR_NONE)) - { - ip6_map_fragment_cache (ip61, - (ip6_frag_hdr_t *) u8_ptr_add (ip61, - vnet_buffer - (p1)->map_t. - v6.frag_offset), - d1, src_port1); - } - - if (PREDICT_TRUE - (error0 == MAP_ERROR_NONE && next0 != IP6_MAPT_NEXT_MAPT_ICMP)) - { - vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX, - thread_index, - vnet_buffer (p0)-> - map_t.map_domain_index, 1, - clib_net_to_host_u16 - (ip60->payload_length)); - } - - if (PREDICT_TRUE - (error1 == MAP_ERROR_NONE && next1 != IP6_MAPT_NEXT_MAPT_ICMP)) - { - vlib_increment_combined_counter (cm + MAP_DOMAIN_COUNTER_RX, - thread_index, - vnet_buffer (p1)-> - map_t.map_domain_index, 1, - clib_net_to_host_u16 - (ip61->payload_length)); - } - - next0 = (error0 != MAP_ERROR_NONE) ? IP6_MAPT_NEXT_DROP : next0; - next1 = (error1 != MAP_ERROR_NONE) ? IP6_MAPT_NEXT_DROP : next1; - p0->error = error_node->errors[error0]; - p1->error = error_node->errors[error1]; - vlib_validate_buffer_enqueue_x2 (vm, node, next_index, to_next, - n_left_to_next, pi0, pi1, next0, - next1); - } -#endif - while (n_left_from > 0 && n_left_to_next > 0) { u32 pi0; |