aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid3.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids/ccid3.c')
-rw-r--r--net/dccp/ccids/ccid3.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index f2f9514dbad2..aca072b3edae 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -657,41 +657,26 @@ failed:
657static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) 657static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
658{ 658{
659 struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); 659 struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
660 enum ccid3_fback_type do_feedback = CCID3_FBACK_NONE;
661 const u64 ndp = dccp_sk(sk)->dccps_options_received.dccpor_ndp; 660 const u64 ndp = dccp_sk(sk)->dccps_options_received.dccpor_ndp;
662 const bool is_data_packet = dccp_data_packet(skb); 661 const bool is_data_packet = dccp_data_packet(skb);
663 662
664 /* 663 /*
665 * Perform loss detection and handle pending losses 664 * Perform loss detection and handle pending losses
666 */ 665 */
667 if (tfrc_rx_handle_loss(&hcrx->hist, &hcrx->li_hist, 666 if (tfrc_rx_congestion_event(&hcrx->hist, &hcrx->li_hist,
668 skb, ndp, ccid3_first_li, sk)) { 667 skb, ndp, ccid3_first_li, sk))
669 do_feedback = CCID3_FBACK_PARAM_CHANGE; 668 ccid3_hc_rx_send_feedback(sk, skb, CCID3_FBACK_PARAM_CHANGE);
670 goto done_receiving; 669 /*
671 } 670 * Feedback for first non-empty data packet (RFC 3448, 6.3)
672 671 */
673 if (unlikely(hcrx->feedback == CCID3_FBACK_NONE)) { 672 else if (unlikely(hcrx->feedback == CCID3_FBACK_NONE && is_data_packet))
674 if (is_data_packet) 673 ccid3_hc_rx_send_feedback(sk, skb, CCID3_FBACK_INITIAL);
675 do_feedback = CCID3_FBACK_INITIAL;
676 goto update_records;
677 }
678
679 if (tfrc_rx_hist_loss_pending(&hcrx->hist))
680 return; /* done receiving */
681
682 /* 674 /*
683 * Check if the periodic once-per-RTT feedback is due; RFC 4342, 10.3 675 * Check if the periodic once-per-RTT feedback is due; RFC 4342, 10.3
684 */ 676 */
685 if (is_data_packet && 677 else if (!tfrc_rx_hist_loss_pending(&hcrx->hist) && is_data_packet &&
686 SUB16(dccp_hdr(skb)->dccph_ccval, hcrx->last_counter) > 3) 678 SUB16(dccp_hdr(skb)->dccph_ccval, hcrx->last_counter) > 3)
687 do_feedback = CCID3_FBACK_PERIODIC; 679 ccid3_hc_rx_send_feedback(sk, skb, CCID3_FBACK_PERIODIC);
688
689update_records:
690 tfrc_rx_hist_add_packet(&hcrx->hist, skb, ndp);
691
692done_receiving:
693 if (do_feedback)
694 ccid3_hc_rx_send_feedback(sk, skb, do_feedback);
695} 680}
696 681
697static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk) 682static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk)