Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66285
b: refs/heads/master
c: ac198ea
h: refs/heads/master
i:
  66283: 6dd2f6c
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Oct 10, 2007
1 parent 1333e88 commit b30fe81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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: 4d93df0abd50b9c9e2d4561439a1a1d21ec5e68f
refs/heads/master: ac198ea8d94a46830080372a539420cf4a8de4a3
30 changes: 16 additions & 14 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static inline void ccid3_update_send_interval(struct ccid3_hc_tx_sock *hctx)
* throughout the code. Only X_calc is unscaled (in bytes/second).
*
*/
static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now)
static void ccid3_hc_tx_update_x(struct sock *sk)

{
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
Expand All @@ -153,14 +153,20 @@ static void ccid3_hc_tx_update_x(struct sock *sk, struct timeval *now)
(((__u64)hctx->ccid3hctx_s) << 6) /
TFRC_T_MBI);

} else if (timeval_delta(now, &hctx->ccid3hctx_t_ld) -
(suseconds_t)hctx->ccid3hctx_rtt >= 0) {
} else {
struct timeval now;

hctx->ccid3hctx_x =
max(min(2 * hctx->ccid3hctx_x, min_rate),
scaled_div(((__u64)hctx->ccid3hctx_s) << 6,
hctx->ccid3hctx_rtt));
hctx->ccid3hctx_t_ld = *now;
dccp_timestamp(sk, &now);

if ((timeval_delta(&now, &hctx->ccid3hctx_t_ld) -
(suseconds_t)hctx->ccid3hctx_rtt) >= 0) {

hctx->ccid3hctx_x =
max(min(2 * hctx->ccid3hctx_x, min_rate),
scaled_div(((__u64)hctx->ccid3hctx_s) << 6,
hctx->ccid3hctx_rtt));
hctx->ccid3hctx_t_ld = now;
}
}

if (hctx->ccid3hctx_x != old_x) {
Expand Down Expand Up @@ -214,7 +220,6 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
{
struct sock *sk = (struct sock *)data;
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
struct timeval now;
unsigned long t_nfb = USEC_PER_SEC / 5;

bh_lock_sock(sk);
Expand Down Expand Up @@ -265,15 +270,12 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
max(hctx->ccid3hctx_x_recv / 2,
(((__u64)hctx->ccid3hctx_s) << 6) /
(2 * TFRC_T_MBI));

if (hctx->ccid3hctx_p == 0)
dccp_timestamp(sk, &now);
} else {
hctx->ccid3hctx_x_recv = hctx->ccid3hctx_x_calc;
hctx->ccid3hctx_x_recv <<= 4;
}
/* Now recalculate X [RFC 3448, 4.3, step (4)] */
ccid3_hc_tx_update_x(sk, &now);
ccid3_hc_tx_update_x(sk);
/*
* Schedule no feedback timer to expire in
* max(t_RTO, 2 * s/X) = max(t_RTO, 2 * t_ipi)
Expand Down Expand Up @@ -496,7 +498,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
tfrc_calc_x(hctx->ccid3hctx_s,
hctx->ccid3hctx_rtt,
hctx->ccid3hctx_p);
ccid3_hc_tx_update_x(sk, &now);
ccid3_hc_tx_update_x(sk);

ccid3_pr_debug("%s(%p), RTT=%uus (sample=%uus), s=%u, "
"p=%u, X_calc=%u, X_recv=%u, X=%u\n",
Expand Down

0 comments on commit b30fe81

Please sign in to comment.