aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dccp/ccids/ccid2.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 3b2548bd73f3..fa074d442065 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -353,23 +353,6 @@ static inline void ccid2_new_ack(struct sock *sk,
353 hctx->srtt, hctx->rttvar, 353 hctx->srtt, hctx->rttvar,
354 hctx->rto, HZ, r); 354 hctx->rto, HZ, r);
355 } 355 }
356
357 /* we got a new ack, so re-start RTO timer */
358 ccid2_hc_tx_kill_rto_timer(sk);
359 ccid2_start_rto_timer(sk);
360}
361
362static void ccid2_hc_tx_dec_pipe(struct sock *sk)
363{
364 struct ccid2_hc_tx_sock *hctx = ccid2_hc_tx_sk(sk);
365
366 if (hctx->pipe == 0)
367 DCCP_BUG("pipe == 0");
368 else
369 hctx->pipe--;
370
371 if (hctx->pipe == 0)
372 ccid2_hc_tx_kill_rto_timer(sk);
373} 356}
374 357
375static void ccid2_congestion_event(struct sock *sk, struct ccid2_seq *seqp) 358static void ccid2_congestion_event(struct sock *sk, struct ccid2_seq *seqp)
@@ -518,7 +501,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
518 seqp->ccid2s_acked = 1; 501 seqp->ccid2s_acked = 1;
519 ccid2_pr_debug("Got ack for %llu\n", 502 ccid2_pr_debug("Got ack for %llu\n",
520 (unsigned long long)seqp->ccid2s_seq); 503 (unsigned long long)seqp->ccid2s_seq);
521 ccid2_hc_tx_dec_pipe(sk); 504 hctx->pipe--;
522 } 505 }
523 if (seqp == hctx->seqt) { 506 if (seqp == hctx->seqt) {
524 done = 1; 507 done = 1;
@@ -574,7 +557,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
574 * one ack vector. 557 * one ack vector.
575 */ 558 */
576 ccid2_congestion_event(sk, seqp); 559 ccid2_congestion_event(sk, seqp);
577 ccid2_hc_tx_dec_pipe(sk); 560 hctx->pipe--;
578 } 561 }
579 if (seqp == hctx->seqt) 562 if (seqp == hctx->seqt)
580 break; 563 break;
@@ -592,6 +575,12 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
592 hctx->seqt = hctx->seqt->ccid2s_next; 575 hctx->seqt = hctx->seqt->ccid2s_next;
593 } 576 }
594 577
578 /* restart RTO timer if not all outstanding data has been acked */
579 if (hctx->pipe == 0)
580 sk_stop_timer(sk, &hctx->rtotimer);
581 else
582 sk_reset_timer(sk, &hctx->rtotimer,
583 jiffies + hctx->rto);
595done: 584done:
596 /* check if incoming Acks allow pending packets to be sent */ 585 /* check if incoming Acks allow pending packets to be sent */
597 if (sender_was_blocked && !ccid2_cwnd_network_limited(hctx)) 586 if (sender_was_blocked && !ccid2_cwnd_network_limited(hctx))