summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-12-09 18:52:05 +0100
committerDave Barach <openvpp@barachs.net>2016-12-09 21:43:23 +0000
commit892e076a1e56253414f2fd69f16a0349b6759485 (patch)
treeb813dfcf62222e08e6034687ab013f7fcefdd311
parent5929085918f8fdc3d2eac84cb69523fc383bdc87 (diff)
ip4: perf optimization in the ip4-rewrite node
This change shows around 7% improvement in ip4 path when ip4-output features are not used. Change-Id: I81c1c4c38c99fff0ad8270d3c0df907acf1d8c58 Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/ip/ip4_forward.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index 27f2ece83c3..c743139c5b0 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -931,10 +931,9 @@ ip4_add_del_interface_address (vlib_main_t * vm, u32 sw_if_index,
VNET_FEATURE_ARC_INIT (ip4_unicast, static) =
{
.arc_name = "ip4-unicast",
- .start_nodes =
- VNET_FEATURES ("ip4-input", "ip4-input-no-checksum"),
- .arc_index_ptr =
- &ip4_main.lookup_main.ucast_feature_arc_index,};
+ .start_nodes = VNET_FEATURES ("ip4-input", "ip4-input-no-checksum"),
+ .arc_index_ptr = &ip4_main.lookup_main.ucast_feature_arc_index,
+};
VNET_FEATURE_INIT (ip4_flow_classify, static) =
{
@@ -1048,6 +1047,7 @@ VNET_FEATURE_ARC_INIT (ip4_output, static) =
{
.arc_name = "ip4-output",
.start_nodes = VNET_FEATURES ("ip4-rewrite", "ip4-midchain"),
+ .end_node = "interface-output",
.arc_index_ptr = &ip4_main.lookup_main.output_feature_arc_index,
};
@@ -1088,9 +1088,6 @@ ip4_sw_interface_add_del (vnet_main_t * vnm, u32 sw_if_index, u32 is_add)
vnet_feature_enable_disable ("ip4-multicast", "ip4-drop", sw_if_index,
is_add, 0, 0);
- vnet_feature_enable_disable ("ip4-output", "interface-output", sw_if_index,
- is_add, 0, 0);
-
return /* no error */ 0;
}
@@ -2395,12 +2392,6 @@ ip4_rewrite_inline (vlib_main_t * vm,
rewrite_header.max_l3_packet_bytes ? IP4_ERROR_MTU_EXCEEDED :
error1);
- next0 = (error0 == IP4_ERROR_NONE)
- ? adj0[0].rewrite_header.next_index : next0;
-
- next1 = (error1 == IP4_ERROR_NONE)
- ? adj1[0].rewrite_header.next_index : next1;
-
/*
* We've already accounted for an ethernet_header_t elsewhere
*/
@@ -2420,6 +2411,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
* to see the IP headerr */
if (PREDICT_TRUE (error0 == IP4_ERROR_NONE))
{
+ next0 = adj0[0].rewrite_header.next_index;
p0->current_data -= rw_len0;
p0->current_length += rw_len0;
tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
@@ -2430,6 +2422,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
}
if (PREDICT_TRUE (error1 == IP4_ERROR_NONE))
{
+ next1 = adj1[0].rewrite_header.next_index;
p1->current_data -= rw_len1;
p1->current_length += rw_len1;