From 7714b300285a9ebd075819075e977f96b2ba7676 Mon Sep 17 00:00:00 2001 From: John Lo Date: Tue, 20 Dec 2016 16:59:02 -0500 Subject: Always set start_of_ethernet_header in ethernet-input speed path The speed path of ethernet-input node is setting the packet context field start_of_ethernet_header for L2 only. This is also needed for L3 path because of IPv4 ARP processing which need to know the start of ethernet header of the incoming ARP packet. Change-Id: I98ee88c482f8536e4fccc0b8afcb8811d63f4435 Signed-off-by: John Lo --- vnet/vnet/ethernet/node.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vnet/vnet/ethernet/node.c b/vnet/vnet/ethernet/node.c index c48e3f4237b..6d57da31708 100755 --- a/vnet/vnet/ethernet/node.c +++ b/vnet/vnet/ethernet/node.c @@ -394,16 +394,18 @@ ethernet_input_inline (vlib_main_t * vm, subint0 = &intf0->untagged_subint; cached_is_l2 = is_l20 = subint0->flags & SUBINT_CONFIG_L2; } + + vnet_buffer (b0)->ethernet.start_of_ethernet_header = + b0->current_data; + vnet_buffer (b1)->ethernet.start_of_ethernet_header = + b1->current_data; + if (PREDICT_TRUE (is_l20 != 0)) { next0 = em->l2_next; vnet_buffer (b0)->l2.l2_len = sizeof (ethernet_header_t); - vnet_buffer (b0)->ethernet.start_of_ethernet_header = - b0->current_data; next1 = em->l2_next; vnet_buffer (b1)->l2.l2_len = sizeof (ethernet_header_t); - vnet_buffer (b1)->ethernet.start_of_ethernet_header = - b1->current_data; } else { @@ -606,12 +608,14 @@ ethernet_input_inline (vlib_main_t * vm, subint0 = &intf0->untagged_subint; cached_is_l2 = is_l20 = subint0->flags & SUBINT_CONFIG_L2; } + + vnet_buffer (b0)->ethernet.start_of_ethernet_header = + b0->current_data; + if (PREDICT_TRUE (is_l20 != 0)) { next0 = em->l2_next; vnet_buffer (b0)->l2.l2_len = sizeof (ethernet_header_t); - vnet_buffer (b0)->ethernet.start_of_ethernet_header = - b0->current_data; } else { -- cgit 1.2.3-korg