mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
tcp: Refactor pingpong code
Instead of using pingpong as a single bit information, we refactor the code to treat it as a counter. When interactive session is detected, we set pingpong count to TCP_PINGPONG_THRESH. And when pingpong count is >= TCP_PINGPONG_THRESH, we consider the session in pingpong mode. This patch is a pure refactor and sets foundation for the next patch. This patch itself does not change any pingpong logic. Signed-off-by: Wei Wang <[email protected]> Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
fb1b699991
commit
31954cd8bb
9 changed files with 35 additions and 18 deletions
|
|
@ -480,7 +480,7 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk,
|
|||
sk_wake_async(sk, SOCK_WAKE_IO, POLL_OUT);
|
||||
}
|
||||
|
||||
if (sk->sk_write_pending || icsk->icsk_ack.pingpong ||
|
||||
if (sk->sk_write_pending || inet_csk_in_pingpong_mode(sk) ||
|
||||
icsk->icsk_accept_queue.rskq_defer_accept) {
|
||||
/* Save one ACK. Data will be ready after
|
||||
* several ticks, if write_pending is set.
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static void dccp_delack_timer(struct timer_list *t)
|
|||
icsk->icsk_ack.pending &= ~ICSK_ACK_TIMER;
|
||||
|
||||
if (inet_csk_ack_scheduled(sk)) {
|
||||
if (!icsk->icsk_ack.pingpong) {
|
||||
if (!inet_csk_in_pingpong_mode(sk)) {
|
||||
/* Delayed ACK missed: inflate ATO. */
|
||||
icsk->icsk_ack.ato = min(icsk->icsk_ack.ato << 1,
|
||||
icsk->icsk_rto);
|
||||
|
|
@ -207,7 +207,7 @@ static void dccp_delack_timer(struct timer_list *t)
|
|||
/* Delayed ACK missed: leave pingpong mode and
|
||||
* deflate ATO.
|
||||
*/
|
||||
icsk->icsk_ack.pingpong = 0;
|
||||
inet_csk_exit_pingpong_mode(sk);
|
||||
icsk->icsk_ack.ato = TCP_ATO_MIN;
|
||||
}
|
||||
dccp_send_ack(sk);
|
||||
|
|
|
|||
Loading…
Reference in a new issue