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/tcp | |
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/tcp')
-rw-r--r-- | src/vnet/tcp/tcp.h | 4 | ||||
-rw-r--r-- | src/vnet/tcp/tcp_output.c | 37 |
2 files changed, 35 insertions, 6 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index 710561fb24a..c5dd3172302 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -313,8 +313,8 @@ u32 tcp_snd_space (tcp_connection_t * tc); int tcp_fastrecovery_prr_snd_space (tcp_connection_t * tc); void tcp_reschedule (tcp_connection_t * tc); fib_node_index_t tcp_lookup_rmt_in_fib (tcp_connection_t * tc); -u32 tcp_session_push_header (transport_connection_t * tconn, - vlib_buffer_t * b); +u32 tcp_session_push_header (transport_connection_t *tconn, vlib_buffer_t **b, + u32 n_bufs); int tcp_session_custom_tx (void *conn, transport_send_params_t * sp); void tcp_connection_timers_init (tcp_connection_t * tc); diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 55fa6d1b5d8..88cd91330b0 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -963,11 +963,9 @@ tcp_buffer_len (vlib_buffer_t * b) return data_len; } -u32 -tcp_session_push_header (transport_connection_t * tconn, vlib_buffer_t * b) +always_inline u32 +tcp_push_one_header (tcp_connection_t *tc, vlib_buffer_t *b) { - tcp_connection_t *tc = (tcp_connection_t *) tconn; - if (tc->cfg_flags & TCP_CFG_F_RATE_SAMPLE) tcp_bt_track_tx (tc, tcp_buffer_len (b)); @@ -975,6 +973,37 @@ tcp_session_push_header (transport_connection_t * tconn, vlib_buffer_t * b) /* update_snd_nxt */ 1); tcp_validate_txf_size (tc, tc->snd_nxt - tc->snd_una); + return 0; +} + +u32 +tcp_session_push_header (transport_connection_t *tconn, vlib_buffer_t **bs, + u32 n_bufs) +{ + tcp_connection_t *tc = (tcp_connection_t *) tconn; + + while (n_bufs >= 4) + { + vlib_prefetch_buffer_header (bs[2], STORE); + vlib_prefetch_buffer_header (bs[3], STORE); + + tcp_push_one_header (tc, bs[0]); + tcp_push_one_header (tc, bs[1]); + + n_bufs -= 2; + bs += 2; + } + while (n_bufs) + { + if (n_bufs > 1) + vlib_prefetch_buffer_header (bs[1], STORE); + + tcp_push_one_header (tc, bs[0]); + + n_bufs -= 1; + bs += 1; + } + /* If not tracking an ACK, start tracking */ if (tc->rtt_ts == 0 && !tcp_in_cong_recovery (tc)) { |