diff options
author | Andreas Schultz <andreas.schultz@travelping.com> | 2019-07-15 15:40:56 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-07-18 15:07:26 +0000 |
commit | 58b2eb1af562c292feb6d3cdce4656746e61da75 (patch) | |
tree | ba2d239dd4a2d4673ef1352143d1133a9f88ccd4 /src/vlib/node.h | |
parent | a0cb32cb9fba93ec4b91e7d227c07d1b2099091b (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>
Diffstat (limited to 'src/vlib/node.h')
-rw-r--r-- | src/vlib/node.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/vlib/node.h b/src/vlib/node.h index 4264a1ba1a5..bec0ed2d2c0 100644 --- a/src/vlib/node.h +++ b/src/vlib/node.h @@ -400,8 +400,8 @@ typedef struct vlib_frame_t typedef struct { - /* Frame index. */ - u32 frame_index; + /* Frame pointer. */ + vlib_frame_t *frame; /* Node runtime for this next. */ u32 node_runtime_index; @@ -440,7 +440,6 @@ always_inline void vlib_next_frame_init (vlib_next_frame_t * nf) { clib_memset (nf, 0, sizeof (nf[0])); - nf->frame_index = ~0; nf->node_runtime_index = ~0; } @@ -451,7 +450,7 @@ typedef struct u32 node_runtime_index; /* Frame index (in the heap). */ - u32 frame_index; + vlib_frame_t *frame; /* Start of next frames for this node. */ u32 next_frame_index; @@ -537,8 +536,8 @@ typedef struct /* Number of allocated frames for this scalar/vector size. */ u32 n_alloc_frames; - /* Vector of free frame indices for this scalar/vector size. */ - u32 *free_frame_indices; + /* Vector of free frames for this scalar/vector size. */ + vlib_frame_t **free_frames; } vlib_frame_size_t; typedef struct |