aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-12-14 15:42:45 -0500
committerDave Barach <openvpp@barachs.net>2016-12-15 14:29:10 +0000
commitcc53285baf2c3a45b95e22dd66c8592d634568ee (patch)
tree649e864d9dfa163e7707a7fcbf9ac937cbe50852
parentfb9931ff1687e79461df5f92210d81d96fffa3ad (diff)
Expand ethernet-input node speed-path for non-L2 paths
Improve ethernet-input speed path for untagged packets to also handle L3 and other forwarding paths. In the IP4 forwarding path for untagged IP4 packets, per packet clock count in ethernet-input node is reduced to ~14 clocks from ~43 clocks. Change-Id: I8e6f121820e056d6085dff3eb95d6913fc422f99 Signed-off-by: John Lo <loj@cisco.com>
-rwxr-xr-xvnet/vnet/ethernet/node.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/vnet/vnet/ethernet/node.c b/vnet/vnet/ethernet/node.c
index 5a27fd0c750..c48e3f4237b 100755
--- a/vnet/vnet/ethernet/node.c
+++ b/vnet/vnet/ethernet/node.c
@@ -369,7 +369,7 @@ ethernet_input_inline (vlib_main_t * vm,
e1 = vlib_buffer_get_current (b1);
type1 = clib_net_to_host_u16 (e1->type);
- /* Speed-path for the untagged L2 case */
+ /* Speed-path for the untagged case */
if (PREDICT_TRUE (variant == ETHERNET_INPUT_VARIANT_ETHERNET
&& !ethernet_frame_is_tagged (type0)
&& !ethernet_frame_is_tagged (type1)))
@@ -404,12 +404,21 @@ ethernet_input_inline (vlib_main_t * vm,
vnet_buffer (b1)->l2.l2_len = sizeof (ethernet_header_t);
vnet_buffer (b1)->ethernet.start_of_ethernet_header =
b1->current_data;
- goto ship_it01;
}
- /* FALLTHROUGH into the general case */
+ else
+ {
+ determine_next_node (em, variant, 0, type0, b0,
+ &error0, &next0);
+ vlib_buffer_advance (b0, sizeof (ethernet_header_t));
+ determine_next_node (em, variant, 0, type1, b1,
+ &error1, &next1);
+ vlib_buffer_advance (b1, sizeof (ethernet_header_t));
+ }
+ goto ship_it01;
}
- slowpath:
+ /* Slow-path for the tagged case */
+ slowpath:
parse_header (variant,
b0,
&type0,
@@ -578,7 +587,7 @@ ethernet_input_inline (vlib_main_t * vm,
e0 = vlib_buffer_get_current (b0);
type0 = clib_net_to_host_u16 (e0->type);
- /* Speed-path for the untagged L2 case */
+ /* Speed-path for the untagged case */
if (PREDICT_TRUE (variant == ETHERNET_INPUT_VARIANT_ETHERNET
&& !ethernet_frame_is_tagged (type0)))
{
@@ -603,11 +612,17 @@ ethernet_input_inline (vlib_main_t * vm,
vnet_buffer (b0)->l2.l2_len = sizeof (ethernet_header_t);
vnet_buffer (b0)->ethernet.start_of_ethernet_header =
b0->current_data;
- goto ship_it0;
}
- /* FALLTHROUGH into the general case */
+ else
+ {
+ determine_next_node (em, variant, 0, type0, b0,
+ &error0, &next0);
+ vlib_buffer_advance (b0, sizeof (ethernet_header_t));
+ }
+ goto ship_it0;
}
+ /* Slow-path for the tagged case */
parse_header (variant,
b0,
&type0,