deprecate VLIB_NODE_FUNCTION_MULTIARCH

Change-Id: I403173846bc5b1bbbe2a2c41225b0f666f851cb9
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index cb730ba..1b1df86 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -42,6 +42,7 @@
 list(APPEND VNET_MULTIARCH_SOURCES
   interface_output.c
   interface_stats.c
+  handoff.c
 )
 
 list(APPEND VNET_HEADERS
@@ -135,7 +136,10 @@
   ethernet/p2p_ethernet_api.c
 )
 
-list(APPEND VNET_MULTIARCH_SOURCES ethernet/node.c)
+list(APPEND VNET_MULTIARCH_SOURCES
+  ethernet/node.c
+  ethernet/p2p_ethernet_input.c
+)
 
 list(APPEND VNET_HEADERS
   ethernet/error.def
@@ -727,6 +731,11 @@
   l2tp/l2tp_api.c
 )
 
+list(APPEND VNET_MULTIARCH_SOURCES
+  l2tp/encap.c
+  l2tp/decap.c
+)
+
 list(APPEND VNET_HEADERS
   l2tp/l2tp.h
   l2tp/packet.h
@@ -823,6 +832,10 @@
   ipsec-gre/ipsec_gre_api.c
 )
 
+list(APPEND VNET_MULTIARCH_SOURCES
+  ipsec-gre/node.c
+)
+
 list(APPEND VNET_HEADERS
   ipsec-gre/ipsec_gre.h
   ipsec-gre/error.def
@@ -899,6 +912,10 @@
   dhcp/dhcp_api.c
 )
 
+list(APPEND VNET_MULTIARCH_SOURCES
+  dhcp/dhcp_client_detect.c
+)
+
 list(APPEND VNET_HEADERS
   dhcp/client.h
   dhcp/dhcp6_client_common_dp.h
@@ -1001,6 +1018,10 @@
   lawful-intercept/node.c
 )
 
+list(APPEND VNET_MULTIARCH_SOURCES
+  lawful-intercept/node.c
+)
+
 list(APPEND VNET_HEADERS
   lawful-intercept/lawful_intercept.h
 )
diff --git a/src/vnet/dhcp/dhcp_client_detect.c b/src/vnet/dhcp/dhcp_client_detect.c
index de2702d..68f420d 100644
--- a/src/vnet/dhcp/dhcp_client_detect.c
+++ b/src/vnet/dhcp/dhcp_client_detect.c
@@ -52,9 +52,9 @@
   u8 extracted;
 } dhcp_client_detect_trace_t;
 
