diff options
author | Damjan Marion <damarion@cisco.com> | 2018-08-10 22:39:11 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-08-13 14:33:54 +0000 |
commit | 6e36351faf5b69a0bfb8235b3b06f8b2c24e5547 (patch) | |
tree | 512c92bda1a48604fbfbc7bbbb1e4b613cdba614 /src/plugins/dpdk/device/device.c | |
parent | 3bf6c2bfe59be62169a1245340722481b0b53870 (diff) |
Multiarch handling in different constructor macros
This significantly reduces need for
...
in multiarch code. Simply constructor macros will jost create static unused
entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by
compiler.
Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/device.c')
-rw-r--r-- | src/plugins/dpdk/device/device.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c index 8776e09ed05..b2c87c7930d 100644 --- a/src/plugins/dpdk/device/device.c +++ b/src/plugins/dpdk/device/device.c @@ -37,7 +37,6 @@ typedef enum DPDK_TX_FUNC_N_ERROR, } dpdk_tx_func_error_t; -#ifndef CLIB_MARCH_VARIANT static char *dpdk_tx_func_error_strings[] = { #define _(n,s) s, foreach_dpdk_tx_func_error @@ -65,7 +64,6 @@ dpdk_set_mac_address (vnet_hw_interface_t * hi, char *address) return NULL; } } -#endif static struct rte_mbuf * dpdk_replicate_packet_mb (vlib_buffer_t * b) @@ -516,7 +514,6 @@ VNET_DEVICE_CLASS_TX_FN (dpdk_device_class) (vlib_main_t * vm, return tx_pkts; } -#ifndef CLIB_MARCH_VARIANT static void dpdk_clear_hw_interface_counters (u32 instance) { @@ -677,12 +674,9 @@ VNET_DEVICE_CLASS (dpdk_device_class) = { }; /* *INDENT-ON* */ -#endif - #define UP_DOWN_FLAG_EVENT 1 -#ifndef CLIB_MARCH_VARIANT -uword +static uword admin_up_down_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) { @@ -726,14 +720,13 @@ admin_up_down_process (vlib_main_t * vm, } /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (admin_up_down_process_node,static) = { +VLIB_REGISTER_NODE (admin_up_down_process_node) = { .function = admin_up_down_process, .type = VLIB_NODE_TYPE_PROCESS, .name = "admin-up-down-process", .process_log2_n_stack_bytes = 17, // 256KB }; /* *INDENT-ON* */ -#endif /* * fd.io coding-style-patch-verification: ON |