From ac0e98a67553747b823d8398896559bb07cafe3d Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Wed, 20 Nov 2019 07:37:28 -0800 Subject: vlib: convert frame_index into real pointers The fast path almost always has to deal with the real pointers. Deriving the frame pointer from a frame_index requires a load of the 32bit frame_index from memory, another 64bit load of the heap base pointer and some calculations. Lets store the full pointer instead and do a single 64bit load only. This helps avoiding problems when the heap is grown and frames are allocated below vm->heap_aligned_base. Type: refactor Signed-off-by: Steven Luong Change-Id: I616fe3fbe501c4e2205cd74840eb95c550603508 --- src/plugins/avf/input.c | 2 +- src/plugins/dpdk/device/node.c | 2 +- src/plugins/memif/node.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c index 541a235c7f2..c118e3cc5e6 100644 --- a/src/plugins/avf/input.c +++ b/src/plugins/avf/input.c @@ -402,7 +402,7 @@ no_more_desc: vlib_frame_t *f; ethernet_input_frame_t *ef; nf = vlib_node_runtime_get_next_frame (vm, node, next_index); - f = vlib_get_frame (vm, nf->frame_index); + f = vlib_get_frame (vm, nf->frame); f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX; ef = vlib_frame_scalar_args (f); diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c index 4066a89b00d..f7583df8424 100644 --- a/src/plugins/dpdk/device/node.c +++ b/src/plugins/dpdk/device/node.c @@ -376,7 +376,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd, vlib_frame_t *f; ethernet_input_frame_t *ef; nf = vlib_node_runtime_get_next_frame (vm, node, next_index); - f = vlib_get_frame (vm, nf->frame_index); + f = vlib_get_frame (vm, nf->frame); f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX; ef = vlib_frame_scalar_args (f); diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c index ae6e6e74ef8..9b7b078e33f 100644 --- a/src/plugins/memif/node.c +++ b/src/plugins/memif/node.c @@ -360,7 +360,7 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t *f; ethernet_input_frame_t *ef; nf = vlib_node_runtime_get_next_frame (vm, node, next_index); - f = vlib_get_frame (vm, nf->frame_index); + f = vlib_get_frame (vm, nf->frame); f->flags = ETH_INPUT_FRAME_F_SINGLE_SW_IF_IDX; ef = vlib_frame_scalar_args (f); -- cgit 1.2.3-korg