tcp: change pingpong threshold to 3
In order to be more confident about an on-going interactive session, we increment pingpong count by 1 for every interactive transaction and we adjust TCP_PINGPONG_THRESH to 3. This means, we only consider a session in pingpong mode after we see 3 interactive transactions, and start to activate delayed acks in quick ack mode. And in order to not over-count the credits, we only increase pingpong count for the first packet sent in response for the previous received packet. This is mainly to prevent delaying the ack immediately after some handshake protocol but no real interactive traffic pattern afterwards. Signed-off-by: Wei Wang <weiwan@google.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
31954cd8bb
commit
4a41f453be
@@ -165,13 +165,16 @@ static void tcp_event_data_sent(struct tcp_sock *tp,
|
||||
if (tcp_packets_in_flight(tp) == 0)
|
||||
tcp_ca_event(sk, CA_EVENT_TX_START);
|
||||
|
||||
tp->lsndtime = now;
|
||||
|
||||
/* If it is a reply for ato after last received
|
||||
* packet, enter pingpong mode.
|
||||
/* If this is the first data packet sent in response to the
|
||||
* previous received data,
|
||||
* and it is a reply for ato after last received packet,
|
||||
* increase pingpong count.
|
||||
*/
|
||||
if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato)
|
||||
inet_csk_enter_pingpong_mode(sk);
|
||||
if (before(tp->lsndtime, icsk->icsk_ack.lrcvtime) &&
|
||||
(u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato)
|
||||
inet_csk_inc_pingpong_cnt(sk);
|
||||
|
||||
tp->lsndtime = now;
|
||||
}
|
||||
|
||||
/* Account for an ACK we sent. */
|
||||
|
Reference in New Issue
Block a user