aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-08-10 22:39:11 +0200
committerDamjan Marion <dmarion@me.com>2018-08-13 14:33:54 +0000
commit6e36351faf5b69a0bfb8235b3b06f8b2c24e5547 (patch)
tree512c92bda1a48604fbfbc7bbbb1e4b613cdba614 /src/plugins/memif
parent3bf6c2bfe59be62169a1245340722481b0b53870 (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/memif')
-rw-r--r--src/plugins/memif/device.c19
-rw-r--r--src/plugins/memif/node.c2
2 files changed, 8 insertions, 13 deletions
diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c
index f86d692a103..a05ab87a864 100644
--- a/src/plugins/memif/device.c
+++ b/src/plugins/memif/device.c
@@ -40,7 +40,7 @@ typedef enum
MEMIF_TX_N_ERROR,
} memif_tx_func_error_t;
-static __clib_unused char *memif_tx_func_error_strings[] = {
+static char *memif_tx_func_error_strings[] = {
#define _(n,s) s,
foreach_memif_tx_func_error
#undef _
@@ -61,7 +61,7 @@ format_memif_device_name (u8 * s, va_list * args)
}
#endif
-static __clib_unused u8 *
+static u8 *
format_memif_device (u8 * s, va_list * args)
{
u32 dev_instance = va_arg (*args, u32);
@@ -77,7 +77,7 @@ format_memif_device (u8 * s, va_list * args)
return s;
}
-static __clib_unused u8 *
+static u8 *
format_memif_tx_trace (u8 * s, va_list * args)
{
s = format (s, "Unimplemented...");
@@ -432,7 +432,7 @@ VNET_DEVICE_CLASS_TX_FN (memif_device_class) (vlib_main_t * vm,
mq, ptd);
}
-static __clib_unused void
+static void
memif_set_interface_next_node (vnet_main_t * vnm, u32 hw_if_index,
u32 node_index)
{
@@ -451,13 +451,13 @@ memif_set_interface_next_node (vnet_main_t * vnm, u32 hw_if_index,
vlib_node_add_next (vlib_get_main (), memif_input_node.index, node_index);
}
-static __clib_unused void
+static void
memif_clear_hw_interface_counters (u32 instance)
{
/* Nothing for now */
}
-static __clib_unused clib_error_t *
+static clib_error_t *
memif_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
vnet_hw_interface_rx_mode mode)
{
@@ -474,7 +474,7 @@ memif_interface_rx_mode_change (vnet_main_t * vnm, u32 hw_if_index, u32 qid,
return 0;
}
-static __clib_unused clib_error_t *
+static clib_error_t *
memif_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
{
memif_main_t *mm = &memif_main;
@@ -490,7 +490,7 @@ memif_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
return error;
}
-static __clib_unused clib_error_t *
+static clib_error_t *
memif_subif_add_del_function (vnet_main_t * vnm,
u32 hw_if_index,
struct vnet_sw_interface_t *st, int is_add)
@@ -499,7 +499,6 @@ memif_subif_add_del_function (vnet_main_t * vnm,
return 0;
}
-#ifndef CLIB_MARCH_VARIANT
/* *INDENT-OFF* */
VNET_DEVICE_CLASS (memif_device_class) = {
.name = "memif",
@@ -515,8 +514,6 @@ VNET_DEVICE_CLASS (memif_device_class) = {
.rx_mode_change_function = memif_interface_rx_mode_change,
};
-#endif
-
/* *INDENT-ON* */
/*
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 726adb886a5..53a355361a6 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -885,7 +885,6 @@ VLIB_NODE_FN (memif_input_node) (vlib_main_t * vm,
return n_rx;
}
-#ifndef CLIB_MARCH_VARIANT
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (memif_input_node) = {
.name = "memif-input",
@@ -896,7 +895,6 @@ VLIB_REGISTER_NODE (memif_input_node) = {
.n_errors = MEMIF_INPUT_N_ERROR,
.error_strings = memif_input_error_strings,
};
-#endif
/* *INDENT-ON* */