tcp: migrate old MULTIARCH macros to VLIB_NODE_FN

Change-Id: Ifd9fa30eed343e2c5d40582b3e3aa589b070637d
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 2e9fc58..66651e8 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -16,9 +16,6 @@
 #include <vnet/tcp/tcp.h>
 #include <math.h>
 
-vlib_node_registration_t tcp4_output_node;
-vlib_node_registration_t tcp6_output_node;
-
 typedef enum _tcp_output_next
 {
   TCP_OUTPUT_NEXT_DROP,
@@ -52,9 +49,11 @@
   tcp_connection_t tcp_connection;
 } tcp_tx_trace_t;
 
+#ifndef CLIB_MARCH_VARIANT
 u16 dummy_mtu = 1460;
+#endif /* CLIB_MARCH_VARIANT */
 
-u8 *
+static u8 *
 format_tcp_tx_trace (u8 * s, va_list * args)
 {
   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
@@ -70,6 +69,7 @@
   return s;
 }
 
+#ifndef CLIB_MARCH_VARIANT
 static u8
 tcp_window_compute_scale (u32 window)
 {
@@ -464,6 +464,7 @@
   if (tcp_opts_tstamp (&tc->rcv_opts))
     tc->snd_mss -= TCP_OPTION_LEN_TIMESTAMP;
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 static void *
 tcp_reuse_buffer (vlib_main_t * vm, vlib_buffer_t * b)
@@ -481,6 +482,7 @@
   return vlib_buffer_make_headroom (b, TRANSPORT_MAX_HDRS_LEN);
 }
 
+#ifndef CLIB_MARCH_VARIANT
 static void *
 tcp_init_buffer (vlib_main_t * vm, vlib_buffer_t * b)
 {
@@ -688,6 +690,7 @@
 {
   tcp_enqueue_to_output_i (wrk, b, bi, is_ip4, 1);
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 static int
 tcp_make_reset_in_place (vlib_main_t * vm, vlib_buffer_t * b0,
@@ -768,6 +771,7 @@
   return 0;
 }
 
+#ifndef CLIB_MARCH_VARIANT
 /**
  *  Send reset without reusing existing buffer
  *
@@ -2015,6 +2019,7 @@
   else
     return tcp_fast_retransmit_no_sack (wrk, tc, burst_size);
 }
+#endif /* CLIB_MARCH_VARIANT */
 
 static void
 tcp_output_handle_link_local (tcp_connection_t * tc0, vlib_buffer_t * b0,
@@ -2200,16 +2205,14 @@
   return frame->n_vectors;
 }
 
-static uword
-tcp4_output (vlib_main_t * vm, vlib_node_runtime_t * node,
-	     vlib_frame_t * from_frame)
+VLIB_NODE_FN (tcp4_output_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+				 vlib_frame_t * from_frame)
 {
   return tcp46_output_inline (vm, node, from_frame, 1 /* is_ip4 */ );
 }
 
-static uword
-tcp6_output (vlib_main_t * vm, vlib_node_runtime_t * node,
-	     vlib_frame_t * from_frame)
+VLIB_NODE_FN (tcp6_output_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+				 vlib_frame_t * from_frame)
 {
   return tcp46_output_inline (vm, node, from_frame, 0 /* is_ip4 */ );
 }
@@ -2217,7 +2220,6 @@
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (tcp4_output_node) =
 {
-  .function = tcp4_output,
   .name = "tcp4-output",
   /* Takes a vector of packets. */
   .vector_size = sizeof (u32),
@@ -2235,12 +2237,9 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (tcp4_output_node, tcp4_output);
-
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (tcp6_output_node) =
 {
-  .function = tcp6_output,
   .name = "tcp6-output",
     /* Takes a vector of packets. */
   .vector_size = sizeof (u32),
@@ -2258,8 +2257,6 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (tcp6_output_node, tcp6_output);
-
 typedef enum _tcp_reset_next
 {
   TCP_RESET_NEXT_DROP,
@@ -2345,23 +2342,20 @@
   return from_frame->n_vectors;
 }
 
-static uword
-tcp4_send_reset (vlib_main_t * vm, vlib_node_runtime_t * node,
-		 vlib_frame_t * from_frame)
+VLIB_NODE_FN (tcp4_reset_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+				vlib_frame_t * from_frame)
 {
   return tcp46_send_reset_inline (vm, node, from_frame, 1);
 }
 
-static uword
-tcp6_send_reset (vlib_main_t * vm, vlib_node_runtime_t * node,
-		 vlib_frame_t * from_frame)
+VLIB_NODE_FN (tcp6_reset_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+				vlib_frame_t * from_frame)
 {
   return tcp46_send_reset_inline (vm, node, from_frame, 0);
 }
 
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (tcp4_reset_node) = {
-  .function = tcp4_send_reset,
   .name = "tcp4-reset",
   .vector_size = sizeof (u32),
   .n_errors = TCP_N_ERROR,
@@ -2376,11 +2370,8 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (tcp4_reset_node, tcp4_send_reset);
-
 /* *INDENT-OFF* */
 VLIB_REGISTER_NODE (tcp6_reset_node) = {
-  .function = tcp6_send_reset,
   .name = "tcp6-reset",
   .vector_size = sizeof (u32),
   .n_errors = TCP_N_ERROR,
@@ -2395,8 +2386,6 @@
 };
 /* *INDENT-ON* */
 
-VLIB_NODE_FUNCTION_MULTIARCH (tcp6_reset_node, tcp6_send_reset);
-
 /*
  * fd.io coding-style-patch-verification: ON
  *