aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/CMakeLists.txt5
-rw-r--r--src/vnet/interface_output.c42
-rw-r--r--src/vnet/interface_stats.c19
3 files changed, 32 insertions, 34 deletions
diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt
index a5d5fe44364..9e3e5d12ddd 100644
--- a/src/vnet/CMakeLists.txt
+++ b/src/vnet/CMakeLists.txt
@@ -39,6 +39,11 @@ list(APPEND VNET_SOURCES
misc.c
)
+list(APPEND VNET_MULTIARCH_SOURCES
+ interface_output.c
+ interface_stats.c
+)
+
list(APPEND VNET_HEADERS
api_errno.h
buffer.h
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 99aa1f110fb..2f62023aa4e 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -54,6 +54,7 @@ typedef struct
}
interface_output_trace_t;
+#ifndef CLIB_MARCH_VARIANT
u8 *
format_vnet_interface_output_trace (u8 * s, va_list * va)
{
@@ -802,6 +803,7 @@ vnet_interface_output_node_inline_gso (vlib_main_t * vm,
rt->sw_if_index, n_packets, n_bytes);
return n_buffers;
}
+#endif /* CLIB_MARCH_VARIANT */
static_always_inline void vnet_interface_pcap_tx_trace
(vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame,
@@ -840,6 +842,7 @@ static_always_inline void vnet_interface_pcap_tx_trace
}
}
+#ifndef CLIB_MARCH_VARIANT
static_always_inline uword
vnet_interface_output_node_inline (vlib_main_t * vm,
vlib_node_runtime_t * node,
@@ -889,12 +892,13 @@ vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node,
return vnet_interface_output_node_inline (vm, node, frame, vnm, hi,
/* do_tx_offloads */ 1);
}
+#endif /* CLIB_MARCH_VARIANT */
/* Use buffer's sw_if_index[VNET_TX] to choose output interface. */
-static uword
-vnet_per_buffer_interface_output (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * frame)
+VLIB_NODE_FN (vnet_per_buffer_interface_output_node) (vlib_main_t * vm,
+ vlib_node_runtime_t *
+ node,
+ vlib_frame_t * frame)
{
vnet_main_t *vnm = vnet_get_main ();
u32 n_left_to_next, *from, *to_next;
@@ -1378,6 +1382,7 @@ pcap_drop_trace (vlib_main_t * vm,
}
}
+#ifndef CLIB_MARCH_VARIANT
void
vnet_pcap_drop_trace_filter_add_del (u32 error_index, int is_add)
{
@@ -1391,10 +1396,10 @@ vnet_pcap_drop_trace_filter_add_del (u32 error_index, int is_add)
else
hash_unset (im->pcap_drop_filter_hash, error_index);
}
+#endif /* CLIB_MARCH_VARIANT */
-static uword
-process_drop (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (drop_buffers) (vlib_main_t * vm,
+ vlib_node_runtime_t * node, vlib_frame_t * frame)
{
vnet_interface_main_t *im = &vnet_get_main ()->interface_main;
@@ -1404,16 +1409,14 @@ process_drop (vlib_main_t * vm,
return process_drop_punt (vm, node, frame, VNET_ERROR_DISPOSITION_DROP);
}
-static uword
-process_punt (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (punt_buffers) (vlib_main_t * vm,
+ vlib_node_runtime_t * node, vlib_frame_t * frame)
{
return process_drop_punt (vm, node, frame, VNET_ERROR_DISPOSITION_PUNT);
}
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (drop_buffers,static) = {
- .function = process_drop,
+VLIB_REGISTER_NODE (drop_buffers) = {
.name = "error-drop",
.flags = VLIB_NODE_FLAG_IS_DROP,
.vector_size = sizeof (u32),
@@ -1422,11 +1425,8 @@ VLIB_REGISTER_NODE (drop_buffers,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (drop_buffers, process_drop);
-
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (punt_buffers,static) = {
- .function = process_punt,
+VLIB_REGISTER_NODE (punt_buffers) = {
.flags = (VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH
| VLIB_NODE_FLAG_IS_PUNT),
.name = "error-punt",
@@ -1436,11 +1436,8 @@ VLIB_REGISTER_NODE (punt_buffers,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (punt_buffers, process_punt);
-
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (vnet_per_buffer_interface_output_node,static) = {
- .function = vnet_per_buffer_interface_output,
+VLIB_REGISTER_NODE (vnet_per_buffer_interface_output_node) = {
.name = "interface-output",
.vector_size = sizeof (u32),
};
@@ -1477,9 +1474,6 @@ VLIB_REGISTER_NODE (misc_drop_buffers_node,static) = {
};
/* *INDENT-ON* */
-VLIB_NODE_FUNCTION_MULTIARCH (vnet_per_buffer_interface_output_node,
- vnet_per_buffer_interface_output);
-
static uword
interface_tx_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * from_frame)
@@ -1564,6 +1558,7 @@ VNET_FEATURE_INIT (interface_tx, static) = {
};
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
clib_error_t *
vnet_per_buffer_interface_output_hw_interface_add_del (vnet_main_t * vnm,
u32 hw_if_index,
@@ -1597,6 +1592,7 @@ vnet_set_interface_output_node (vnet_main_t * vnm,
hi->output_node_next_index = next_index;
hi->output_node_index = node_index;
}
+#endif /* CLIB_MARCH_VARIANT */
static clib_error_t *
pcap_drop_trace_command_fn (vlib_main_t * vm,
diff --git a/src/vnet/interface_stats.c b/src/vnet/interface_stats.c
index 969f8930350..40a22b48e8f 100644
--- a/src/vnet/interface_stats.c
+++ b/src/vnet/interface_stats.c
@@ -20,6 +20,7 @@
#include <vnet/feature/feature.h>
#include <vnet/ethernet/ethernet.h>
+#ifndef CLIB_MARCH_VARIANT
int
vnet_sw_interface_stats_collect_enable_disable (u32 sw_if_index, u8 enable)
{
@@ -54,6 +55,7 @@ vnet_sw_interface_stats_collect_enable_disable (u32 sw_if_index, u8 enable)
return (0);
}
+#endif /* CLIB_MARCH_VARIANT */
static u8 *
format_stats_collect_trace (u8 * s, va_list * args)
@@ -154,16 +156,16 @@ stats_collect_inline (vlib_main_t * vm,
return frame->n_vectors;
}
-static uword
-stats_collect_rx (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (stats_collect_rx_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return stats_collect_inline (vm, node, frame, VLIB_RX);
}
-static uword
-stats_collect_tx (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (stats_collect_tx_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
return stats_collect_inline (vm, node, frame, VLIB_TX);
}
@@ -175,7 +177,6 @@ VLIB_REGISTER_NODE (stats_collect_rx_node) = {
.type = VLIB_NODE_TYPE_INTERNAL,
.n_errors = 0,
.n_next_nodes = 0,
- .function = stats_collect_rx,
.name = "stats-collect-rx",
};
@@ -185,13 +186,9 @@ VLIB_REGISTER_NODE (stats_collect_tx_node) = {
.type = VLIB_NODE_TYPE_INTERNAL,
.n_errors = 0,
.n_next_nodes = 0,
- .function = stats_collect_tx,
.name = "stats-collect-tx",
};
-VLIB_NODE_FUNCTION_MULTIARCH (stats_collect_rx_node, stats_collect_rx);
-VLIB_NODE_FUNCTION_MULTIARCH (stats_collect_tx_node, stats_collect_tx);
-
VNET_FEATURE_INIT (stats_collect_rx_node, static) = {
.arc_name = "device-input",
.node_name = "stats-collect-rx",