From d0ffa26a0e2910f9b7108b0b133e2da7de278178 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Sat, 14 Oct 2023 08:41:54 +0000 Subject: feature: remove unused code Type: improvement Change-Id: If775b1d145e462346de562a3c893f302e8c7b814 Signed-off-by: Damjan Marion --- src/vnet/devices/devices.c | 23 --------- src/vnet/devices/devices.h | 2 - src/vnet/devices/virtio/node.c | 2 +- src/vnet/feature/feature.h | 111 +---------------------------------------- src/vnet/unix/tuntap.c | 2 +- 5 files changed, 4 insertions(+), 136 deletions(-) (limited to 'src/vnet') diff --git a/src/vnet/devices/devices.c b/src/vnet/devices/devices.c index 1a4f02df6a8..bd3def9d324 100644 --- a/src/vnet/devices/devices.c +++ b/src/vnet/devices/devices.c @@ -40,29 +40,6 @@ VLIB_REGISTER_NODE (device_input_node) = { .next_nodes = VNET_DEVICE_INPUT_NEXT_NODES, }; -/* Table defines how much we need to advance current data pointer - in the buffer if we shortcut to l3 nodes */ - -const u32 __attribute__((aligned (CLIB_CACHE_LINE_BYTES))) -device_input_next_node_advance[((VNET_DEVICE_INPUT_N_NEXT_NODES / - CLIB_CACHE_LINE_BYTES) +1) * CLIB_CACHE_LINE_BYTES] = -{ - [VNET_DEVICE_INPUT_NEXT_IP4_INPUT] = sizeof (ethernet_header_t), - [VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT] = sizeof (ethernet_header_t), - [VNET_DEVICE_INPUT_NEXT_IP6_INPUT] = sizeof (ethernet_header_t), - [VNET_DEVICE_INPUT_NEXT_MPLS_INPUT] = sizeof (ethernet_header_t), -}; - -const u32 __attribute__((aligned (CLIB_CACHE_LINE_BYTES))) -device_input_next_node_flags[((VNET_DEVICE_INPUT_N_NEXT_NODES / - CLIB_CACHE_LINE_BYTES) +1) * CLIB_CACHE_LINE_BYTES] = -{ - [VNET_DEVICE_INPUT_NEXT_IP4_INPUT] = VNET_BUFFER_F_L3_HDR_OFFSET_VALID, - [VNET_DEVICE_INPUT_NEXT_IP4_NCS_INPUT] = VNET_BUFFER_F_L3_HDR_OFFSET_VALID, - [VNET_DEVICE_INPUT_NEXT_IP6_INPUT] = VNET_BUFFER_F_L3_HDR_OFFSET_VALID, - [VNET_DEVICE_INPUT_NEXT_MPLS_INPUT] = VNET_BUFFER_F_L3_HDR_OFFSET_VALID, -}; - VNET_FEATURE_ARC_INIT (device_input, static) = { .arc_name = "device-input", diff --git a/src/vnet/devices/devices.h b/src/vnet/devices/devices.h index e54c7a29130..cadf1f857a6 100644 --- a/src/vnet/devices/devices.h +++ b/src/vnet/devices/devices.h @@ -67,8 +67,6 @@ typedef struct extern vnet_device_main_t vnet_device_main; extern vlib_node_registration_t device_input_node; -extern const u32 device_input_next_node_advance[]; -extern const u32 device_input_next_node_flags[]; static inline u64 vnet_get_aggregate_rx_packets (void) diff --git a/src/vnet/devices/virtio/node.c b/src/vnet/devices/virtio/node.c index ec8b31038e5..b58c75360e3 100644 --- a/src/vnet/devices/virtio/node.c +++ b/src/vnet/devices/virtio/node.c @@ -271,7 +271,7 @@ virtio_device_input_gso_inline (vlib_main_t *vm, vlib_node_runtime_t *node, next_index = vif->per_interface_next_index; /* only for l2, redirect if feature path enabled */ - vnet_feature_start_device_input_x1 (vif->sw_if_index, &next_index, &bt); + vnet_feature_start_device_input (vif->sw_if_index, &next_index, &bt); } while (n_left) diff --git a/src/vnet/feature/feature.h b/src/vnet/feature/feature.h index a8235d3d9ee..b1917e8df13 100644 --- a/src/vnet/feature/feature.h +++ b/src/vnet/feature/feature.h @@ -344,8 +344,8 @@ vnet_device_input_have_features (u32 sw_if_index) } static_always_inline void -vnet_feature_start_device_input_x1 (u32 sw_if_index, u32 * next0, - vlib_buffer_t * b0) +vnet_feature_start_device_input (u32 sw_if_index, u32 *next0, + vlib_buffer_t *b0) { vnet_feature_main_t *fm = &feature_main; vnet_feature_config_main_t *cm; @@ -356,118 +356,11 @@ vnet_feature_start_device_input_x1 (u32 sw_if_index, u32 * next0, (clib_bitmap_get (fm->sw_if_index_has_features[feature_arc_index], sw_if_index))) { - /* - * Save next0 so that the last feature in the chain - * can skip ethernet-input if indicated... - */ - u16 adv; - - adv = device_input_next_node_advance[*next0]; - vlib_buffer_advance (b0, -adv); - - vnet_buffer (b0)->feature_arc_index = feature_arc_index; - b0->current_config_index = - vec_elt (cm->config_index_by_sw_if_index, sw_if_index); - vnet_get_config_data (&cm->config_main, &b0->current_config_index, - next0, /* # bytes of config data */ 0); - } -} - -static_always_inline void -vnet_feature_start_device_input_x2 (u32 sw_if_index, - u32 * next0, - u32 * next1, - vlib_buffer_t * b0, vlib_buffer_t * b1) -{ - vnet_feature_main_t *fm = &feature_main; - vnet_feature_config_main_t *cm; - u8 feature_arc_index = fm->device_input_feature_arc_index; - cm = &fm->feature_config_mains[feature_arc_index]; - - if (PREDICT_FALSE - (clib_bitmap_get - (fm->sw_if_index_has_features[feature_arc_index], sw_if_index))) - { - /* - * Save next0 so that the last feature in the chain - * can skip ethernet-input if indicated... - */ - u16 adv; - - adv = device_input_next_node_advance[*next0]; - vlib_buffer_advance (b0, -adv); - - adv = device_input_next_node_advance[*next1]; - vlib_buffer_advance (b1, -adv); - - vnet_buffer (b0)->feature_arc_index = feature_arc_index; - vnet_buffer (b1)->feature_arc_index = feature_arc_index; - b0->current_config_index = - vec_elt (cm->config_index_by_sw_if_index, sw_if_index); - b1->current_config_index = b0->current_config_index; - vnet_get_config_data (&cm->config_main, &b0->current_config_index, - next0, /* # bytes of config data */ 0); - vnet_get_config_data (&cm->config_main, &b1->current_config_index, - next1, /* # bytes of config data */ 0); - } -} - -static_always_inline void -vnet_feature_start_device_input_x4 (u32 sw_if_index, - u32 * next0, - u32 * next1, - u32 * next2, - u32 * next3, - vlib_buffer_t * b0, - vlib_buffer_t * b1, - vlib_buffer_t * b2, vlib_buffer_t * b3) -{ - vnet_feature_main_t *fm = &feature_main; - vnet_feature_config_main_t *cm; - u8 feature_arc_index = fm->device_input_feature_arc_index; - cm = &fm->feature_config_mains[feature_arc_index]; - - if (PREDICT_FALSE - (clib_bitmap_get - (fm->sw_if_index_has_features[feature_arc_index], sw_if_index))) - { - /* - * Save next0 so that the last feature in the chain - * can skip ethernet-input if indicated... - */ - u16 adv; - - adv = device_input_next_node_advance[*next0]; - vlib_buffer_advance (b0, -adv); - - adv = device_input_next_node_advance[*next1]; - vlib_buffer_advance (b1, -adv); - - adv = device_input_next_node_advance[*next2]; - vlib_buffer_advance (b2, -adv); - - adv = device_input_next_node_advance[*next3]; - vlib_buffer_advance (b3, -adv); - vnet_buffer (b0)->feature_arc_index = feature_arc_index; - vnet_buffer (b1)->feature_arc_index = feature_arc_index; - vnet_buffer (b2)->feature_arc_index = feature_arc_index; - vnet_buffer (b3)->feature_arc_index = feature_arc_index; - b0->current_config_index = vec_elt (cm->config_index_by_sw_if_index, sw_if_index); - b1->current_config_index = b0->current_config_index; - b2->current_config_index = b0->current_config_index; - b3->current_config_index = b0->current_config_index; - vnet_get_config_data (&cm->config_main, &b0->current_config_index, next0, /* # bytes of config data */ 0); - vnet_get_config_data (&cm->config_main, &b1->current_config_index, - next1, /* # bytes of config data */ 0); - vnet_get_config_data (&cm->config_main, &b2->current_config_index, - next2, /* # bytes of config data */ 0); - vnet_get_config_data (&cm->config_main, &b3->current_config_index, - next3, /* # bytes of config data */ 0); } } diff --git a/src/vnet/unix/tuntap.c b/src/vnet/unix/tuntap.c index b75b1f670b9..6bb1d802574 100644 --- a/src/vnet/unix/tuntap.c +++ b/src/vnet/unix/tuntap.c @@ -366,7 +366,7 @@ tuntap_rx (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) next_index = VNET_DEVICE_INPUT_NEXT_DROP; } - vnet_feature_start_device_input_x1 (tm->sw_if_index, &next_index, b); + vnet_feature_start_device_input (tm->sw_if_index, &next_index, b); vlib_set_next_frame_buffer (vm, node, next_index, bi); -- cgit 1.2.3-korg