aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid3.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 07:30:19 +0200
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 07:45:42 +0200
commit88e97a93342c0b9e835d510921e7b2df8547d1bd (patch)
tree0e8406050b02487b213b062f4d37528051f465e3 /net/dccp/ccids/ccid3.c
parentdccp ccid-3: Update the computation of X_recv (diff)
downloadlinux-dev-88e97a93342c0b9e835d510921e7b2df8547d1bd.tar.xz
linux-dev-88e97a93342c0b9e835d510921e7b2df8547d1bd.zip
dccp ccid-3: Update the RX history records in one place
This patch is a requirement for enabling ECN support later on. With that change in mind, the following preparations are done: * renamed handle_loss() into congestion_event() since it returns true when a congestion event happens (it will eventually also take care of ECN packets); * lets tfrc_rx_congestion_event() always update the RX history records, since this routine needs to be called for each non-duplicate packet anyway; * made all involved boolean-type functions to have return type `bool'; Updating the RX history records is now only necessary for the packets received up to sending the first feedback. The receiver code becomes again simpler. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
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:
static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
{
struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
- enum ccid3_fback_type do_feedback = CCID3_FBACK_NONE;
const u64 ndp = dccp_sk(sk)->dccps_options_received.dccpor_ndp;
const bool is_data_packet = dccp_data_packet(skb);
/*
* Perform loss detection and handle pending losses
*/
- if (tfrc_rx_handle_loss(&hcrx->hist, &hcrx->li_hist,
- skb, ndp, ccid3_first_li, sk)) {
- do_feedback = CCID3_FBACK_PARAM_CHANGE;
- goto done_receiving;
- }
-
- if (unlikely(hcrx->feedback == CCID3_FBACK_NONE)) {
- if (is_data_packet)
- do_feedback = CCID3_FBACK_INITIAL;
- goto update_records;
- }
-
- if (tfrc_rx_hist_loss_pending(&hcrx->hist))
- return; /* done receiving */
-
+ if (tfrc_rx_congestion_event(&hcrx->hist, &hcrx->li_hist,
+ skb, ndp, ccid3_first_li, sk))
+ ccid3_hc_rx_send_feedback(sk, skb, CCID3_FBACK_PARAM_CHANGE);
+ /*
+ * Feedback for first non-empty data packet (RFC 3448, 6.3)
+ */
+ else if (unlikely(hcrx->feedback == CCID3_FBACK_NONE && is_data_packet))
+ ccid3_hc_rx_send_feedback(sk, skb, CCID3_FBACK_INITIAL);
/*
* Check if the periodic once-per-RTT feedback is due; RFC 4342, 10.3
*/
- if (is_data_packet &&
- SUB16(dccp_hdr(skb)->dccph_ccval, hcrx->last_counter) > 3)
- do_feedback = CCID3_FBACK_PERIODIC;
-
-update_records:
- tfrc_rx_hist_add_packet(&hcrx->hist, skb, ndp);
-
-done_receiving:
- if (do_feedback)
- ccid3_hc_rx_send_feedback(sk, skb, do_feedback);
+ else if (!tfrc_rx_hist_loss_pending(&hcrx->hist) && is_data_packet &&
+ SUB16(dccp_hdr(skb)->dccph_ccval, hcrx->last_counter) > 3)
+ ccid3_hc_rx_send_feedback(sk, skb, CCID3_FBACK_PERIODIC);
}
static int ccid3_hc_rx_init(struct ccid *ccid, struct sock *sk)