diff --git a/src/vnet.am b/src/vnet.am
index baddaf3..b9ff17d 100644
--- a/src/vnet.am
+++ b/src/vnet.am
@@ -260,6 +260,9 @@
   vnet/vxlan/vxlan_error.def			\
   vnet/vxlan/vxlan.api.h
 
+libvnet_multiversioning_sources +=		\
+  vnet/vxlan/decap.c
+
 API_FILES += vnet/vxlan/vxlan.api
 
 ########################################
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index 491b8b9..9f36e67 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -264,6 +264,8 @@
   vxlan/vxlan_error.def
 )
 
+list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
+
 list(APPEND VNET_API_FILES vxlan/vxlan.api)
 
 ##############################################################################
diff --git a/src/vnet/vxlan/decap.c b/src/vnet/vxlan/decap.c
index ad23f0a..7c1b6b1 100644
--- a/src/vnet/vxlan/decap.c
+++ b/src/vnet/vxlan/decap.c
@@ -19,8 +19,10 @@
 #include <vnet/pg/pg.h>
 #include <vnet/vxlan/vxlan.h>
 
+#ifndef CLIB_MARCH_VARIANT
 vlib_node_registration_t vxlan4_input_node;
 vlib_node_registration_t vxlan6_input_node;
+#endif
 
 typedef struct
 {
@@ -76,7 +78,10 @@
       int rv =
 	clib_bihash_search_inline_16_8 (&vxm->vxlan4_tunnel_by_key, &key4);
       if (PREDICT_FALSE (rv != 0))
-	return 0;
+	{
+	  *stats_t0 = 0;
+	  return 0;
+	}
 
       *cache = key4;
     }
@@ -89,14 +94,20 @@
     {
       /* try multicast */
       if (PREDICT_TRUE (!ip4_address_is_multicast (&ip4_0->dst_address)))
-	return 0;
+	{
+	  *stats_t0 = 0;
+	  return 0;
+	}
 
       key4.key[0] = ip4_0->dst_address.as_u32;
       /* Make sure mcast VXLAN tunnel exist by packet DIP and VNI */
       int rv =
 	clib_bihash_search_inline_16_8 (&vxm->vxlan4_tunnel_by_key, &key4);
       if (PREDICT_FALSE (rv != 0))
-	return 0;
+	{
+	  *stats_t0 = 0;
+	  return 0;
+	}
 
       *stats_t0 = pool_elt_at_index (vxm->tunnels, key4.value);
     }
@@ -126,7 +137,10 @@
       int rv =
 	clib_bihash_search_inline_24_8 (&vxm->vxlan6_tunnel_by_key, &key6);
       if (PREDICT_FALSE (rv != 0))
-	return 0;
+	{
+	  *stats_t0 = 0;
+	  return 0;
+	}
 
       *cache = key6;
     }
@@ -139,7 +153,10 @@
     {
       /* try multicast */
       if (PREDICT_TRUE (!ip6_address_is_multicast (&ip6_0->dst_address)))
-	return 0;
+	{
+	  *stats_t0 = 0;
+	  return 0;
+	}
 
       /* Make sure mcast VXLAN tunnel exist by packet DIP and VNI */
       key6.key[0] = ip6_0->dst_address.as_u64[0];
@@ -147,7 +164,10 @@
       int rv =
 	clib_bihash_search_inline_24_8 (&vxm->vxlan6_tunnel_by_key, &key6);
       if (PREDICT_FALSE (rv != 0))
-	return 0;
+	{
+	  *stats_t0 = 0;
+	  return 0;
+	}
 
       *stats_t0 = pool_elt_at_index (vxm->tunnels, key6.value);
     }
@@ -169,7 +189,7 @@
     im->combined_sw_if_counters + VNET_INTERFACE_COUNTER_DROP;
   last_tunnel_cache4 last4;
   last_tunnel_cache6 last6;
-  u32 pkts_decapsulated = 0;
+  u32 pkts_dropped = 0;
   u32 thread_index = vlib_get_thread_index ();
 
   if (is_ip4)
@@ -177,285 +197,240 @@
   else
     memset (&last6, 0xff, sizeof last6);
 
-  u32 next_index = node->cached_next_index;
-
   u32 *from = vlib_frame_vector_args (from_frame);
   u32 n_left_from = from_frame->n_vectors;
 
