deprecate VLIB_NODE_FUNCTION_MULTIARCH 40/18240/2
authorFilip Tehlar <ftehlar@cisco.com>
Mon, 11 Mar 2019 12:53:35 +0000 (05:53 -0700)
committerDamjan Marion <dmarion@me.com>
Wed, 13 Mar 2019 10:59:48 +0000 (10:59 +0000)
Change-Id: I403173846bc5b1bbbe2a2c41225b0f666f851cb9
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
src/vlib/node.h
src/vnet/CMakeLists.txt
src/vnet/dhcp/dhcp_client_detect.c
src/vnet/ethernet/p2p_ethernet_input.c
src/vnet/handoff.c
src/vnet/ipsec-gre/node.c
src/vnet/l2tp/decap.c
src/vnet/l2tp/encap.c
src/vnet/lawful-intercept/node.c

index ec47f20..bdc3c6b 100644 (file)
@@ -217,10 +217,6 @@ CLIB_MARCH_SFX (node##_multiarch_register) (void)                  \
 }                                                                      \
 uword CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (node##_fn)
 
-
-/* FIXME to be removed */
-#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
-
 always_inline vlib_node_registration_t *
 vlib_node_next_registered (vlib_node_registration_t * c)
 {
index cb730ba..1b1df86 100644 (file)
@@ -42,6 +42,7 @@ list(APPEND VNET_SOURCES
 list(APPEND VNET_MULTIARCH_SOURCES
   interface_output.c
   interface_stats.c
+  handoff.c
 )
 
 list(APPEND VNET_HEADERS
@@ -135,7 +136,10 @@ list(APPEND VNET_SOURCES
   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 @@ list(APPEND VNET_SOURCES
   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 @@ list(APPEND VNET_SOURCES
   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 @@ list(APPEND VNET_SOURCES
   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 @@ list(APPEND VNET_SOURCES
   lawful-intercept/node.c
 )
 
+list(APPEND VNET_MULTIARCH_SOURCES
+  lawful-intercept/node.c
+)
+
 list(APPEND VNET_HEADERS
   lawful-intercept/lawful_intercept.h
 )
index de2702d..68f420d 100644 (file)
@@ -52,9 +52,9 @@ typedef struct dhcp_client_detect_trace_t_
   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 @@ format_dhcp_client_detect_trace (u8 * s, va_list * args)
 
 /* *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_REGISTER_NODE (dhcp_client_detect_node) = {
   },
 };
 
-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",
index 2cae97d..36845fc 100644 (file)
 #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 @@ static char *p2p_ethernet_error_strings[] = {
 #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 @@ p2p_ethernet_input_node_fn (vlib_main_t * vm,
 
 /* *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 @@ VLIB_REGISTER_NODE (p2p_ethernet_input_node) = {
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (p2p_ethernet_input_node,
-                             p2p_ethernet_input_node_fn)
 /*
  * fd.io coding-style-patch-verification: ON
  *
index ffac47e..ca46b5a 100644 (file)
@@ -40,7 +40,11 @@ typedef struct
     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 @@ format_worker_handoff_trace (u8 * s, va_list * args)
   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 @@ worker_handoff_node_fn (vlib_main_t * vm,
 
 /* *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_REGISTER_NODE (worker_handoff_node) = {
   },
 };
 
-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 @@ handoff_init (vlib_main_t * vm)
 
 VLIB_INIT_FUNCTION (handoff_init);
 
+#endif /* CLIB_MARCH_VARIANT */
 /*
  * fd.io coding-style-patch-verification: ON
  *
index 6a5536e..9e1ab20 100644 (file)
@@ -43,7 +43,7 @@ typedef struct {
   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 @@ u8 * format_ipsec_gre_rx_trace (u8 * s, va_list * args)
  * <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 @@ static char * ipsec_gre_error_strings[] = {
 };
 
 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 @@ VLIB_REGISTER_NODE (ipsec_gre_input_node) = {
   .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)
 {
   {
index 5925cdb..5fc25f5 100644 (file)
@@ -236,9 +236,9 @@ done:
 
 #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 @@ l2t_decap_node_fn (vlib_main_t * vm,
 
 /* *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 @@ VLIB_REGISTER_NODE (l2t_decap_node) = {
 };
 /* *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 @@ VLIB_REGISTER_NODE (l2t_decap_local_node) = {
 };
 /* *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
index 44641d9..8863ddf 100644 (file)
@@ -57,7 +57,7 @@ typedef struct
   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 @@ done:
 
 #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 @@ l2t_encap_node_fn (vlib_main_t * vm,
 
 /* *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 @@ VLIB_REGISTER_NODE (l2t_encap_node) = {
 };
 /* *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 @@ l2tp_encap_init (vlib_main_t * vm)
   rt->cached_sw_if_index = (u32) ~ 0;
   rt->cached_session_index = (u32) ~ 0;
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 /*
  * fd.io coding-style-patch-verification: ON
index 716af43..03b507a 100644 (file)
@@ -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 @@ format_li_hit_trace (u8 * s, va_list * args)
   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 @@ typedef enum
   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 @@ li_hit_node_fn (vlib_main_t * vm,
 
 /* *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 @@ VLIB_REGISTER_NODE (li_hit_node) = {
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (li_hit_node, li_hit_node_fn)
 /*
  * fd.io coding-style-patch-verification: ON
  *