-static uword
-dhcp_client_detect_node_fn (vlib_main_t * vm,
-			    vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (dhcp_client_detect_node) (vlib_main_t * vm,
+					vlib_node_runtime_t * node,
+					vlib_frame_t * frame)
 {
   dhcp_client_detect_next_t next_index;
   u16 dhcp_client_port_network_order;
@@ -288,7 +288,6 @@
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (dhcp_client_detect_node) = {
-  .function = dhcp_client_detect_node_fn,
   .name = "ip4-dhcp-client-detect",
   .vector_size = sizeof (u32),
   .format_trace = format_dhcp_client_detect_trace,
@@ -307,9 +306,6 @@
   },
 };
 
-VLIB_NODE_FUNCTION_MULTIARCH (dhcp_client_detect_node,
-                              dhcp_client_detect_node_fn);
-
 VNET_FEATURE_INIT (ip4_dvr_reinject_feat_node, static) =
 {
   .arc_name = "ip4-unicast",
diff --git a/src/vnet/ethernet/p2p_ethernet_input.c b/src/vnet/ethernet/p2p_ethernet_input.c
index 2cae97d..36845fc 100644
--- a/src/vnet/ethernet/p2p_ethernet_input.c
+++ b/src/vnet/ethernet/p2p_ethernet_input.c
@@ -24,10 +24,10 @@
 #include <vppinfra/error.h>
 #include <vppinfra/elog.h>
 
-vlib_node_registration_t p2p_ethernet_input_node;
+extern vlib_node_registration_t p2p_ethernet_input_node;
 
 /* packet trace format function */
-u8 *
+static u8 *
 format_p2p_ethernet_trace (u8 * s, va_list * args)
 {
   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
@@ -59,9 +59,9 @@
 #undef _
 };
 
-static uword
-p2p_ethernet_input_node_fn (vlib_main_t * vm,
-			    vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (p2p_ethernet_input_node) (vlib_main_t * vm,
+					vlib_node_runtime_t * node,
+					vlib_frame_t * frame)
 {
   u32 thread_index = vm->thread_index;
   u32 n_trace = vlib_get_trace_count (vm, node);
@@ -233,7 +233,6 @@
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (p2p_ethernet_input_node) = {
-  .function = p2p_ethernet_input_node_fn,
   .name = "p2p-ethernet-input",
   .vector_size = sizeof (u32),
   .format_trace = format_p2p_ethernet_trace,
@@ -251,8 +250,6 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (p2p_ethernet_input_node,
-			      p2p_ethernet_input_node_fn)
 /*
  * fd.io coding-style-patch-verification: ON
  *
diff --git a/src/vnet/handoff.c b/src/vnet/handoff.c
index ffac47e..ca46b5a 100644
--- a/src/vnet/handoff.c
+++ b/src/vnet/handoff.c
@@ -40,7 +40,11 @@
     u64 (*hash_fn) (ethernet_header_t *);
 } handoff_main_t;
 
+extern handoff_main_t handoff_main;
+
+#ifndef CLIB_MARCH_VARIANT
 handoff_main_t handoff_main;
+#endif /* CLIB_MARCH_VARIANT */
 
 typedef struct
 {
@@ -80,11 +84,9 @@
   return s;
 }
 
-vlib_node_registration_t handoff_node;
-
-static uword
-worker_handoff_node_fn (vlib_main_t * vm,
-			vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (worker_handoff_node) (vlib_main_t * vm,
+				    vlib_node_runtime_t * node,
+				    vlib_frame_t * frame)
 {
   handoff_main_t *hm = &handoff_main;
   vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
@@ -159,7 +161,6 @@
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (worker_handoff_node) = {
-  .function = worker_handoff_node_fn,
   .name = "worker-handoff",
   .vector_size = sizeof (u32),
   .format_trace = format_worker_handoff_trace,
@@ -173,9 +174,9 @@
   },
 };
 
-VLIB_NODE_FUNCTION_MULTIARCH (worker_handoff_node, worker_handoff_node_fn)
 /* *INDENT-ON* */
 
+#ifndef CLIB_MARCH_VARIANT
 int
 interface_handoff_enable_disable (vlib_main_t * vm, u32 sw_if_index,
 				  uword * bitmap, int enable_disable)
@@ -335,6 +336,7 @@
 
 VLIB_INIT_FUNCTION (handoff_init);
 
+#endif /* CLIB_MARCH_VARIANT */
 /*
  * fd.io coding-style-patch-verification: ON
  *
diff --git a/src/vnet/ipsec-gre/node.c b/src/vnet/ipsec-gre/node.c
index 6a5536e..9e1ab20 100644
--- a/src/vnet/ipsec-gre/node.c
+++ b/src/vnet/ipsec-gre/node.c
@@ -43,7 +43,7 @@
   ip4_address_t dst;
 } ipsec_gre_rx_trace_t;
 
-u8 * format_ipsec_gre_rx_trace (u8 * s, va_list * args)
+static u8 * format_ipsec_gre_rx_trace (u8 * s, va_list * args)
 {
   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
@@ -83,8 +83,7 @@
  * <em>Next Index:</em>
  * - Dispatches the packet to the l2-input node.
 */
-static uword
-ipsec_gre_input (vlib_main_t * vm,
+VLIB_NODE_FN (ipsec_gre_input_node) (vlib_main_t * vm,
                  vlib_node_runtime_t * node,
                  vlib_frame_t * from_frame)
 {
@@ -395,7 +394,6 @@
 };
 
 VLIB_REGISTER_NODE (ipsec_gre_input_node) = {
-  .function = ipsec_gre_input,
   .name = "ipsec-gre-input",
   /* Takes a vector of packets. */
   .vector_size = sizeof (u32),
@@ -413,8 +411,6 @@
   .format_trace = format_ipsec_gre_rx_trace,
 };
 
-VLIB_NODE_FUNCTION_MULTIARCH (ipsec_gre_input_node, ipsec_gre_input)
-
 static clib_error_t * ipsec_gre_input_init (vlib_main_t * vm)
 {
   {
diff --git a/src/vnet/l2tp/decap.c b/src/vnet/l2tp/decap.c
index 5925cdb..5fc25f5 100644
--- a/src/vnet/l2tp/decap.c
+++ b/src/vnet/l2tp/decap.c
@@ -236,9 +236,9 @@
 
 #include <vnet/pipeline.h>
 
-static uword
-l2t_decap_node_fn (vlib_main_t * vm,
-		   vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2t_decap_node) (vlib_main_t * vm,
+			       vlib_node_runtime_t * node,
+			       vlib_frame_t * frame)
 {
   return dispatch_pipeline (vm, node, frame);
 }
@@ -251,7 +251,6 @@
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (l2t_decap_node) = {
-  .function = l2t_decap_node_fn,
   .name = "l2tp-decap",
   .vector_size = sizeof (u32),
   .format_trace = format_l2t_trace,
@@ -270,7 +269,8 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (l2t_decap_node, l2t_decap_node_fn);
+extern vlib_node_function_t l2t_decap_node_fn;
+
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (l2t_decap_local_node) = {
   .function = l2t_decap_node_fn,
@@ -292,11 +292,13 @@
 };
 /* *INDENT-ON* */
 
+#ifndef CLIB_MARCH_VARIANT
 void
 l2tp_decap_init (void)
 {
   ip6_register_protocol (IP_PROTOCOL_L2TP, l2t_decap_local_node.index);
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 /*
  * fd.io coding-style-patch-verification: ON
diff --git a/src/vnet/l2tp/encap.c b/src/vnet/l2tp/encap.c
index 44641d9..8863ddf 100644
--- a/src/vnet/l2tp/encap.c
+++ b/src/vnet/l2tp/encap.c
@@ -57,7 +57,7 @@
   vnet_main_t *vnet_main;
 } l2tp_encap_runtime_t;
 
-vlib_node_registration_t l2t_encap_node;
+extern vlib_node_registration_t l2t_encap_node;
 
 #define NSTAGES 3
 
@@ -184,9 +184,9 @@
 
 #include <vnet/pipeline.h>
 
-uword
-l2t_encap_node_fn (vlib_main_t * vm,
-		   vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2t_encap_node) (vlib_main_t * vm,
+			       vlib_node_runtime_t * node,
+			       vlib_frame_t * frame)
 {
   return dispatch_pipeline (vm, node, frame);
 }
@@ -194,7 +194,6 @@
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (l2t_encap_node) = {
-  .function = l2t_encap_node_fn,
   .name = "l2tp-encap",
   .vector_size = sizeof (u32),
   .format_trace = format_l2t_trace,
@@ -214,7 +213,7 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (l2t_encap_node, l2t_encap_node_fn);
+#ifndef CLIB_MARCH_VARIANT
 void
 l2tp_encap_init (vlib_main_t * vm)
 {
@@ -225,6 +224,7 @@
   rt->cached_sw_if_index = (u32) ~ 0;
   rt->cached_session_index = (u32) ~ 0;
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 /*
  * fd.io coding-style-patch-verification: ON
diff --git a/src/vnet/lawful-intercept/node.c b/src/vnet/lawful-intercept/node.c
index 716af43..03b507a 100644
--- a/src/vnet/lawful-intercept/node.c
+++ b/src/vnet/lawful-intercept/node.c
@@ -22,7 +22,7 @@
 #include <vppinfra/error.h>
 #include <vppinfra/elog.h>
 
-vlib_node_registration_t li_hit_node;
+extern vlib_node_registration_t li_hit_node;
 
 typedef struct
 {
@@ -42,8 +42,6 @@
   return s;
 }
 
-vlib_node_registration_t li_hit_node;
-
 #define foreach_li_hit_error                                    \
 _(HITS, "LI packets processed")                                 \
 _(NO_COLLECTOR, "No collector configured")                      \
@@ -69,9 +67,8 @@
   LI_HIT_N_NEXT,
 } li_hit_next_t;
 
-static uword
-li_hit_node_fn (vlib_main_t * vm,
-		vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (li_hit_node) (vlib_main_t * vm,
+			    vlib_node_runtime_t * node, vlib_frame_t * frame)
 {
   u32 n_left_from, *from, *to_next;
   li_hit_next_t next_index;
@@ -265,7 +262,6 @@
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (li_hit_node) = {
-  .function = li_hit_node_fn,
   .name = "li-hit",
   .vector_size = sizeof (u32),
   .format_trace = format_li_hit_trace,
@@ -283,7 +279,6 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (li_hit_node, li_hit_node_fn)
 /*
  * fd.io coding-style-patch-verification: ON
  *