diff options
author | Florin Coras <fcoras@cisco.com> | 2021-04-08 19:10:07 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2022-01-12 08:42:32 -0800 |
commit | f66cc80b94de0b9e910bb66aa69d98ba69f53b73 (patch) | |
tree | a77d5c4ac5f4e18abf11dd38ee8835bd132afe42 /src/vnet/session/session_node.c | |
parent | b2bf388b81c62ce4dfe3a98f099a0440c6a987aa (diff) |
session: pass tx buffers in bulk to transports
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1025cccd784f80b557847f69c3ea1ada5c9de60d
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); |