diff options
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r-- | src/vnet/session/session_node.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index bebabd3d68e..403c28f28ce 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -1319,6 +1319,8 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk, ctx->left_to_snd = ctx->max_len_to_snd; n_left = ctx->n_segs_per_evt; + vec_validate (ctx->transport_pending_bufs, n_left); + while (n_left >= 4) { vlib_buffer_t *b0, *b1; @@ -1340,9 +1342,8 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk, session_tx_fill_buffer (vm, ctx, b0, &n_bufs, peek_data); session_tx_fill_buffer (vm, ctx, b1, &n_bufs, peek_data); - ctx->transport_vft->push_header (ctx->tc, b0); - ctx->transport_vft->push_header (ctx->tc, b1); - + ctx->transport_pending_bufs[ctx->n_segs_per_evt - n_left] = b0; + ctx->transport_pending_bufs[ctx->n_segs_per_evt - n_left + 1] = b1; n_left -= 2; vec_add1 (wrk->pending_tx_buffers, bi0); @@ -1366,16 +1367,17 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk, b0 = vlib_get_buffer (vm, bi0); session_tx_fill_buffer (vm, ctx, b0, &n_bufs, peek_data); - /* Ask transport to push header after current_length and - * total_length_not_including_first_buffer are updated */ - ctx->transport_vft->push_header (ctx->tc, b0); - + ctx->transport_pending_bufs[ctx->n_segs_per_evt - n_left] = b0; n_left -= 1; vec_add1 (wrk->pending_tx_buffers, bi0); vec_add1 (wrk->pending_tx_nexts, next_index); } + /* Ask transport to push headers */ + ctx->transport_vft->push_header (ctx->tc, ctx->transport_pending_bufs, + ctx->n_segs_per_evt); + if (PREDICT_FALSE ((n_trace = vlib_get_trace_count (vm, node)) > 0)) session_tx_trace_frame (vm, node, next_index, wrk->pending_tx_buffers, ctx->n_segs_per_evt, ctx->s, n_trace); |