aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-11-09 15:23:52 +0100
committerDamjan Marion <dmarion@me.com>2020-11-13 11:46:41 +0000
commit7d2094c12b01ac1f902755157361bd0eb547abac (patch)
treedd4273728be71effa6c6857a6203e25682a3a05b
parent6807b77f24cf95e432ccdffef07d81d4a989beb9 (diff)
interface: add multiarch support for per-interface tx node
Type: improvement Change-Id: Ia4ce47c0f727cf7b02294f05b94f14e788f52f30 Signed-off-by: Benoît Ganne <bganne@cisco.com>
-rw-r--r--src/vnet/interface.c5
-rw-r--r--src/vnet/interface.h4
-rw-r--r--src/vnet/interface_output.c20
3 files changed, 19 insertions, 10 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index f0ac40df4a8..5bc1a6eae23 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -769,6 +769,7 @@ vnet_register_interface (vnet_main_t * vnm,
vnet_config_main_t *cm;
u32 hw_index, i;
char *tx_node_name = NULL, *output_node_name = NULL;
+ vlib_node_function_t *output_node = vnet_interface_output_node_get ();
pool_get (im->hw_interfaces, hw);
clib_memset (hw, 0, sizeof (*hw));
@@ -854,7 +855,7 @@ vnet_register_interface (vnet_main_t * vnm,
/* The new class may differ from the old one.
* Functions have to be updated. */
node = vlib_get_node (vm, hw->output_node_index);
- node->function = vnet_interface_output_node;
+ node->function = output_node;
node->format_trace = format_vnet_interface_output_trace;
/* *INDENT-OFF* */
foreach_vlib_main ({
@@ -908,7 +909,7 @@ vnet_register_interface (vnet_main_t * vnm,
r.flags = 0;
r.name = output_node_name;
- r.function = vnet_interface_output_node;
+ r.function = output_node;
r.format_trace = format_vnet_interface_output_trace;
{
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index 155e4fc1f0e..71d6a775708 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -918,9 +918,7 @@ void vnet_pcap_drop_trace_filter_add_del (u32 error_index, int is_add);
int vnet_interface_name_renumber (u32 sw_if_index, u32 new_show_dev_instance);
-uword vnet_interface_output_node (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * frame);
+vlib_node_function_t *vnet_interface_output_node_get (void);
void vnet_register_format_buffer_opaque_helper
(vnet_buffer_opquae_formatter_t fn);
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 65bc4a4b7ec..3363f76b722 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -91,6 +91,7 @@ format_vnet_interface_output_trace (u8 * s, va_list * va)
}
return s;
}
+#endif /* CLIB_MARCH_VARIANT */
static void
vnet_interface_output_trace (vlib_main_t * vm,
@@ -427,7 +428,6 @@ vnet_interface_output_node_inline (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,
@@ -486,11 +486,12 @@ static_always_inline void vnet_interface_pcap_tx_trace
}
}
-#ifndef CLIB_MARCH_VARIANT
+static vlib_node_function_t CLIB_MULTIARCH_FN (vnet_interface_output_node);
-uword
-vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node,
- vlib_frame_t * frame)
+static uword
+CLIB_MULTIARCH_FN (vnet_interface_output_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
vnet_main_t *vnm = vnet_get_main ();
vnet_hw_interface_t *hi;
@@ -507,6 +508,15 @@ 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);
}
+
+CLIB_MARCH_FN_REGISTRATION (vnet_interface_output_node);
+
+#ifndef CLIB_MARCH_VARIANT
+vlib_node_function_t *
+vnet_interface_output_node_get (void)
+{
+ return CLIB_MARCH_FN_POINTER (vnet_interface_output_node);
+}
#endif /* CLIB_MARCH_VARIANT */
/* Use buffer's sw_if_index[VNET_TX] to choose output interface. */