Skip to contentSkip to conversation

: Interface CCID3 code with newer TFRC LI database

PATCH In review Gerrit Renker 2 participants 2 messages Jun 17, 2007 – Jun 28, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 9/9 : Interface CCID3 code with newer TFRC LI database

[CCID]: Interface CCID3 code with newer TFRC LI database

This hooks up the TFRC Loss Interval database with CCID 3 packet reception.

---
 net/dccp/ccids/ccid3.c |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
net/dccp/ccids/ccid3.c +17 -9
@@ -795,12 +795,11 @@ static void ccid3_hc_rx_packet_recv(stru
 	/*
 	 *	Handle pending losses and otherwise check for new loss
 	 */
-	if (tfrc_rx_loss_pending(&hcrx->ccid3hcrx_hist)) {
-		/*
-		 * Loss Handling
-		 *
-		 * XXX: part of subsequent patch
-		 */
+	if (tfrc_rx_loss_pending(&hcrx->ccid3hcrx_hist) &&
+	    tfrc_rx_handle_loss(&hcrx->ccid3hcrx_hist,
+				&hcrx->ccid3hcrx_li_hist,
+				skb, ndp, ccid3_first_li, sk) ) {
+		do_feedback = 1;
 		goto done_receiving;
 	}
 
@@ -813,14 +812,23 @@ static void ccid3_hc_rx_packet_recv(stru
 	if (unlikely(!is_data_packet))
 		goto update_records;
 
-	if (list_empty(&hcrx->ccid3hcrx_li_hist)) {  /* no loss so far: p = 0 */
-
+	if (! tfrc_lh_is_initialised(&hcrx->ccid3hcrx_li_hist)) {
+		/*
+		 * Empty loss history: no loss so far, hence p stays 0.
+		 * Sample RTT values, since an RTT estimate is required for the
+		 * computation of p when the first loss occurs; RFC 3448, 6.3.1.
+		 */
 		sample = tfrc_rx_sample_rtt(&hcrx->ccid3hcrx_hist, skb);
 		if (sample != 0)
 			hcrx->ccid3hcrx_rtt  				tfrc_ewma(hcrx->ccid3hcrx_rtt, sample, 9);
 
-	}
+	} else if (tfrc_lh_update_i_mean(&hcrx->ccid3hcrx_li_hist, skb))
+		/*
+		 * Step (3) of [RFC 3448, 6.1]: Recompute I_mean and, if I_mean
+		 * has decreased (resp. p has increased), send feedback now.
+		 */
+		do_feedback = 1;
 
 	/* check if the periodic once-per-RTT feedback is due; RFC 4342, 10.3 */
 	if (SUB16(dccp_hdr(skb)->dccph_ccval, hcrx->ccid3hcrx_last_counter) > 3)