diff --git a/src/plugins/gtpu/test/test_gtpu.py b/src/plugins/gtpu/test/test_gtpu.py
index 2daafe2..6f5c8e2 100644
--- a/src/plugins/gtpu/test/test_gtpu.py
+++ b/src/plugins/gtpu/test/test_gtpu.py
@@ -187,7 +187,7 @@
         # Pick first received frame and check if it's correctly encapsulated.
         out = self.pg0.get_capture(1)
         pkt = out[0]
-        self.check_encapsulation(pkt, self.single_tunnel_bd)
+        self.check_encapsulation(pkt, self.single_tunnel_vni)
 
         # payload = self.decapsulate(pkt)
         # self.assert_eq_pkts(payload, self.frame_reply)
@@ -343,13 +343,14 @@
             # Create GTPU VTEP on VPP pg0, and put gtpu_tunnel0 and pg1
             #  into BD.
             cls.single_tunnel_bd = 11
+            cls.single_tunnel_vni = 11
             r = cls.vapi.gtpu_add_del_tunnel(
                 is_add=True,
                 mcast_sw_if_index=0xFFFFFFFF,
                 decap_next_index=0xFFFFFFFF,
                 src_address=cls.pg0.local_ip4,
                 dst_address=cls.pg0.remote_ip4,
-                teid=cls.single_tunnel_bd)
+                teid=cls.single_tunnel_vni)
             cls.vapi.sw_interface_set_l2_bridge(rx_sw_if_index=r.sw_if_index,
                                                 bd_id=cls.single_tunnel_bd)
             cls.vapi.sw_interface_set_l2_bridge(
diff --git a/src/vnet/geneve/decap.c b/src/vnet/geneve/decap.c
index a04c1d4..10a17ce 100644
--- a/src/vnet/geneve/decap.c
+++ b/src/vnet/geneve/decap.c
@@ -213,7 +213,7 @@
 	  if (is_ip4)
 	    {
 	      key4_0.remote = ip4_0->src_address.as_u32;
-	      key4_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+	      key4_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 
 	      /* Make sure GENEVE tunnel exist according to packet SIP and VNI */
 	      if (PREDICT_FALSE (key4_0.as_u64 != last_key4.as_u64))
@@ -248,7 +248,7 @@
 		  (ip4_address_is_multicast (&ip4_0->dst_address)))
 		{
 		  key4_0.remote = ip4_0->dst_address.as_u32;
-		  key4_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+		  key4_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 		  /* Make sure mcast GENEVE tunnel exist by packet DIP and VNI */
 		  p0 = hash_get (vxm->geneve4_tunnel_by_key, key4_0.as_u64);
 		  if (PREDICT_TRUE (p0 != NULL))
@@ -266,7 +266,7 @@
 	    {
 	      key6_0.remote.as_u64[0] = ip6_0->src_address.as_u64[0];
 	      key6_0.remote.as_u64[1] = ip6_0->src_address.as_u64[1];
-	      key6_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+	      key6_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 
 	      /* Make sure GENEVE tunnel exist according to packet SIP and VNI */
 	      if (PREDICT_FALSE
@@ -303,7 +303,7 @@
 		{
 		  key6_0.remote.as_u64[0] = ip6_0->dst_address.as_u64[0];
 		  key6_0.remote.as_u64[1] = ip6_0->dst_address.as_u64[1];
-		  key6_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+		  key6_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 		  p0 = hash_get_mem (vxm->geneve6_tunnel_by_key, &key6_0);
 		  if (PREDICT_TRUE (p0 != NULL))
 		    {
@@ -380,7 +380,7 @@
 	  if (is_ip4)
 	    {
 	      key4_1.remote = ip4_1->src_address.as_u32;
-	      key4_1.vni = vnet_get_geneve_vni_bigendian (geneve1);
+	      key4_1.vni = vnet_get_geneve_vni_network_order (geneve1);
 
 	      /* Make sure unicast GENEVE tunnel exist by packet SIP and VNI */
 	      if (PREDICT_FALSE (key4_1.as_u64 != last_key4.as_u64))
@@ -415,7 +415,7 @@
 		  (ip4_address_is_multicast (&ip4_1->dst_address)))
 		{
 		  key4_1.remote = ip4_1->dst_address.as_u32;
-		  key4_1.vni = vnet_get_geneve_vni_bigendian (geneve1);
+		  key4_1.vni = vnet_get_geneve_vni_network_order (geneve1);
 		  /* Make sure mcast GENEVE tunnel exist by packet DIP and VNI */
 		  p1 = hash_get (vxm->geneve4_tunnel_by_key, key4_1.as_u64);
 		  if (PREDICT_TRUE (p1 != NULL))
@@ -433,7 +433,7 @@
 	    {
 	      key6_1.remote.as_u64[0] = ip6_1->src_address.as_u64[0];
 	      key6_1.remote.as_u64[1] = ip6_1->src_address.as_u64[1];
-	      key6_1.vni = vnet_get_geneve_vni_bigendian (geneve1);
+	      key6_1.vni = vnet_get_geneve_vni_network_order (geneve1);
 
 	      /* Make sure GENEVE tunnel exist according to packet SIP and VNI */
 	      if (PREDICT_FALSE
@@ -472,7 +472,7 @@
 		{
 		  key6_1.remote.as_u64[0] = ip6_1->dst_address.as_u64[0];
 		  key6_1.remote.as_u64[1] = ip6_1->dst_address.as_u64[1];
-		  key6_1.vni = vnet_get_geneve_vni_bigendian (geneve1);
+		  key6_1.vni = vnet_get_geneve_vni_network_order (geneve1);
 		  p1 = hash_get_mem (vxm->geneve6_tunnel_by_key, &key6_1);
 		  if (PREDICT_TRUE (p1 != NULL))
 		    {
@@ -618,7 +618,7 @@
 	  if (is_ip4)
 	    {
 	      key4_0.remote = ip4_0->src_address.as_u32;
-	      key4_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+	      key4_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 
 	      /* Make sure unicast GENEVE tunnel exist by packet SIP and VNI */
 	      if (PREDICT_FALSE (key4_0.as_u64 != last_key4.as_u64))
@@ -653,7 +653,7 @@
 		  (ip4_address_is_multicast (&ip4_0->dst_address)))
 		{
 		  key4_0.remote = ip4_0->dst_address.as_u32;
-		  key4_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+		  key4_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 		  /* Make sure mcast GENEVE tunnel exist by packet DIP and VNI */
 		  p0 = hash_get (vxm->geneve4_tunnel_by_key, key4_0.as_u64);
 		  if (PREDICT_TRUE (p0 != NULL))
@@ -671,7 +671,7 @@
 	    {
 	      key6_0.remote.as_u64[0] = ip6_0->src_address.as_u64[0];
 	      key6_0.remote.as_u64[1] = ip6_0->src_address.as_u64[1];
-	      key6_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+	      key6_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 
 	      /* Make sure GENEVE tunnel exist according to packet SIP and VNI */
 	      if (PREDICT_FALSE
@@ -708,7 +708,7 @@
 		{
 		  key6_0.remote.as_u64[0] = ip6_0->dst_address.as_u64[0];
 		  key6_0.remote.as_u64[1] = ip6_0->dst_address.as_u64[1];
-		  key6_0.vni = vnet_get_geneve_vni_bigendian (geneve0);
+		  key6_0.vni = vnet_get_geneve_vni_network_order (geneve0);
 		  p0 = hash_get_mem (vxm->geneve6_tunnel_by_key, &key6_0);
 		  if (PREDICT_TRUE (p0 != NULL))
 		    {
@@ -1240,24 +1240,17 @@
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (ip4_geneve_bypass_node) =
 {
-  .name = "ip4-geneve-bypass",.vector_size =
-    sizeof (u32),.n_next_nodes = IP_GENEVE_BYPASS_N_NEXT,.next_nodes =
+  .name = "ip4-geneve-bypass",
+  .vector_size = sizeof (u32),
+  .n_next_nodes = IP_GENEVE_BYPASS_N_NEXT,.next_nodes =
   {
-  [IP_GENEVE_BYPASS_NEXT_DROP] = "error-drop",
-      [IP_GENEVE_BYPASS_NEXT_GENEVE] = "geneve4-input",}
-,.format_buffer = format_ip4_header,.format_trace =
-    format_ip4_forward_next_trace,};
-
-#ifndef CLIB_MARCH_VARIANT
-/* Dummy init function to get us linked in. */
-     clib_error_t *ip4_geneve_bypass_init (vlib_main_t * vm)
-{
-  return 0;
-}
-
-VLIB_INIT_FUNCTION (ip4_geneve_bypass_init);
+    [IP_GENEVE_BYPASS_NEXT_DROP] = "error-drop",
+    [IP_GENEVE_BYPASS_NEXT_GENEVE] = "geneve4-input",
+  },
+  .format_buffer = format_ip4_header,
+  .format_trace = format_ip4_forward_next_trace,
+};
 /* *INDENT-ON* */
-#endif /* CLIB_MARCH_VARIANT */
 
 VLIB_NODE_FN (ip6_geneve_bypass_node) (vlib_main_t * vm,
 				       vlib_node_runtime_t * node,
@@ -1269,26 +1262,19 @@
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (ip6_geneve_bypass_node) =
 {
-  .name = "ip6-geneve-bypass",.vector_size =
-    sizeof (u32),.n_next_nodes = IP_GENEVE_BYPASS_N_NEXT,.next_nodes =
+  .name = "ip6-geneve-bypass",
+  .vector_size = sizeof (u32),
+  .n_next_nodes = IP_GENEVE_BYPASS_N_NEXT,
+  .next_nodes =
   {
-  [IP_GENEVE_BYPASS_NEXT_DROP] = "error-drop",
-      [IP_GENEVE_BYPASS_NEXT_GENEVE] = "geneve6-input",}
-,.format_buffer = format_ip6_header,.format_trace =
-    format_ip6_forward_next_trace,};
+    [IP_GENEVE_BYPASS_NEXT_DROP] = "error-drop",
+    [IP_GENEVE_BYPASS_NEXT_GENEVE] = "geneve6-input",
+  },
+  .format_buffer = format_ip6_header,
+  .format_trace = format_ip6_forward_next_trace,
+};
 /* *INDENT-ON* */
 
-#ifndef CLIB_MARCH_VARIANT
-/* Dummy init function to get us linked in. */
-clib_error_t *
-ip6_geneve_bypass_init (vlib_main_t * vm)
-{
-  return 0;
-}
-
-VLIB_INIT_FUNCTION (ip6_geneve_bypass_init);
-#endif /* CLIB_MARCH_VARIANT */
-
 /*
  * fd.io coding-style-patch-verification: ON
  *
diff --git a/src/vnet/geneve/geneve.c b/src/vnet/geneve/geneve.c
index 52664b3..1e04c66 100644
--- a/src/vnet/geneve/geneve.c
+++ b/src/vnet/geneve/geneve.c
@@ -292,14 +292,15 @@
   return decap_next_index < r->n_next_nodes;
 }
 
-typedef CLIB_PACKED (union
-		     {
-		     struct
-		     {
-		     fib_node_index_t mfib_entry_index;
-		     adj_index_t mcast_adj_index;
-		     }; u64 as_u64;
-		     }) mcast_shared_t;
+typedef union
+{
+  struct
+  {
+    fib_node_index_t mfib_entry_index;
+    adj_index_t mcast_adj_index;
+  };
+  u64 as_u64;
+} __clib_packed mcast_shared_t;
 
 static inline mcast_shared_t
 mcast_shared_get (ip46_address_t * ip)
@@ -352,15 +353,13 @@
   if (!is_ip6)
     {
       key4.remote = a->remote.ip4.as_u32;
-      key4.vni =
-	clib_host_to_net_u32 ((a->vni << GENEVE_VNI_SHIFT) & GENEVE_VNI_MASK);
+      key4.vni = clib_host_to_net_u32 (a->vni << GENEVE_VNI_SHIFT);
       p = hash_get (vxm->geneve4_tunnel_by_key, key4.as_u64);
     }
   else
     {
       key6.remote = a->remote.ip6;
-      key6.vni =
-	clib_host_to_net_u32 ((a->vni << GENEVE_VNI_SHIFT) & GENEVE_VNI_MASK);
+      key6.vni = clib_host_to_net_u32 (a->vni << GENEVE_VNI_SHIFT);
       p = hash_get_mem (vxm->geneve6_tunnel_by_key, &key6);
     }
 
diff --git a/src/vnet/geneve/geneve_packet.h b/src/vnet/geneve/geneve_packet.h
index ab37f53..a0d0687 100644
--- a/src/vnet/geneve/geneve_packet.h
+++ b/src/vnet/geneve/geneve_packet.h
@@ -137,21 +137,14 @@
 static inline u32
 vnet_get_geneve_vni (geneve_header_t * h)
 {
-  return (clib_net_to_host_u32 (h->vni_rsvd & GENEVE_VNI_MASK) >>
+  return ((clib_net_to_host_u32 (h->vni_rsvd) & GENEVE_VNI_MASK) >>
 	  GENEVE_VNI_SHIFT);
 }
 
-/*
- * Return the VNI in network-byte order
- *
- * To be used in the DECAP phase to create the lookup key (IP + VNI)
- */
 static inline u32
-vnet_get_geneve_vni_bigendian (geneve_header_t * h)
+vnet_get_geneve_vni_network_order (geneve_header_t * h)
 {
-  u32 vni_host = vnet_get_geneve_vni (h);
-  return clib_host_to_net_u32 ((vni_host << GENEVE_VNI_SHIFT) &
-			       GENEVE_VNI_MASK);
+  return (h->vni_rsvd & clib_net_to_host_u32 (GENEVE_VNI_MASK));
 }
 
 static inline void
