From 9652177bc12171bb7141ef7a92e0053204f7ed87 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Fri, 11 Mar 2022 14:57:42 +0100 Subject: [PATCH] vlib: remoove unused field Type: refactor Change-Id: Ieb7a595e40d801af5349c83b128fa92c7698a346 Signed-off-by: Damjan Marion --- src/plugins/dpdk/device/node.c | 2 +- src/vlib/main.c | 16 ---------------- src/vlib/node.h | 2 -- src/vlib/threads.c | 6 ------ 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c index e0ba517d2ce..0450c422154 100644 --- a/src/plugins/dpdk/device/node.c +++ b/src/plugins/dpdk/device/node.c @@ -542,7 +542,7 @@ VLIB_NODE_FN (dpdk_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node, dpdk_device_t *xd; uword n_rx_packets = 0; vnet_hw_if_rxq_poll_vector_t *pv; - u32 thread_index = node->thread_index; + u32 thread_index = vm->thread_index; /* * Poll all devices on this cpu for input/interrupts. diff --git a/src/vlib/main.c b/src/vlib/main.c index 874f6a1350b..fd0c1fc5f7c 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -477,12 +477,8 @@ vlib_put_next_frame (vlib_main_t * vm, if (!(f->frame_flags & VLIB_FRAME_PENDING)) { __attribute__ ((unused)) vlib_node_t *node; - vlib_node_t *next_node; - vlib_node_runtime_t *next_runtime; node = vlib_get_node (vm, r->node_index); - next_node = vlib_get_next_node (vm, r->node_index, next_index); - next_runtime = vlib_node_get_runtime (vm, next_node->index); vec_add2 (nm->pending_frames, p, 1); @@ -491,18 +487,6 @@ vlib_put_next_frame (vlib_main_t * vm, p->next_frame_index = nf - nm->next_frames; nf->flags |= VLIB_FRAME_PENDING; f->frame_flags |= VLIB_FRAME_PENDING; - - /* - * If we're going to dispatch this frame on another thread, - * force allocation of a new frame. Otherwise, we create - * a dangling frame reference. Each thread has its own copy of - * the next_frames vector. - */ - if (0 && r->thread_index != next_runtime->thread_index) - { - nf->frame = NULL; - nf->flags &= ~(VLIB_FRAME_PENDING | VLIB_FRAME_IS_ALLOCATED); - } } /* Copy trace flag from next_frame and from runtime. */ diff --git a/src/vlib/node.h b/src/vlib/node.h index 2d4aa77a61f..296d1832841 100644 --- a/src/vlib/node.h +++ b/src/vlib/node.h @@ -503,8 +503,6 @@ typedef struct vlib_node_runtime_t zero before first run of this node. */ - u16 thread_index; /**< thread this node runs on */ - u8 runtime_data[0]; /**< Function dependent node-runtime data. This data is thread local, and it is not diff --git a/src/vlib/threads.c b/src/vlib/threads.c index 23e52c68a4f..dade7bfcb40 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -681,7 +681,6 @@ start_workers (vlib_main_t * vm) nm_clone->nodes_by_type[VLIB_NODE_TYPE_INTERNAL]) { vlib_node_t *n = vlib_get_node (vm, rt->node_index); - rt->thread_index = vm_clone->thread_index; /* copy initial runtime_data from node */ if (n->runtime_data && n->runtime_data_bytes > 0) clib_memcpy (rt->runtime_data, n->runtime_data, @@ -698,7 +697,6 @@ start_workers (vlib_main_t * vm) vec_foreach (rt, nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT]) { vlib_node_t *n = vlib_get_node (vm, rt->node_index); - rt->thread_index = vm_clone->thread_index; /* copy initial runtime_data from node */ if (n->runtime_data && n->runtime_data_bytes > 0) clib_memcpy (rt->runtime_data, n->runtime_data, @@ -713,7 +711,6 @@ start_workers (vlib_main_t * vm) nm_clone->nodes_by_type[VLIB_NODE_TYPE_PRE_INPUT]) { vlib_node_t *n = vlib_get_node (vm, rt->node_index); - rt->thread_index = vm_clone->thread_index; /* copy initial runtime_data from node */ if (n->runtime_data && n->runtime_data_bytes > 0) clib_memcpy (rt->runtime_data, n->runtime_data, @@ -984,7 +981,6 @@ vlib_worker_thread_node_refork (void) vec_foreach (rt, nm_clone->nodes_by_type[VLIB_NODE_TYPE_INTERNAL]) { vlib_node_t *n = vlib_get_node (vm, rt->node_index); - rt->thread_index = vm_clone->thread_index; /* copy runtime_data, will be overwritten later for existing rt */ if (n->runtime_data && n->runtime_data_bytes > 0) clib_memcpy_fast (rt->runtime_data, n->runtime_data, @@ -1015,7 +1011,6 @@ vlib_worker_thread_node_refork (void) vec_foreach (rt, nm_clone->nodes_by_type[VLIB_NODE_TYPE_INPUT]) { vlib_node_t *n = vlib_get_node (vm, rt->node_index); - rt->thread_index = vm_clone->thread_index; /* copy runtime_data, will be overwritten later for existing rt */ if (n->runtime_data && n->runtime_data_bytes > 0) clib_memcpy_fast (rt->runtime_data, n->runtime_data, @@ -1043,7 +1038,6 @@ vlib_worker_thread_node_refork (void) vec_foreach (rt, nm_clone->nodes_by_type[VLIB_NODE_TYPE_PRE_INPUT]) { vlib_node_t *n = vlib_get_node (vm, rt->node_index); - rt->thread_index = vm_clone->thread_index; /* copy runtime_data, will be overwritten later for existing rt */ if (n->runtime_data && n->runtime_data_bytes > 0) clib_memcpy_fast (rt->runtime_data, n->runtime_data, -- 2.16.6