diff options
author | Wei Wang <weiwan@google.com> | 2019-01-25 13:53:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-27 16:29:43 -0500 |
commit | 31954cd8bb667030b1c0d3d77f28fe71f06999f9 (patch) | |
tree | f00b43f2669ac70db625d8babe06e89cd0a731e2 /net/dccp/timer.c | |
parent | fb1b69999130e9800c4e341a2b0f0991cdd8fcfc (diff) |
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 <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>
Diffstat (limited to 'net/dccp/timer.c')
-rw-r--r-- | net/dccp/timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 1501a20a94ca..74e138495d67 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c | |||
@@ -199,7 +199,7 @@ static void dccp_delack_timer(struct timer_list *t) | |||
199 | icsk->icsk_ack.pending &= ~ICSK_ACK_TIMER; | 199 | icsk->icsk_ack.pending &= ~ICSK_ACK_TIMER; |
200 | 200 | ||
201 | if (inet_csk_ack_scheduled(sk)) { | 201 | if (inet_csk_ack_scheduled(sk)) { |
202 | if (!icsk->icsk_ack.pingpong) { | 202 | if (!inet_csk_in_pingpong_mode(sk)) { |
203 | /* Delayed ACK missed: inflate ATO. */ | 203 | /* Delayed ACK missed: inflate ATO. */ |
204 | icsk->icsk_ack.ato = min(icsk->icsk_ack.ato << 1, | 204 | icsk->icsk_ack.ato = min(icsk->icsk_ack.ato << 1, |
205 | icsk->icsk_rto); | 205 | icsk->icsk_rto); |
@@ -207,7 +207,7 @@ static void dccp_delack_timer(struct timer_list *t) | |||
207 | /* Delayed ACK missed: leave pingpong mode and | 207 | /* Delayed ACK missed: leave pingpong mode and |
208 | * deflate ATO. | 208 | * deflate ATO. |
209 | */ | 209 | */ |
210 | icsk->icsk_ack.pingpong = 0; | 210 | inet_csk_exit_pingpong_mode(sk); |
211 | icsk->icsk_ack.ato = TCP_ATO_MIN; | 211 | icsk->icsk_ack.ato = TCP_ATO_MIN; |
212 | } | 212 | } |
213 | dccp_send_ack(sk); | 213 | dccp_send_ack(sk); |