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>
This commit is contained in:
committed by
Damjan Marion
parent
9bb20b3102
commit
652d2e1394
@@ -2238,8 +2238,6 @@ VLIB_REGISTER_NODE (ixge_input_node, static) = {
|
||||
},
|
||||
};
|
||||
|
||||
VLIB_NODE_FUNCTION_MULTIARCH_CLONE (ixge_input)
|
||||
CLIB_MULTIARCH_SELECT_FN (ixge_input)
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static u8 *
|
||||
@@ -2851,7 +2849,7 @@ ixge_pci_init (vlib_main_t * vm, vlib_pci_dev_handle_t h)
|
||||
|
||||
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;
|
||||
|
||||
@@ -217,31 +217,9 @@ CLIB_MARCH_SFX (node##_multiarch_register) (void) \
|
||||
} \
|
||||
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)
|
||||
|
||||
@@ -659,9 +659,6 @@ VNET_DEVICE_CLASS (ethernet_simulated_device_class) = {
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
VLIB_DEVICE_TX_FUNCTION_MULTIARCH (ethernet_simulated_device_class,
|
||||
simulated_ethernet_interface_tx);
|
||||
|
||||
/*
|
||||
* Maintain a bitmap of allocated loopback instance numbers.
|
||||
*/
|
||||
|
||||
@@ -837,7 +837,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_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 @@ vnet_register_interface (vnet_main_t * vnm,
|
||||
|
||||
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;
|
||||
|
||||
{
|
||||
|
||||
@@ -302,30 +302,8 @@ CLIB_MARCH_SFX (devclass##_tx_fn_multiarch_register) (void) \
|
||||
} \
|
||||
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 @@ 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);
|
||||
|
||||
#endif /* included_vnet_interface_h */
|
||||
|
||||
/*
|
||||
|
||||
@@ -418,8 +418,6 @@ typedef struct
|
||||
} 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,
|
||||
|
||||
@@ -446,7 +446,7 @@ vnet_interface_output_node_inline (vlib_main_t * vm,
|
||||
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 @@ vnet_interface_output_node (vlib_main_t * vm, vlib_node_runtime_t * node,
|
||||
/* 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,
|
||||
|
||||
@@ -120,34 +120,13 @@ do { \
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user