Always set start_of_ethernet_header in ethernet-input speed path 37/4437/2
authorJohn Lo <loj@cisco.com>
Tue, 20 Dec 2016 21:59:02 +0000 (16:59 -0500)
committerJohn Lo <loj@cisco.com>
Tue, 20 Dec 2016 22:13:31 +0000 (17:13 -0500)
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 <loj@cisco.com>
vnet/vnet/ethernet/node.c

index c48e3f4..6d57da3 100755 (executable)
@@ -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
                {