aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vlib/node.h4
-rw-r--r--src/vnet/CMakeLists.txt23
-rw-r--r--src/vnet/dhcp/dhcp_client_detect.c10
-rw-r--r--src/vnet/ethernet/p2p_ethernet_input.c13
-rw-r--r--src/vnet/handoff.c16
-rw-r--r--src/vnet/ipsec-gre/node.c8
-rw-r--r--src/vnet/l2tp/decap.c12
-rw-r--r--src/vnet/l2tp/encap.c12
-rw-r--r--src/vnet/lawful-intercept/node.c11
9 files changed, 57 insertions, 52 deletions
diff --git a/src/vlib/node.h b/src/vlib/node.h
index ec47f205d11..bdc3c6b59ad 100644
--- a/src/vlib/node.h
+++ b/src/vlib/node.h
@@ -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)
{
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index cb730ba227f..1b1df863bf7 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -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
)
diff --git a/src/vnet/dhcp/dhcp_client_detect.c b/src/vnet/dhcp/dhcp_client_detect.c
index de2702df398..68f420d7c7c 100644
--- a/src/vnet/dhcp/dhcp_client_detect.c
+++ b/src/vnet/dhcp/dhcp_client_detect.c
@@ -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",
diff --git a/src/vnet/ethernet/p2p_ethernet_input.c b/src/vnet/ethernet/p2p_ethernet_input.c
index 2cae97d7ba9..36845fcda1b 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 @@ 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
*
diff --git a/src/vnet/handoff.c b/src/vnet/handoff.c
index ffac47e22df..ca46b5a7ab6 100644
--- a/src/vnet/handoff.c
+++ b/src/vnet/handoff.c
@@ -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
*
diff --git a/src/vnet/ipsec-gre/node.c b/src/vnet/ipsec-gre/node.c
index 6a5536eceb9..9e1ab206ad4 100644
--- a/src/vnet/ipsec-gre/node.c
+++ b/src/vnet/ipsec-gre/node.c
@@ -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)
{
{
diff --git a/src/vnet/l2tp/decap.c b/src/vnet/l2tp/decap.c
index 5925cdb7f41..5fc25f55226 100644
--- a/src/vnet/l2tp/decap.c
+++ b/src/vnet/l2tp/decap.c
@@ -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
diff --git a/src/vnet/l2tp/encap.c b/src/vnet/l2tp/encap.c
index 44641d99019..8863ddfa20d 100644
--- a/src/vnet/l2tp/encap.c
+++ b/src/vnet/l2tp/encap.c
@@ -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
diff --git a/src/vnet/lawful-intercept/node.c b/src/vnet/lawful-intercept/node.c
index 716af43e063..03b507adbdd 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 @@ 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
*