+  vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b = bufs;
+  vlib_get_buffers (vm, from, bufs, n_left_from);
+
+  u16 nexts[VLIB_FRAME_SIZE], *next = nexts;
+  while (n_left_from >= 4)
+    {
+      /* Prefetch next iteration. */
+      vlib_prefetch_buffer_header (b[2], LOAD);
+      vlib_prefetch_buffer_header (b[3], LOAD);
+
+      /* udp leaves current_data pointing at the vxlan header */
+      void *cur0 = vlib_buffer_get_current (b[0]);
+      void *cur1 = vlib_buffer_get_current (b[1]);
+      vxlan_header_t *vxlan0 = cur0;
+      vxlan_header_t *vxlan1 = cur1;
+
+      u8 error0 = vxlan0->flags != VXLAN_FLAGS_I ? VXLAN_ERROR_BAD_FLAGS : 0;
+      u8 error1 = vxlan1->flags != VXLAN_FLAGS_I ? VXLAN_ERROR_BAD_FLAGS : 0;
+
+      ip4_header_t *ip4_0, *ip4_1;
+      ip6_header_t *ip6_0, *ip6_1;
+      if (is_ip4)
+	{
+	  ip4_0 = cur0 - sizeof (udp_header_t) - sizeof (ip4_header_t);
+	  ip4_1 = cur1 - sizeof (udp_header_t) - sizeof (ip4_header_t);
+	}
+      else
+	{
+	  ip6_0 = cur0 - sizeof (udp_header_t) - sizeof (ip6_header_t);
+	  ip6_1 = cur1 - sizeof (udp_header_t) - sizeof (ip6_header_t);
+	}
+
+      /* pop vxlan */
+      vlib_buffer_advance (b[0], sizeof *vxlan0);
+      vlib_buffer_advance (b[1], sizeof *vxlan1);
+
+      u32 fi0 = buf_fib_index (b[0], is_ip4);
+      u32 fi1 = buf_fib_index (b[1], is_ip4);
+
+      vxlan_tunnel_t *t0, *stats_t0;
+      vxlan_tunnel_t *t1, *stats_t1;
+      if (is_ip4)
+	{
+	  t0 =
+	    vxlan4_find_tunnel (vxm, &last4, fi0, ip4_0, vxlan0, &stats_t0);
+	  t1 =
+	    vxlan4_find_tunnel (vxm, &last4, fi1, ip4_1, vxlan1, &stats_t1);
+	}
+      else
+	{
+	  t0 =
+	    vxlan6_find_tunnel (vxm, &last6, fi0, ip6_0, vxlan0, &stats_t0);
+	  t1 =
+	    vxlan6_find_tunnel (vxm, &last6, fi1, ip6_1, vxlan1, &stats_t1);
+	}
+
+      error0 = t0 == 0 ? VXLAN_ERROR_NO_SUCH_TUNNEL : error0;
+      error1 = t1 == 0 ? VXLAN_ERROR_NO_SUCH_TUNNEL : error1;
+
+      /* Prefetch next iteration. */
+      CLIB_PREFETCH (b[2]->data, CLIB_CACHE_LINE_BYTES, LOAD);
+      CLIB_PREFETCH (b[3]->data, CLIB_CACHE_LINE_BYTES, LOAD);
+
+      u32 len0 = vlib_buffer_length_in_chain (vm, b[0]);
+      u32 len1 = vlib_buffer_length_in_chain (vm, b[1]);
+
+      /* Validate VXLAN tunnel encap-fib index agaist packet */
+      if (PREDICT_FALSE (error0 != 0))
+	{
+	  next[0] = VXLAN_INPUT_NEXT_DROP;
+
+	  if (error0 == VXLAN_ERROR_BAD_FLAGS)
+	    {
+	      vlib_increment_combined_counter
+		(drop_counter, thread_index, stats_t0->sw_if_index, 1, len0);
+	    }
+	  b[0]->error = node->errors[error0];
+	  pkts_dropped++;
+	}
+      else
+	{
+	  next[0] = t0->decap_next_index;
+
+	  /* Required to make the l2 tag push / pop code work on l2 subifs */
+	  if (PREDICT_TRUE (next[0] == VXLAN_INPUT_NEXT_L2_INPUT))
+	    vnet_update_l2_len (b[0]);
+
+	  /* Set packet input sw_if_index to unicast VXLAN tunnel for learning */
+	  vnet_buffer (b[0])->sw_if_index[VLIB_RX] = t0->sw_if_index;
+	  vlib_increment_combined_counter
+	    (rx_counter, thread_index, stats_t0->sw_if_index, 1, len0);
+	}
+
+      /* Validate VXLAN tunnel encap-fib index agaist packet */
+      if (PREDICT_FALSE (error1 != 0))
+	{
+	  next[1] = VXLAN_INPUT_NEXT_DROP;
+
+	  if (error1 == VXLAN_ERROR_BAD_FLAGS)
+	    {
+	      vlib_increment_combined_counter
+		(drop_counter, thread_index, stats_t1->sw_if_index, 1, len1);
+	    }
+	  b[1]->error = node->errors[error1];
+	  pkts_dropped++;
+	}
+      else
+	{
+	  next[1] = t1->decap_next_index;
+
+	  /* Required to make the l2 tag push / pop code work on l2 subifs */
+	  if (PREDICT_TRUE (next[1] == VXLAN_INPUT_NEXT_L2_INPUT))
+	    vnet_update_l2_len (b[1]);
+
+	  /* Set packet input sw_if_index to unicast VXLAN tunnel for learning */
+	  vnet_buffer (b[1])->sw_if_index[VLIB_RX] = t1->sw_if_index;
+
+	  vlib_increment_combined_counter
+	    (rx_counter, thread_index, stats_t1->sw_if_index, 1, len1);
+	}
+
+      if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED))
+	{
+	  vxlan_rx_trace_t *tr =
+	    vlib_add_trace (vm, node, b[0], sizeof (*tr));
+	  tr->next_index = next[0];
+	  tr->error = error0;
+	  tr->tunnel_index = t0 == 0 ? ~0 : t0 - vxm->tunnels;
+	  tr->vni = vnet_get_vni (vxlan0);
+	}
+      if (PREDICT_FALSE (b[1]->flags & VLIB_BUFFER_IS_TRACED))
+	{
+	  vxlan_rx_trace_t *tr =
+	    vlib_add_trace (vm, node, b[1], sizeof (*tr));
+	  tr->next_index = next[1];
+	  tr->error = error1;
+	  tr->tunnel_index = t1 == 0 ? ~0 : t1 - vxm->tunnels;
+	  tr->vni = vnet_get_vni (vxlan1);
+	}
+      b += 2;
+      next += 2;
+      n_left_from -= 2;
+    }
+
   while (n_left_from > 0)
     {
-      u32 *to_next, n_left_to_next;
-      vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
+      /* udp leaves current_data pointing at the vxlan header */
+      void *cur0 = vlib_buffer_get_current (b[0]);
+      vxlan_header_t *vxlan0 = cur0;
+      u8 error0 = vxlan0->flags != VXLAN_FLAGS_I ? VXLAN_ERROR_BAD_FLAGS : 0;
+      ip4_header_t *ip4_0;
+      ip6_header_t *ip6_0;
+      if (is_ip4)
+	ip4_0 = cur0 - sizeof (udp_header_t) - sizeof (ip4_header_t);
+      else
+	ip6_0 = cur0 - sizeof (udp_header_t) - sizeof (ip6_header_t);
 
-      while (n_left_from >= 4 && n_left_to_next >= 2)
+      /* pop (ip, udp, vxlan) */
+      vlib_buffer_advance (b[0], sizeof (*vxlan0));
+
+      u32 fi0 = buf_fib_index (b[0], is_ip4);
+
+      vxlan_tunnel_t *t0, *stats_t0;
+      if (is_ip4)
+	t0 = vxlan4_find_tunnel (vxm, &last4, fi0, ip4_0, vxlan0, &stats_t0);
+      else
+	t0 = vxlan6_find_tunnel (vxm, &last6, fi0, ip6_0, vxlan0, &stats_t0);
+
+      error0 = t0 == 0 ? VXLAN_ERROR_NO_SUCH_TUNNEL : error0;
+      uword len0 = vlib_buffer_length_in_chain (vm, b[0]);
+
+      /* Validate VXLAN tunnel encap-fib index agaist packet */
+      if (PREDICT_FALSE (error0 != 0))
 	{
-	  /* Prefetch next iteration. */
-	  {
-	    vlib_buffer_t *p2, *p3;
+	  next[0] = VXLAN_INPUT_NEXT_DROP;
 
-	    p2 = vlib_get_buffer (vm, from[2]);
-	    p3 = vlib_get_buffer (vm, from[3]);
-
-	    vlib_prefetch_buffer_header (p2, LOAD);
-	    vlib_prefetch_buffer_header (p3, LOAD);
-
-	    CLIB_PREFETCH (p2->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
-	    CLIB_PREFETCH (p3->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
-	  }
-
-	  u32 bi0 = to_next[0] = from[0];
-	  u32 bi1 = to_next[1] = from[1];
-	  from += 2;
-	  to_next += 2;
-	  n_left_to_next -= 2;
-	  n_left_from -= 2;
-
-	  vlib_buffer_t *b0, *b1;
-	  b0 = vlib_get_buffer (vm, bi0);
-	  b1 = vlib_get_buffer (vm, bi1);
-
-	  /* udp leaves current_data pointing at the vxlan header */
-	  void *cur0 = vlib_buffer_get_current (b0);
-	  void *cur1 = vlib_buffer_get_current (b1);
-	  vxlan_header_t *vxlan0 = cur0;
-	  vxlan_header_t *vxlan1 = cur1;
-
-	  ip4_header_t *ip4_0, *ip4_1;
-	  ip6_header_t *ip6_0, *ip6_1;
-	  if (is_ip4)
+	  if (error0 == VXLAN_ERROR_BAD_FLAGS)
 	    {
-	      ip4_0 = cur0 - sizeof (udp_header_t) - sizeof (ip4_header_t);
-	      ip4_1 = cur1 - sizeof (udp_header_t) - sizeof (ip4_header_t);
-	    }
-	  else
-	    {
-	      ip6_0 = cur0 - sizeof (udp_header_t) - sizeof (ip6_header_t);
-	      ip6_1 = cur1 - sizeof (udp_header_t) - sizeof (ip6_header_t);
-	    }
-
-	  /* pop vxlan */
-	  vlib_buffer_advance (b0, sizeof *vxlan0);
-	  vlib_buffer_advance (b1, sizeof *vxlan1);
-
-	  u32 fi0 = buf_fib_index (b0, is_ip4);
-	  u32 fi1 = buf_fib_index (b1, is_ip4);
-
-	  vxlan_tunnel_t *t0, *stats_t0;
-	  vxlan_tunnel_t *t1, *stats_t1;
-	  if (is_ip4)
-	    {
-	      t0 =
-		vxlan4_find_tunnel (vxm, &last4, fi0, ip4_0, vxlan0,
-				    &stats_t0);
-	      t1 =
-		vxlan4_find_tunnel (vxm, &last4, fi1, ip4_1, vxlan1,
-				    &stats_t1);
-	    }
-	  else
-	    {
-	      t0 =
-		vxlan6_find_tunnel (vxm, &last6, fi0, ip6_0, vxlan0,
-				    &stats_t0);
-	      t1 =
-		vxlan6_find_tunnel (vxm, &last6, fi1, ip6_1, vxlan1,
-				    &stats_t1);
-	    }
-
-	  u32 len0 = vlib_buffer_length_in_chain (vm, b0);
-	  u32 len1 = vlib_buffer_length_in_chain (vm, b1);
-
-	  u32 next0, next1;
-	  u8 error0 = 0, error1 = 0;
-	  /* Validate VXLAN tunnel encap-fib index agaist packet */
-	  if (PREDICT_FALSE (t0 == 0 || vxlan0->flags != VXLAN_FLAGS_I))
-	    {
-	      next0 = VXLAN_INPUT_NEXT_DROP;
-
-	      if (t0 != 0 && vxlan0->flags != VXLAN_FLAGS_I)
-		{
-		  error0 = VXLAN_ERROR_BAD_FLAGS;
-		  vlib_increment_combined_counter
-		    (drop_counter, thread_index, stats_t0->sw_if_index, 1,
-		     len0);
-		}
-	      else
-		error0 = VXLAN_ERROR_NO_SUCH_TUNNEL;
-	      b0->error = node->errors[error0];
-	    }
-	  else
-	    {
-	      next0 = t0->decap_next_index;
-
-	      /* Required to make the l2 tag push / pop code work on l2 subifs */
-	      if (PREDICT_TRUE (next0 == VXLAN_INPUT_NEXT_L2_INPUT))
-		vnet_update_l2_len (b0);
-
-	      /* Set packet input sw_if_index to unicast VXLAN tunnel for learning */
-	      vnet_buffer (b0)->sw_if_index[VLIB_RX] = t0->sw_if_index;
 	      vlib_increment_combined_counter
-		(rx_counter, thread_index, stats_t0->sw_if_index, 1, len0);
-	      pkts_decapsulated++;
+		(drop_counter, thread_index, stats_t0->sw_if_index, 1, len0);
 	    }
+	  b[0]->error = node->errors[error0];
+	  pkts_dropped++;
+	}
+      else
+	{
+	  next[0] = t0->decap_next_index;
 
-	  /* Validate VXLAN tunnel encap-fib index agaist packet */
-	  if (PREDICT_FALSE (t1 == 0 || vxlan1->flags != VXLAN_FLAGS_I))
-	    {
-	      next1 = VXLAN_INPUT_NEXT_DROP;
+	  /* Required to make the l2 tag push / pop code work on l2 subifs */
+	  if (PREDICT_TRUE (next[0] == VXLAN_INPUT_NEXT_L2_INPUT))
+	    vnet_update_l2_len (b[0]);
 
-	      if (t1 != 0 && vxlan1->flags != VXLAN_FLAGS_I)
-		{
-		  error1 = VXLAN_ERROR_BAD_FLAGS;
-		  vlib_increment_combined_counter
-		    (drop_counter, thread_index, stats_t1->sw_if_index, 1,
-		     len1);
-		}
-	      else
-		error1 = VXLAN_ERROR_NO_SUCH_TUNNEL;
-	      b1->error = node->errors[error1];
-	    }
-	  else
-	    {
-	      next1 = t1->decap_next_index;
+	  /* Set packet input sw_if_index to unicast VXLAN tunnel for learning */
+	  vnet_buffer (b[0])->sw_if_index[VLIB_RX] = t0->sw_if_index;
 
-	      /* Required to make the l2 tag push / pop code work on l2 subifs */
-	      if (PREDICT_TRUE (next1 == VXLAN_INPUT_NEXT_L2_INPUT))
-		vnet_update_l2_len (b1);
-
-	      /* Set packet input sw_if_index to unicast VXLAN tunnel for learning */
-	      vnet_buffer (b1)->sw_if_index[VLIB_RX] = t1->sw_if_index;
-	      pkts_decapsulated++;
-
-	      vlib_increment_combined_counter
-		(rx_counter, thread_index, stats_t1->sw_if_index, 1, len1);
-	    }
-
-	  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
-	    {
-	      vxlan_rx_trace_t *tr =
-		vlib_add_trace (vm, node, b0, sizeof (*tr));
-	      tr->next_index = next0;
-	      tr->error = error0;
-	      tr->tunnel_index = t0 == 0 ? ~0 : t0 - vxm->tunnels;
-	      tr->vni = vnet_get_vni (vxlan0);
-	    }
-	  if (PREDICT_FALSE (b1->flags & VLIB_BUFFER_IS_TRACED))
-	    {
-	      vxlan_rx_trace_t *tr =
-		vlib_add_trace (vm, node, b1, sizeof (*tr));
-	      tr->next_index = next1;
-	      tr->error = error1;
-	      tr->tunnel_index = t1 == 0 ? ~0 : t1 - vxm->tunnels;
-	      tr->vni = vnet_get_vni (vxlan1);
-	    }
-
-	  vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
-					   to_next, n_left_to_next,
-					   bi0, bi1, next0, next1);
+	  vlib_increment_combined_counter
+	    (rx_counter, thread_index, stats_t0->sw_if_index, 1, len0);
 	}
 
-      while (n_left_from > 0 && n_left_to_next > 0)
+      if (PREDICT_FALSE (b[0]->flags & VLIB_BUFFER_IS_TRACED))
 	{
-	  u32 bi0 = to_next[0] = from[0];
-	  from += 1;
-	  to_next += 1;
-	  n_left_from -= 1;
-	  n_left_to_next -= 1;
-
-	  vlib_buffer_t *b0 = vlib_get_buffer (vm, bi0);
-
-	  /* udp leaves current_data pointing at the vxlan header */
-	  void *cur0 = vlib_buffer_get_current (b0);
-	  vxlan_header_t *vxlan0 = cur0;
-	  ip4_header_t *ip4_0;
-	  ip6_header_t *ip6_0;
-	  if (is_ip4)
-	    ip4_0 = cur0 - sizeof (udp_header_t) - sizeof (ip4_header_t);
-	  else
-	    ip6_0 = cur0 - sizeof (udp_header_t) - sizeof (ip6_header_t);
-
-	  /* pop (ip, udp, vxlan) */
-	  vlib_buffer_advance (b0, sizeof (*vxlan0));
-
-	  u32 fi0 = buf_fib_index (b0, is_ip4);
-
-	  vxlan_tunnel_t *t0, *stats_t0;
-	  if (is_ip4)
-	    t0 =
-	      vxlan4_find_tunnel (vxm, &last4, fi0, ip4_0, vxlan0, &stats_t0);
-	  else
-	    t0 =
-	      vxlan6_find_tunnel (vxm, &last6, fi0, ip6_0, vxlan0, &stats_t0);
-
-	  uword len0 = vlib_buffer_length_in_chain (vm, b0);
-
-	  u32 next0;
-	  u8 error0 = 0;
-	  /* Validate VXLAN tunnel encap-fib index agaist packet */
-	  if (PREDICT_FALSE (t0 == 0 || vxlan0->flags != VXLAN_FLAGS_I))
-	    {
-	      next0 = VXLAN_INPUT_NEXT_DROP;
-
-	      if (t0 != 0 && vxlan0->flags != VXLAN_FLAGS_I)
-		{
-		  error0 = VXLAN_ERROR_BAD_FLAGS;
-		  vlib_increment_combined_counter
-		    (drop_counter, thread_index, stats_t0->sw_if_index, 1,
-		     len0);
-		}
-	      else
-		error0 = VXLAN_ERROR_NO_SUCH_TUNNEL;
-	      b0->error = node->errors[error0];
-	    }
-	  else
-	    {
-	      next0 = t0->decap_next_index;
-
-	      /* Required to make the l2 tag push / pop code work on l2 subifs */
-	      if (PREDICT_TRUE (next0 == VXLAN_INPUT_NEXT_L2_INPUT))
-		vnet_update_l2_len (b0);
-
-	      /* Set packet input sw_if_index to unicast VXLAN tunnel for learning */
-	      vnet_buffer (b0)->sw_if_index[VLIB_RX] = t0->sw_if_index;
-	      pkts_decapsulated++;
-
-	      vlib_increment_combined_counter
-		(rx_counter, thread_index, stats_t0->sw_if_index, 1, len0);
-	    }
-
-	  if (PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
-	    {
-	      vxlan_rx_trace_t *tr
-		= vlib_add_trace (vm, node, b0, sizeof (*tr));
-	      tr->next_index = next0;
-	      tr->error = error0;
-	      tr->tunnel_index = t0 == 0 ? ~0 : t0 - vxm->tunnels;
-	      tr->vni = vnet_get_vni (vxlan0);
-	    }
-	  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
-					   to_next, n_left_to_next,
-					   bi0, next0);
+	  vxlan_rx_trace_t *tr
+	    = vlib_add_trace (vm, node, b[0], sizeof (*tr));
+	  tr->next_index = next[0];
+	  tr->error = error0;
+	  tr->tunnel_index = t0 == 0 ? ~0 : t0 - vxm->tunnels;
+	  tr->vni = vnet_get_vni (vxlan0);
 	}
-
-      vlib_put_next_frame (vm, node, next_index, n_left_to_next);
+      b += 1;
+      next += 1;
+      n_left_from -= 1;
     }
+  vlib_buffer_enqueue_to_next (vm, node, from, nexts, from_frame->n_vectors);
   /* Do we still need this now that tunnel tx stats is kept? */
   u32 node_idx = is_ip4 ? vxlan4_input_node.index : vxlan6_input_node.index;
   vlib_node_increment_counter (vm, node_idx, VXLAN_ERROR_DECAPSULATED,
-			       pkts_decapsulated);
+			       from_frame->n_vectors - pkts_dropped);
 
   return from_frame->n_vectors;
 }
 
