aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid2.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-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 28499e030f33..f7f5069b1e84 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -413,23 +413,6 @@ static inline void ccid2_new_ack(struct sock *sk,
413 hc->tx_srtt, hc->tx_rttvar, 413 hc->tx_srtt, hc->tx_rttvar,
414 hc->tx_rto, HZ, r); 414 hc->tx_rto, HZ, r);
415 } 415 }
416
417 /* we got a new ack, so re-start RTO timer */
418 ccid2_hc_tx_kill_rto_timer(sk);
419 ccid2_start_rto_timer(sk);
420}
421
422static void ccid2_hc_tx_dec_pipe(struct sock *sk)
423{
424 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
425
426 if (hc->tx_pipe == 0)
427 DCCP_BUG("pipe == 0");
428 else
429 hc->tx_pipe--;
430
431 if (hc->tx_pipe == 0)
432 ccid2_hc_tx_kill_rto_timer(sk);
433} 416}
434 417
435static void ccid2_congestion_event(struct sock *sk, struct ccid2_seq *seqp) 418static void ccid2_congestion_event(struct sock *sk, struct ccid2_seq *seqp)
@@ -572,7 +555,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
572 seqp->ccid2s_acked = 1; 555 seqp->ccid2s_acked = 1;
573 ccid2_pr_debug("Got ack for %llu\n", 556 ccid2_pr_debug("Got ack for %llu\n",
574 (unsigned long long)seqp->ccid2s_seq); 557 (unsigned long long)seqp->ccid2s_seq);
575 ccid2_hc_tx_dec_pipe(sk); 558 hc->tx_pipe--;
576 } 559 }
577 if (seqp == hc->tx_seqt) { 560 if (seqp == hc->tx_seqt) {
578 done = 1; 561 done = 1;
@@ -629,7 +612,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
629 * one ack vector. 612 * one ack vector.
630 */ 613 */
631 ccid2_congestion_event(sk, seqp); 614 ccid2_congestion_event(sk, seqp);
632 ccid2_hc_tx_dec_pipe(sk); 615 hc->tx_pipe--;
633 } 616 }
634 if (seqp == hc->tx_seqt) 617 if (seqp == hc->tx_seqt)
635 break; 618 break;
@@ -646,6 +629,12 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
646 629
647 hc->tx_seqt = hc->tx_seqt->ccid2s_next; 630 hc->tx_seqt = hc->tx_seqt->ccid2s_next;
648 } 631 }
632
633 /* restart RTO timer if not all outstanding data has been acked */
634 if (hc->tx_pipe == 0)
635 sk_stop_timer(sk, &hc->tx_rtotimer);
636 else
637 sk_reset_timer(sk, &hc->tx_rtotimer, jiffies + hc->tx_rto);
649} 638}
650 639
651static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) 640static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)