aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/sample-plugin/sample/node.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-09-12 12:12:36 +0200
committerDave Barach <openvpp@barachs.net>2018-09-12 17:04:36 +0000
commit0fa900e482451d05449501c1422bfa7c47eec661 (patch)
treec9f17a9fa246221aec040d334ef0ae52143768b5 /src/examples/sample-plugin/sample/node.c
parent79dcbc74cd417f4caf41bc398ccba94cab7d656b (diff)
cmake: create cmake VPP module, update sample-plugin so it uses it
Change-Id: I32e91ba8e55797ffe169f98b09bdb42caa5c7de2 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/examples/sample-plugin/sample/node.c')
-rw-r--r--src/examples/sample-plugin/sample/node.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/examples/sample-plugin/sample/node.c b/src/examples/sample-plugin/sample/node.c
index 7f34be56168..009968b6099 100644
--- a/src/examples/sample-plugin/sample/node.c
+++ b/src/examples/sample-plugin/sample/node.c
@@ -45,7 +45,7 @@ format_sample_trace (u8 * s, va_list * args)
return s;
}
-vlib_node_registration_t sample_node;
+extern vlib_node_registration_t sample_node;
#define foreach_sample_error \
_(SWAPPED, "Mac swap packets processed")
@@ -87,9 +87,8 @@ _(3) \
_(4) \
_(5)
-static uword
-sample_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
u32 n_left_from, *from, *to_next;
sample_next_t next_index;
@@ -285,9 +284,8 @@ sample_node_fn (vlib_main_t * vm,
* Node costs about 17 clocks/pkt at a vector size of 26
*/
#ifdef VERSION_2
-static uword
-sample_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
u32 n_left_from, *from, *to_next;
sample_next_t next_index;
@@ -475,9 +473,8 @@ sample_node_fn (vlib_main_t * vm,
/* This would normally be a stack local, but since it's a constant... */
static const u16 nexts[VLIB_FRAME_SIZE] = { 0 };
-static uword
-sample_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (sample_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
u32 n_left_from, *from;
u32 pkts_swapped = 0;
@@ -605,7 +602,6 @@ sample_node_fn (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (sample_node) =
{
- .function = sample_node_fn,
.name = "sample",
.vector_size = sizeof (u32),
.format_trace = format_sample_trace,
@@ -623,8 +619,6 @@ VLIB_REGISTER_NODE (sample_node) =
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (sample_node, sample_node_fn);
-
/*
* fd.io coding-style-patch-verification: ON
*