Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove useless prefetch in ip4-rewrite node
[vpp.git]
/
src
/
vnet
/
ip
/
ip4_forward.c
diff --git
a/src/vnet/ip/ip4_forward.c
b/src/vnet/ip/ip4_forward.c
index
4fdedc1
..
1911f08
100644
(file)
--- a/
src/vnet/ip/ip4_forward.c
+++ b/
src/vnet/ip/ip4_forward.c
@@
-123,9
+123,6
@@
VLIB_NODE_FN (ip4_load_balance_node) (vlib_main_t * vm,
n_left_from = frame->n_vectors;
next = node->cached_next_index;
n_left_from = frame->n_vectors;
next = node->cached_next_index;
- if (node->flags & VLIB_NODE_FLAG_TRACE)
- ip4_forward_next_trace (vm, node, frame, VLIB_TX);
-
while (n_left_from > 0)
{
vlib_get_next_frame (vm, node, next, to_next, n_left_to_next);
while (n_left_from > 0)
{
vlib_get_next_frame (vm, node, next, to_next, n_left_to_next);
@@
-294,6
+291,9
@@
VLIB_NODE_FN (ip4_load_balance_node) (vlib_main_t * vm,
vlib_put_next_frame (vm, node, next, n_left_to_next);
}
vlib_put_next_frame (vm, node, next, n_left_to_next);
}
+ if (node->flags & VLIB_NODE_FLAG_TRACE)
+ ip4_forward_next_trace (vm, node, frame, VLIB_TX);
+
return frame->n_vectors;
}
return frame->n_vectors;
}
@@
-711,6
+711,7
@@
VNET_FEATURE_ARC_INIT (ip4_unicast, static) =
{
.arc_name = "ip4-unicast",
.start_nodes = VNET_FEATURES ("ip4-input", "ip4-input-no-checksum"),
{
.arc_name = "ip4-unicast",
.start_nodes = VNET_FEATURES ("ip4-input", "ip4-input-no-checksum"),
+ .last_in_arc = "ip4-lookup",
.arc_index_ptr = &ip4_main.lookup_main.ucast_feature_arc_index,
};
.arc_index_ptr = &ip4_main.lookup_main.ucast_feature_arc_index,
};
@@
-796,6
+797,7
@@
VNET_FEATURE_ARC_INIT (ip4_multicast, static) =
{
.arc_name = "ip4-multicast",
.start_nodes = VNET_FEATURES ("ip4-input", "ip4-input-no-checksum"),
{
.arc_name = "ip4-multicast",
.start_nodes = VNET_FEATURES ("ip4-input", "ip4-input-no-checksum"),
+ .last_in_arc = "ip4-mfib-forward-lookup",
.arc_index_ptr = &ip4_main.lookup_main.mcast_feature_arc_index,
};
.arc_index_ptr = &ip4_main.lookup_main.mcast_feature_arc_index,
};
@@
-825,6
+827,7
@@
VNET_FEATURE_ARC_INIT (ip4_output, static) =
{
.arc_name = "ip4-output",
.start_nodes = VNET_FEATURES ("ip4-rewrite", "ip4-midchain", "ip4-dvr-dpo"),
{
.arc_name = "ip4-output",
.start_nodes = VNET_FEATURES ("ip4-rewrite", "ip4-midchain", "ip4-dvr-dpo"),
+ .last_in_arc = "interface-output",
.arc_index_ptr = &ip4_main.lookup_main.output_feature_arc_index,
};
.arc_index_ptr = &ip4_main.lookup_main.output_feature_arc_index,
};
@@
-1072,9
+1075,9
@@
ip4_forward_next_trace (vlib_main_t * vm,
vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (b0)->sw_if_index[VLIB_RX]);
vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (b0)->sw_if_index[VLIB_RX]);
- clib_memcpy (t0->packet_data,
- vlib_buffer_get_current (b0),
- sizeof (t0->packet_data));
+ clib_memcpy
_fast
(t0->packet_data,
+
vlib_buffer_get_current (b0),
+
sizeof (t0->packet_data));
}
if (b1->flags & VLIB_BUFFER_IS_TRACED)
{
}
if (b1->flags & VLIB_BUFFER_IS_TRACED)
{
@@
-1086,8
+1089,8
@@
ip4_forward_next_trace (vlib_main_t * vm,
(u32) ~ 0) ? vnet_buffer (b1)->sw_if_index[VLIB_TX] :
vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (b1)->sw_if_index[VLIB_RX]);
(u32) ~ 0) ? vnet_buffer (b1)->sw_if_index[VLIB_TX] :
vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (b1)->sw_if_index[VLIB_RX]);
- clib_memcpy (t1->packet_data, vlib_buffer_get_current (b1),
- sizeof (t1->packet_data));
+ clib_memcpy
_fast
(t1->packet_data, vlib_buffer_get_current (b1),
+
sizeof (t1->packet_data));
}
from += 2;
n_left -= 2;
}
from += 2;
n_left -= 2;
@@
-1113,8
+1116,8
@@
ip4_forward_next_trace (vlib_main_t * vm,
(u32) ~ 0) ? vnet_buffer (b0)->sw_if_index[VLIB_TX] :
vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (b0)->sw_if_index[VLIB_RX]);
(u32) ~ 0) ? vnet_buffer (b0)->sw_if_index[VLIB_TX] :
vec_elt (im->fib_index_by_sw_if_index,
vnet_buffer (b0)->sw_if_index[VLIB_RX]);
- clib_memcpy (t0->packet_data, vlib_buffer_get_current (b0),
- sizeof (t0->packet_data));
+ clib_memcpy
_fast
(t0->packet_data, vlib_buffer_get_current (b0),
+
sizeof (t0->packet_data));
}
from += 1;
n_left -= 1;
}
from += 1;
n_left -= 1;
@@
-1212,6
+1215,7
@@
VNET_FEATURE_ARC_INIT (ip4_local) =
{
.arc_name = "ip4-local",
.start_nodes = VNET_FEATURES ("ip4-local"),
{
.arc_name = "ip4-local",
.start_nodes = VNET_FEATURES ("ip4-local"),
+ .last_in_arc = "ip4-local-end-of-arc",
};
/* *INDENT-ON* */
};
/* *INDENT-ON* */
@@
-1852,9
+1856,9
@@
ip4_arp_inline (vlib_main_t * vm,
hw_if0 = vnet_get_sup_hw_interface (vnm, sw_if_index0);
/* Src ethernet address in ARP header. */
hw_if0 = vnet_get_sup_hw_interface (vnm, sw_if_index0);
/* Src ethernet address in ARP header. */
- clib_memcpy (h0->ip4_over_ethernet[0].ethernet,
- hw_if0->hw_address,
- sizeof (h0->ip4_over_ethernet[0].ethernet));
+ clib_memcpy
_fast
(h0->ip4_over_ethernet[0].ethernet,
+
hw_if0->hw_address,
+
sizeof (h0->ip4_over_ethernet[0].ethernet));
if (is_glean)
{
/* The interface's source address is stashed in the Glean Adj */
if (is_glean)
{
/* The interface's source address is stashed in the Glean Adj */
@@
-2027,8
+2031,8
@@
ip4_probe_neighbor (vlib_main_t * vm, ip4_address_t * dst, u32 sw_if_index,
sw_if_index);
}
sw_if_index);
}
- clib_memcpy (h->ip4_over_ethernet[0].ethernet, hi->hw_address,
- sizeof (h->ip4_over_ethernet[0].ethernet));
+ clib_memcpy
_fast
(h->ip4_over_ethernet[0].ethernet, hi->hw_address,
+
sizeof (h->ip4_over_ethernet[0].ethernet));
h->ip4_over_ethernet[0].ip4 = src[0];
h->ip4_over_ethernet[1].ip4 = dst[0];
h->ip4_over_ethernet[0].ip4 = src[0];
h->ip4_over_ethernet[1].ip4 = dst[0];
@@
-2193,7
+2197,7
@@
ip4_rewrite_inline (vlib_main_t * vm,
if (n_left_from >= 6)
{
int i;
if (n_left_from >= 6)
{
int i;
- for (i =
0
; i < 6; i++)
+ for (i =
2
; i < 6; i++)
vlib_prefetch_buffer_header (bufs[i], LOAD);
}
vlib_prefetch_buffer_header (bufs[i], LOAD);
}