Deprecate old mutliarch code, phase 1
It is causing compilation sloness with gcc-7 so removing it
before it was originally planned.
So far macros are left in the tree so we can know which nodes to
convert to new multiarch code.
Change-Id: Idb14622ca61fdce1eba59723b20d98715b7971e6
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/plugins/ixge/ixge.c b/src/plugins/ixge/ixge.c
index a3c0c97..8faa9a9 100644
--- a/src/plugins/ixge/ixge.c
+++ b/src/plugins/ixge/ixge.c
@@ -2238,8 +2238,6 @@
},
};
-VLIB_NODE_FUNCTION_MULTIARCH_CLONE (ixge_input)
-CLIB_MULTIARCH_SELECT_FN (ixge_input)
/* *INDENT-ON* */
static u8 *
@@ -2851,7 +2849,7 @@
if (vec_len (xm->devices) == 1)
{
- ixge_input_node.function = ixge_input_multiarch_select ();
+ ixge_input_node.function = ixge_input;
}
xd->pci_dev_handle = h;
diff --git a/src/vlib/node.h b/src/vlib/node.h
index 8bb89f4..e5d46d8 100644
--- a/src/vlib/node.h
+++ b/src/vlib/node.h
@@ -217,31 +217,9 @@
} \
uword CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (node##_fn)
-#if CLIB_DEBUG > 0
-#define VLIB_NODE_FUNCTION_CLONE_TEMPLATE(arch, fn)
-#define VLIB_NODE_FUNCTION_MULTIARCH_CLONE(fn)
+
+/* FIXME to be removed */
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
-#else
-#define VLIB_NODE_FUNCTION_CLONE_TEMPLATE(arch, fn, tgt) \
- uword \
- __attribute__ ((flatten)) \
- __attribute__ ((target (tgt))) \
- CLIB_CPU_OPTIMIZED \
- fn ## _ ## arch ( struct vlib_main_t * vm, \
- struct vlib_node_runtime_t * node, \
- struct vlib_frame_t * frame) \
- { return fn (vm, node, frame); }
-
-#define VLIB_NODE_FUNCTION_MULTIARCH_CLONE(fn) \
- foreach_march_variant(VLIB_NODE_FUNCTION_CLONE_TEMPLATE, fn)
-
-#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn) \
- VLIB_NODE_FUNCTION_MULTIARCH_CLONE(fn) \
- CLIB_MULTIARCH_SELECT_FN(fn, static inline) \
- static void __attribute__((__constructor__)) \
- __vlib_node_function_multiarch_select_##node (void) \
- { node.function = fn ## _multiarch_select(); }
-#endif
always_inline vlib_node_registration_t *
vlib_node_next_registered (vlib_node_registration_t * c)
diff --git a/src/vnet/ethernet/interface.c b/src/vnet/ethernet/interface.c
index 408b0eb..1c13c40 100644
--- a/src/vnet/ethernet/interface.c
+++ b/src/vnet/ethernet/interface.c
@@ -659,9 +659,6 @@
};
/* *INDENT-ON* */
-VLIB_DEVICE_TX_FUNCTION_MULTIARCH (ethernet_simulated_device_class,
- simulated_ethernet_interface_tx);
-
/*
* Maintain a bitmap of allocated loopback instance numbers.
*/
diff --git a/src/vnet/interface.c b/src/vnet/interface.c
index 37f27ea..12204bd 100644
--- a/src/vnet/interface.c
+++ b/src/vnet/interface.c
@@ -837,7 +837,7 @@
/* 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_multiarch_select ();
+ node->function = vnet_interface_output_node;
node->format_trace = format_vnet_interface_output_trace;
/* *INDENT-OFF* */
foreach_vlib_main ({
@@ -887,7 +887,7 @@
r.flags = 0;
r.name = output_node_name;
- r.function = vnet_interface_output_node_multiarch_select ();
+ r.function = vnet_interface_output_node;
r.format_trace = format_vnet_interface_output_trace;
{
diff --git a/src/vnet/interface.h b/src/vnet/interface.h
index 2e32a79..174e534 100644
--- a/src/vnet/interface.h
+++ b/src/vnet/interface.h
@@ -302,30 +302,8 @@
} \
uword CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (devclass##_tx_fn)
-#define VLIB_DEVICE_TX_FUNCTION_CLONE_TEMPLATE(arch, fn, tgt) \
- uword \
- __attribute__ ((flatten)) \
- __attribute__ ((target (tgt))) \
- CLIB_CPU_OPTIMIZED \
- fn ## _ ## arch ( vlib_main_t * vm, \
- vlib_node_runtime_t * node, \
- vlib_frame_t * frame) \
- { return fn (vm, node, frame); }
-
-#define VLIB_DEVICE_TX_FUNCTION_MULTIARCH_CLONE(fn) \
- foreach_march_variant(VLIB_DEVICE_TX_FUNCTION_CLONE_TEMPLATE, fn)
-
-#if CLIB_DEBUG > 0
-#define VLIB_MULTIARCH_CLONE_AND_SELECT_FN(fn,...)
+/* FIXME to be removed */
#define VLIB_DEVICE_TX_FUNCTION_MULTIARCH(dev, fn)
-#else
-#define VLIB_DEVICE_TX_FUNCTION_MULTIARCH(dev, fn) \
- VLIB_DEVICE_TX_FUNCTION_MULTIARCH_CLONE(fn) \
- CLIB_MULTIARCH_SELECT_FN(fn, static inline) \
- static void __attribute__((__constructor__)) \
- __vlib_device_tx_function_multiarch_select_##dev (void) \
- { dev.tx_function = fn ## _multiarch_select(); }
-#endif
/**
* Link Type: A description of the protocol of packets on the link.
@@ -872,6 +850,10 @@
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);
+
#endif /* included_vnet_interface_h */
/*
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h
index c4c6617..9a674b1 100644
--- a/src/vnet/interface_funcs.h
+++ b/src/vnet/interface_funcs.h
@@ -418,8 +418,6 @@
} vnet_interface_output_runtime_t;
/* Interface output function. */
-void *vnet_interface_output_node_multiarch_select (void);
-
word vnet_sw_interface_compare (vnet_main_t * vnm, uword sw_if_index0,
uword sw_if_index1);
word vnet_hw_interface_compare (vnet_main_t * vnm, uword hw_if_index0,
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index e814efa..beeb62a 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -446,7 +446,7 @@
return n_buffers;
}
-static uword
+uword
vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
@@ -463,9 +463,6 @@
/* do_tx_offloads */ 1);
}
-VLIB_NODE_FUNCTION_MULTIARCH_CLONE (vnet_interface_output_node);
-CLIB_MULTIARCH_SELECT_FN (vnet_interface_output_node);
-
/* Use buffer's sw_if_index[VNET_TX] to choose output interface. */
static uword
vnet_per_buffer_interface_output (vlib_main_t * vm,
diff --git a/src/vnet/ip/ip_checksum.c b/src/vnet/ip/ip_checksum.c
index 36467a2..d586649 100644
--- a/src/vnet/ip/ip_checksum.c
+++ b/src/vnet/ip/ip_checksum.c
@@ -120,34 +120,13 @@
* function which uses the function pointer we set up in
* ip_checksum_init().
*/
-#if CLIB_DEBUG > 0
-#define IP_INCREMENTAL_CHECKSUM_CLONE_TEMPLATE(arch, fn)
-#define IP_INCREMENTAL_CHECKSUM_MULTIARCH_CLONE(fn)
-#else
-#define IP_INCREMENTAL_CHECKSUM_CLONE_TEMPLATE(arch, fn, tgt) \
- uword \
- __attribute__ ((flatten)) \
- __attribute__ ((target (tgt))) \
- CLIB_CPU_OPTIMIZED \
- fn ## _ ## arch (ip_csum_t sum, \
- void *_data, \
- uword n_bytes) \
- { return fn (sum, _data, n_bytes); }
-
-#define IP_INCREMENTAL_CHECKSUM_MULTIARCH_CLONE(fn) \
- foreach_march_variant(IP_INCREMENTAL_CHECKSUM_CLONE_TEMPLATE,fn)
-#endif
-
-IP_INCREMENTAL_CHECKSUM_MULTIARCH_CLONE (_ip_incremental_checksum);
-
-CLIB_MULTIARCH_SELECT_FN (_ip_incremental_checksum, static inline);
ip_csum_t (*vnet_incremental_checksum_fp) (ip_csum_t, void *, uword);
static clib_error_t *
ip_checksum_init (vlib_main_t * vm)
{
- vnet_incremental_checksum_fp = _ip_incremental_checksum_multiarch_select ();
+ vnet_incremental_checksum_fp = _ip_incremental_checksum;
return 0;
}
diff --git a/src/vppinfra/cpu.h b/src/vppinfra/cpu.h
index 7f0d6ad..ee199e2 100644
--- a/src/vppinfra/cpu.h
+++ b/src/vppinfra/cpu.h
@@ -45,12 +45,8 @@
if (clib_cpu_supports_ ## arch()) \
return & fn ## _ ##arch;
-#define CLIB_MULTIARCH_SELECT_FN(fn,...) \
- __VA_ARGS__ void * fn ## _multiarch_select(void) \
-{ \
- foreach_march_variant(CLIB_MULTIARCH_ARCH_CHECK, fn) \
- return & fn; \
-}
+/* FIXME to be removed */
+#define CLIB_MULTIARCH_SELECT_FN(fn,...)
#ifdef CLIB_MARCH_VARIANT
#define __CLIB_MULTIARCH_FN(a,b) a##_##b