Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
MAP: Use explicit address/prefix types in API
[vpp.git]
/
src
/
plugins
/
map
/
ip6_map.c
diff --git
a/src/plugins/map/ip6_map.c
b/src/plugins/map/ip6_map.c
index
5cdd9d9
..
35b5811
100644
(file)
--- a/
src/plugins/map/ip6_map.c
+++ b/
src/plugins/map/ip6_map.c
@@
-174,7
+174,7
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
vlib_node_get_runtime (vm, ip6_map_node.index);
map_main_t *mm = &map_main;
vlib_combined_counter_main_t *cm = mm->domain_counters;
vlib_node_get_runtime (vm, ip6_map_node.index);
map_main_t *mm = &map_main;
vlib_combined_counter_main_t *cm = mm->domain_counters;
- u32 thread_index = v
lib_get_thread_index ()
;
+ u32 thread_index = v
m->thread_index
;
from = vlib_frame_vector_args (frame);
n_left_from = frame->n_vectors;
from = vlib_frame_vector_args (frame);
n_left_from = frame->n_vectors;
@@
-308,7
+308,6
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
(d0->mtu
&& (clib_host_to_net_u16 (ip40->length) > d0->mtu)))
{
(d0->mtu
&& (clib_host_to_net_u16 (ip40->length) > d0->mtu)))
{
- vnet_buffer (p0)->ip_frag.header_offset = 0;
vnet_buffer (p0)->ip_frag.flags = 0;
vnet_buffer (p0)->ip_frag.next_index =
IP4_FRAG_NEXT_IP4_LOOKUP;
vnet_buffer (p0)->ip_frag.flags = 0;
vnet_buffer (p0)->ip_frag.next_index =
IP4_FRAG_NEXT_IP4_LOOKUP;
@@
-341,7
+340,6
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
(d1->mtu
&& (clib_host_to_net_u16 (ip41->length) > d1->mtu)))
{
(d1->mtu
&& (clib_host_to_net_u16 (ip41->length) > d1->mtu)))
{
- vnet_buffer (p1)->ip_frag.header_offset = 0;
vnet_buffer (p1)->ip_frag.flags = 0;
vnet_buffer (p1)->ip_frag.next_index =
IP4_FRAG_NEXT_IP4_LOOKUP;
vnet_buffer (p1)->ip_frag.flags = 0;
vnet_buffer (p1)->ip_frag.next_index =
IP4_FRAG_NEXT_IP4_LOOKUP;
@@
-495,7
+493,6
@@
ip6_map (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
(d0->mtu
&& (clib_host_to_net_u16 (ip40->length) > d0->mtu)))
{
(d0->mtu
&& (clib_host_to_net_u16 (ip40->length) > d0->mtu)))
{
- vnet_buffer (p0)->ip_frag.header_offset = 0;
vnet_buffer (p0)->ip_frag.flags = 0;
vnet_buffer (p0)->ip_frag.next_index =
IP4_FRAG_NEXT_IP4_LOOKUP;
vnet_buffer (p0)->ip_frag.flags = 0;
vnet_buffer (p0)->ip_frag.next_index =
IP4_FRAG_NEXT_IP4_LOOKUP;
@@
-586,7
+583,7
@@
ip6_map_ip6_reass_prepare (vlib_main_t * vm, vlib_node_runtime_t * node,
if (ip6_frag_hdr_offset (frag0))
{
//Not first fragment, add the IPv4 header
if (ip6_frag_hdr_offset (frag0))
{
//Not first fragment, add the IPv4 header
- clib_memcpy (ip40, &r->ip4_header, 20);
+ clib_memcpy
_fast
(ip40, &r->ip4_header, 20);
}
#ifdef MAP_IP6_REASS_COUNT_BYTES
}
#ifdef MAP_IP6_REASS_COUNT_BYTES
@@
-597,8
+594,8
@@
ip6_map_ip6_reass_prepare (vlib_main_t * vm, vlib_node_runtime_t * node,
if (ip6_frag_hdr_more (frag0))
{
//Not last fragment, we copy end of next
if (ip6_frag_hdr_more (frag0))
{
//Not last fragment, we copy end of next
- clib_memcpy (u8_ptr_add (ip60, p0->current_length),
- r->fragments[i].next_data, 20);
+ clib_memcpy
_fast
(u8_ptr_add (ip60, p0->current_length),
+
r->fragments[i].next_data, 20);
p0->current_length += 20;
ip60->payload_length = u16_net_add (ip60->payload_length, 20);
}
p0->current_length += 20;
ip60->payload_length = u16_net_add (ip60->payload_length, 20);
}
@@
-825,7
+822,7
@@
ip6_map_ip4_reass (vlib_main_t * vm,
vlib_node_get_runtime (vm, ip6_map_ip4_reass_node.index);
map_main_t *mm = &map_main;
vlib_combined_counter_main_t *cm = mm->domain_counters;
vlib_node_get_runtime (vm, ip6_map_ip4_reass_node.index);
map_main_t *mm = &map_main;
vlib_combined_counter_main_t *cm = mm->domain_counters;
- u32 thread_index = v
lib_get_thread_index ()
;
+ u32 thread_index = v
m->thread_index
;
u32 *fragments_to_drop = NULL;
u32 *fragments_to_loopback = NULL;
u32 *fragments_to_drop = NULL;
u32 *fragments_to_loopback = NULL;
@@
-935,7
+932,6
@@
ip6_map_ip4_reass (vlib_main_t * vm,
(d0->mtu && (clib_host_to_net_u16 (ip40->length) > d0->mtu)
&& error0 == MAP_ERROR_NONE && !cached))
{
(d0->mtu && (clib_host_to_net_u16 (ip40->length) > d0->mtu)
&& error0 == MAP_ERROR_NONE && !cached))
{
- vnet_buffer (p0)->ip_frag.header_offset = 0;
vnet_buffer (p0)->ip_frag.flags = 0;
vnet_buffer (p0)->ip_frag.next_index = IP4_FRAG_NEXT_IP4_LOOKUP;
vnet_buffer (p0)->ip_frag.mtu = d0->mtu;
vnet_buffer (p0)->ip_frag.flags = 0;
vnet_buffer (p0)->ip_frag.next_index = IP4_FRAG_NEXT_IP4_LOOKUP;
vnet_buffer (p0)->ip_frag.mtu = d0->mtu;
@@
-980,17
+976,16
@@
ip6_map_ip4_reass (vlib_main_t * vm,
u32 len = vec_len (fragments_to_loopback);
if (len <= VLIB_FRAME_SIZE)
{
u32 len = vec_len (fragments_to_loopback);
if (len <= VLIB_FRAME_SIZE)
{
- clib_memcpy (from, fragments_to_loopback,
- sizeof (u32) * len);
+ clib_memcpy
_fast
(from, fragments_to_loopback,
+
sizeof (u32) * len);
n_left_from = len;
vec_reset_length (fragments_to_loopback);
}
else
{
n_left_from = len;
vec_reset_length (fragments_to_loopback);
}
else
{
- clib_memcpy (from,
- fragments_to_loopback + (len -
- VLIB_FRAME_SIZE),
- sizeof (u32) * VLIB_FRAME_SIZE);
+ clib_memcpy_fast (from, fragments_to_loopback +
+ (len - VLIB_FRAME_SIZE),
+ sizeof (u32) * VLIB_FRAME_SIZE);
n_left_from = VLIB_FRAME_SIZE;
_vec_len (fragments_to_loopback) = len - VLIB_FRAME_SIZE;
}
n_left_from = VLIB_FRAME_SIZE;
_vec_len (fragments_to_loopback) = len - VLIB_FRAME_SIZE;
}
@@
-1018,7
+1013,7
@@
ip6_map_icmp_relay (vlib_main_t * vm,
vlib_node_runtime_t *error_node =
vlib_node_get_runtime (vm, ip6_map_icmp_relay_node.index);
map_main_t *mm = &map_main;
vlib_node_runtime_t *error_node =
vlib_node_get_runtime (vm, ip6_map_icmp_relay_node.index);
map_main_t *mm = &map_main;
- u32 thread_index = v
lib_get_thread_index ()
;
+ u32 thread_index = v
m->thread_index
;
u16 *fragment_ids, *fid;
from = vlib_frame_vector_args (frame);
u16 *fragment_ids, *fid;
from = vlib_frame_vector_args (frame);