-static uword
-vxlan4_input (vlib_main_t * vm,
-	      vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (vxlan4_input_node) (vlib_main_t * vm,
+				  vlib_node_runtime_t * node,
+				  vlib_frame_t * from_frame)
 {
   return vxlan_input (vm, node, from_frame, /* is_ip4 */ 1);
 }
 
-static uword
-vxlan6_input (vlib_main_t * vm,
-	      vlib_node_runtime_t * node, vlib_frame_t * from_frame)
+VLIB_NODE_FN (vxlan6_input_node) (vlib_main_t * vm,
+				  vlib_node_runtime_t * node,
+				  vlib_frame_t * from_frame)
 {
   return vxlan_input (vm, node, from_frame, /* is_ip4 */ 0);
 }
@@ -464,13 +439,11 @@
 #define vxlan_error(n,s) s,
 #include <vnet/vxlan/vxlan_error.def>
 #undef vxlan_error
-#undef _
 };
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (vxlan4_input_node) =
 {
-  .function = vxlan4_input,
   .name = "vxlan4-input",
   .vector_size = sizeof (u32),
   .n_errors = VXLAN_N_ERROR,
@@ -483,11 +456,9 @@
 #undef _
   },
 };
-VLIB_NODE_FUNCTION_MULTIARCH (vxlan4_input_node, vxlan4_input)
 
 VLIB_REGISTER_NODE (vxlan6_input_node) =
 {
-  .function = vxlan6_input,
   .name = "vxlan6-input",
   .vector_size = sizeof (u32),
   .n_errors = VXLAN_N_ERROR,
@@ -500,7 +471,6 @@
   },
   .format_trace = format_vxlan_rx_trace,
 };
