diff options
author | Florin Coras <fcoras@cisco.com> | 2018-11-05 15:57:21 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-11-07 13:26:12 +0000 |
commit | 7ac053b27fee8f9e437cf7b61357943356381061 (patch) | |
tree | f0a844206701bef79107626312e5e31e383423c1 /src/vnet/tcp/tcp.h | |
parent | f5942d5612d99c5ea1189cb9f8de6b6097b0456e (diff) |
tcp: consume incoming buffers instead of reusing
Instead of reusing buffers for acking, consume all buffers and program
output for (dup)ack generation. This implicitly fixes the drop counters
that were artificially inflated by both data and feedback traffic.
Moreover, the patch also significantly reduces the ack traffic as we now
only generate an ack per frame, unless duplicate acks need to be sent.
Because of the reduced feedback traffic, a sender's rx path and a
receiver's tx path are now significantly less loaded. In particular, a
sender can overwhelm a 40Gbps NIC and generate tx drop bursts for low
rtts. Consequently, tx pacing is now enforced by default.
Change-Id: I619c29a8945bf26c093f8f9e197e3c6d5d43868e
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.h')
-rw-r--r-- | src/vnet/tcp/tcp.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index 480b924c882..5a3a96570d2 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -300,7 +300,7 @@ typedef struct _tcp_connection sack_scoreboard_t sack_sb; /**< SACK "scoreboard" that tracks holes */ u16 rcv_dupacks; /**< Number of DUPACKs received */ - u8 snt_dupacks; /**< Number of DUPACKs sent in a burst */ + u8 pending_dupacks; /**< Number of DUPACKs to be sent */ /* Congestion control */ u32 cwnd; /**< Congestion window */ @@ -395,6 +395,7 @@ typedef struct tcp_worker_ctx_ u32 *postponed_fast_rxt; /**< vector of connections that will do fast rxt */ u32 *pending_deq_acked; + u32 *pending_acks; vlib_main_t *vm; /**< pointer to vm */ CLIB_CACHE_LINE_ALIGN_MARK (cacheline1); @@ -564,6 +565,7 @@ void tcp_send_reset_w_pkt (tcp_connection_t * tc, vlib_buffer_t * pkt, u8 is_ip4); void tcp_send_reset (tcp_connection_t * tc); void tcp_send_syn (tcp_connection_t * tc); +void tcp_send_synack (tcp_connection_t * tc); void tcp_send_fin (tcp_connection_t * tc); void tcp_init_mss (tcp_connection_t * tc); void tcp_update_burst_snd_vars (tcp_connection_t * tc); @@ -574,6 +576,10 @@ void tcp_program_fastretransmit (tcp_worker_ctx_t * wrk, tcp_connection_t * tc); void tcp_do_fastretransmits (tcp_worker_ctx_t * wrk); +void tcp_program_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc); +void tcp_program_dupack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc); +void tcp_send_acks (tcp_worker_ctx_t * wrk); + always_inline u32 tcp_end_seq (tcp_header_t * th, u32 len) { @@ -751,14 +757,6 @@ tcp_cc_rcv_ack (tcp_connection_t * tc) } always_inline void -tcp_connection_force_ack (tcp_connection_t * tc, vlib_buffer_t * b) -{ - /* Reset flags, make sure ack is sent */ - tc->flags = TCP_CONN_SNDACK; - vnet_buffer (b)->tcp.flags &= ~TCP_BUF_FLAG_DUPACK; -} - -always_inline void tcp_timer_set (tcp_connection_t * tc, u8 timer_id, u32 interval) { ASSERT (tc->c_thread_index == vlib_get_thread_index ()); |