Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44268
b: refs/heads/master
c: ff58629
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Dec 11, 2006
1 parent fe47220 commit f962fd4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 45393a66a2c30fc8ed86e6c79a63a3cd5231c69f
refs/heads/master: ff58629824c068e2a75402b5b83f12af0b36d394
27 changes: 16 additions & 11 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now)
const __u32 old_x = hctx->ccid3hctx_x;

if (hctx->ccid3hctx_p > 0) {
hctx->ccid3hctx_x_calc = tfrc_calc_x(hctx->ccid3hctx_s,
hctx->ccid3hctx_rtt,
hctx->ccid3hctx_p);
hctx->ccid3hctx_x = max_t(u32, min(hctx->ccid3hctx_x_calc,
hctx->ccid3hctx_x_recv * 2),
hctx->ccid3hctx_s / TFRC_T_MBI);
Expand All @@ -152,8 +149,7 @@ static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now)
usecs_div(hctx->ccid3hctx_s,
hctx->ccid3hctx_rtt) );
hctx->ccid3hctx_t_ld = *now;
} else
ccid3_pr_debug("Not changing X\n");
}

if (hctx->ccid3hctx_x != old_x)
ccid3_update_send_time(hctx);
Expand Down Expand Up @@ -223,24 +219,27 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
ccid3_pr_debug("%s, sk=%p, state=%s, not idle\n",
dccp_role(sk), sk,
ccid3_tx_state_name(hctx->ccid3hctx_state));
/* Halve sending rate */

/* If (p == 0 || X_calc > 2 * X_recv)
/*
* Modify the cached value of X_recv [RFC 3448, 4.4]
*
* If (p == 0 || X_calc > 2 * X_recv)
* X_recv = max(X_recv / 2, s / (2 * t_mbi));
* Else
* X_recv = X_calc / 4;
*/
BUG_ON(hctx->ccid3hctx_p && !hctx->ccid3hctx_x_calc);

if (hctx->ccid3hctx_p == 0 ||
hctx->ccid3hctx_x_calc > 2 * hctx->ccid3hctx_x_recv)
hctx->ccid3hctx_x_calc > 2 * hctx->ccid3hctx_x_recv) {
hctx->ccid3hctx_x_recv = max_t(u32, hctx->ccid3hctx_x_recv / 2,
hctx->ccid3hctx_s / (2 * TFRC_T_MBI));
else
if (hctx->ccid3hctx_p == 0)
dccp_timestamp(sk, &now);
} else
hctx->ccid3hctx_x_recv = hctx->ccid3hctx_x_calc / 4;

/* Update sending rate */
dccp_timestamp(sk, &now);
/* Now recalculate X [RFC 3448, 4.3, step (4)] */
ccid3_hc_tx_update_x(sk, &now);
}
/*
Expand Down Expand Up @@ -496,6 +495,12 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
hctx->ccid3hctx_rtt = (9 * hctx->ccid3hctx_rtt +
(u32)r_sample ) / 10;

/* Update sending rate (step 4 of [RFC 3448, 4.3]) */
if (hctx->ccid3hctx_p > 0)
hctx->ccid3hctx_x_calc =
tfrc_calc_x(hctx->ccid3hctx_s,
hctx->ccid3hctx_rtt,
hctx->ccid3hctx_p);
ccid3_hc_tx_update_x(sk, &now);

ccid3_pr_debug("%s(%p), RTT=%uus (sample=%ldus), s=%u, "
Expand Down

0 comments on commit f962fd4

Please sign in to comment.