-VLIB_NODE_FUNCTION_MULTIARCH (vxlan6_input_node, vxlan6_input)
 /* *INDENT-ON* */
 
 typedef enum
@@ -906,9 +876,9 @@
   return frame->n_vectors;
 }
 
-static uword
-ip4_vxlan_bypass (vlib_main_t * vm,
-		  vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip4_vxlan_bypass_node) (vlib_main_t * vm,
+				      vlib_node_runtime_t * node,
+				      vlib_frame_t * frame)
 {
   return ip_vxlan_bypass_inline (vm, node, frame, /* is_ip4 */ 1);
 }
@@ -916,7 +886,6 @@
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (ip4_vxlan_bypass_node) =
 {
-  .function = ip4_vxlan_bypass,
   .name = "ip4-vxlan-bypass",
   .vector_size = sizeof (u32),
   .n_next_nodes = IP_VXLAN_BYPASS_N_NEXT,
@@ -928,11 +897,10 @@
   .format_trace = format_ip4_forward_next_trace,
 };
 
-VLIB_NODE_FUNCTION_MULTIARCH (ip4_vxlan_bypass_node, ip4_vxlan_bypass)
 /* *INDENT-ON* */
 
 /* Dummy init function to get us linked in. */
-clib_error_t *
+static clib_error_t *
 ip4_vxlan_bypass_init (vlib_main_t * vm)
 {
   return 0;
@@ -940,9 +908,9 @@
 
 VLIB_INIT_FUNCTION (ip4_vxlan_bypass_init);
 
-static uword
-ip6_vxlan_bypass (vlib_main_t * vm,
-		  vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (ip6_vxlan_bypass_node) (vlib_main_t * vm,
+				      vlib_node_runtime_t * node,
+				      vlib_frame_t * frame)
 {
   return ip_vxlan_bypass_inline (vm, node, frame, /* is_ip4 */ 0);
 }
@@ -950,7 +918,6 @@
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (ip6_vxlan_bypass_node) =
 {
-  .function = ip6_vxlan_bypass,
   .name = "ip6-vxlan-bypass",
   .vector_size = sizeof (u32),
   .n_next_nodes = IP_VXLAN_BYPASS_N_NEXT,
@@ -962,11 +929,10 @@
   .format_trace = format_ip6_forward_next_trace,
 };
 
-VLIB_NODE_FUNCTION_MULTIARCH (ip6_vxlan_bypass_node, ip6_vxlan_bypass)
 /* *INDENT-ON* */
 
 /* Dummy init function to get us linked in. */
-clib_error_t *
+static clib_error_t *
 ip6_vxlan_bypass_init (vlib_main_t * vm)
 {
   return 0;
diff --git a/src/vnet/vxlan/vxlan.h b/src/vnet/vxlan/vxlan.h
index ce410d7..2c309bb 100644
--- a/src/vnet/vxlan/vxlan.h
+++ b/src/vnet/vxlan/vxlan.h
@@ -78,7 +78,7 @@
   u32 mcast_sw_if_index;
 
   /* decap next index */
-  u32 decap_next_index;
+  u16 decap_next_index;
 
   /* The FIB index for src/dst addresses */
   u32 encap_fib_index;
