diff options
author | Andreas Schultz <andreas.schultz@travelping.com> | 2019-07-15 15:40:56 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-10-30 20:42:38 +0000 |
commit | faf62c8b20e8335bf0e86a68d34636bf4c312fef (patch) | |
tree | eeea70c8d3418f11bc7c296d51f6e96ec588ba81 /src/plugins | |
parent | dfec10d13772b202eb598ee9b72ab3721e5a1584 (diff) |
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
Change-Id: Ifa6e6e984aafe1e2755bff80f0a4dfcddee3623c
Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
Signed-off-by: Dave Barach <dave@barachs.net>
(cherry picked from commit 58b2eb1af562c292feb6d3cdce4656746e61da75)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/avf/input.c | 2 | ||||
-rw-r--r-- | src/plugins/dpdk/device/node.c | 2 | ||||
-rw-r--r-- | src/plugins/memif/node.c | 2 | ||||
-rw-r--r-- | src/plugins/rdma/input.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/avf/input.c b/src/plugins/avf/input.c index a5d3220c099..fcc5518abeb 100644 --- a/src/plugins/avf/input.c +++ b/src/plugins/avf/input.c @@ -416,7 +416,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 4edce1a3677..f89e1a565cc 100644 --- a/src/plugins/dpdk/device/node.c +++ b/src/plugins/dpdk/device/node.c @@ -377,7 +377,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 07ce76dc6d5..a4b8245b520 100644 --- a/src/plugins/memif/node.c +++ b/src/plugins/memif/node.c @@ -364,7 +364,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); diff --git a/src/plugins/rdma/input.c b/src/plugins/rdma/input.c index 02ac9bf27c6..7ced1ec66d4 100644 --- a/src/plugins/rdma/input.c +++ b/src/plugins/rdma/input.c @@ -182,7 +182,7 @@ rdma_device_input_ethernet (vlib_main_t * vm, vlib_node_runtime_t * node, nf = vlib_node_runtime_get_next_frame (vm, node, rd->per_interface_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; /* FIXME: f->flags |= ETH_INPUT_FRAME_F_IP4_CKSUM_OK; */ |