Commit 466466dc authored by Yuchung Cheng's avatar Yuchung Cheng Committed by David S. Miller

tcp: mandate a one-time immediate ACK

Add a new flag to indicate a one-time immediate ACK. This flag is
occasionaly set under specific TCP protocol states in addition to
the more common quickack mechanism for interactive application.

In several cases in the TCP code we want to force an immediate ACK
but do not want to call tcp_enter_quickack_mode() because we do
not want to forget the icsk_ack.pingpong or icsk_ack.ato state.
Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarWei Wang <weiwan@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a8a894e
...@@ -167,7 +167,8 @@ enum inet_csk_ack_state_t { ...@@ -167,7 +167,8 @@ enum inet_csk_ack_state_t {
ICSK_ACK_SCHED = 1, ICSK_ACK_SCHED = 1,
ICSK_ACK_TIMER = 2, ICSK_ACK_TIMER = 2,
ICSK_ACK_PUSHED = 4, ICSK_ACK_PUSHED = 4,
ICSK_ACK_PUSHED2 = 8 ICSK_ACK_PUSHED2 = 8,
ICSK_ACK_NOW = 16 /* Send the next ACK immediately (once) */
}; };
void inet_csk_init_xmit_timers(struct sock *sk, void inet_csk_init_xmit_timers(struct sock *sk,
......
...@@ -5179,7 +5179,9 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible) ...@@ -5179,7 +5179,9 @@ static void __tcp_ack_snd_check(struct sock *sk, int ofo_possible)
(tp->rcv_nxt - tp->copied_seq < sk->sk_rcvlowat || (tp->rcv_nxt - tp->copied_seq < sk->sk_rcvlowat ||
__tcp_select_window(sk) >= tp->rcv_wnd)) || __tcp_select_window(sk) >= tp->rcv_wnd)) ||
/* We ACK each frame or... */ /* We ACK each frame or... */
tcp_in_quickack_mode(sk)) { tcp_in_quickack_mode(sk) ||
/* Protocol state mandates a one-time immediate ACK */
inet_csk(sk)->icsk_ack.pending & ICSK_ACK_NOW) {
send_now: send_now:
tcp_send_ack(sk); tcp_send_ack(sk);
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment