aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2019-02-21 20:24:54 +0100
committerFlorin Coras <florin.coras@gmail.com>2019-02-22 01:25:08 +0000
commit296988d358cd570247dd8b9b8bd5816a856c3d30 (patch)
tree027fb46f207d6b2a829d7f421449eeba31b270d8 /src/vlib/main.c
parent67f935ec6eb9ec37b7d73029c5afa89cbf4a9aa2 (diff)
Add no-append flag to vlib_frame_t
Change-Id: I01c4f5755d579282773ac227b0bc24f8ddbb2bd1 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index eed627cf215..89202beaa42 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -233,7 +233,7 @@ vlib_frame_free (vlib_main_t * vm, vlib_node_runtime_t * r, vlib_frame_t * f)
ASSERT (nf->frame_index != frame_index);
}
- f->frame_flags &= ~VLIB_FRAME_IS_ALLOCATED;
+ f->frame_flags &= ~(VLIB_FRAME_IS_ALLOCATED | VLIB_FRAME_NO_APPEND);
vec_add1 (fs->free_frame_indices, frame_index);
ASSERT (fs->n_alloc_frames > 0);
@@ -387,9 +387,11 @@ vlib_get_next_frame_internal (vlib_main_t * vm,
f->flags = 0;
}
- /* Allocate new frame if current one is already full. */
+ /* Allocate new frame if current one is marked as no-append or
+ it is already full. */
n_used = f->n_vectors;
- if (n_used >= VLIB_FRAME_SIZE || (allocate_new_next_frame && n_used > 0))
+ if (n_used >= VLIB_FRAME_SIZE || (allocate_new_next_frame && n_used > 0) ||
+ (f->frame_flags & VLIB_FRAME_NO_APPEND))
{
/* Old frame may need to be freed after dispatch, since we'll have
two redundant frames from node -> next node. */
@@ -1370,7 +1372,7 @@ dispatch_pending_node (vlib_main_t * vm, uword pending_frame_index,
VLIB_NODE_STATE_POLLING,
f, last_time_stamp);
- f->frame_flags &= ~VLIB_FRAME_PENDING;
+ f->frame_flags &= ~(VLIB_FRAME_PENDING | VLIB_FRAME_NO_APPEND);
/* Frame is ready to be used again, so restore it. */
if (restore_frame_index != ~0)