Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41898
b: refs/heads/master
c: 5d0dbc4
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Dec 3, 2006
1 parent def9790 commit 731a414
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 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: 17893bc1a632e195574dc0dd9751243f0d5993d2
refs/heads/master: 5d0dbc4a9b2d325458dcbf9a8329bd1d2cc7bd7e
29 changes: 14 additions & 15 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,10 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
}
/*
* Schedule no feedback timer to expire in
* max(4 * R, 2 * s / X)
* max(4 * t_RTO, 2 * s/X) = max(4 * t_RTO, 2 * t_ipi)
* XXX This is non-standard, RFC 3448, 4.3 uses 4 * R
*/
next_tmout = max_t(u32, hctx->ccid3hctx_t_rto,
2 * usecs_div(hctx->ccid3hctx_s,
hctx->ccid3hctx_x));
next_tmout = max(hctx->ccid3hctx_t_rto, 2*hctx->ccid3hctx_t_ipi);
break;
case TFRC_SSTATE_NO_SENT:
DCCP_BUG("Illegal %s state NO_SENT, sk=%p", dccp_role(sk), sk);
Expand Down Expand Up @@ -460,10 +459,6 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
"r_sample=%us\n", dccp_role(sk), sk,
hctx->ccid3hctx_rtt, r_sample);

/* Update timeout interval */
hctx->ccid3hctx_t_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt,
USEC_PER_SEC);

/* Update receive rate */
hctx->ccid3hctx_x_recv = x_recv;/* X_recv in bytes per sec */

Expand Down Expand Up @@ -491,25 +486,30 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
&hctx->ccid3hctx_hist, packet);
/*
* As we have calculated new ipi, delta, t_nom it is possible that
* we now can send a packet, so wake up dccp_wait_for_ccids.
* we now can send a packet, so wake up dccp_wait_for_ccid
*/
sk->sk_write_space(sk);


/* Update timeout interval. We use the alternative variant of
* [RFC 3448, 3.1] which sets the upper bound of t_rto to one
* second, as it is suggested for TCP (see RFC 2988, 2.4). */
hctx->ccid3hctx_t_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt,
USEC_PER_SEC );
/*
* Schedule no feedback timer to expire in
* max(4 * R, 2 * s / X)
* max(4 * t_RTO, 2 * s/X) = max(4 * t_RTO, 2 * t_ipi)
* XXX This is non-standard, RFC 3448, 4.3 uses 4 * R
*/
next_tmout = max(hctx->ccid3hctx_t_rto,
2 * usecs_div(hctx->ccid3hctx_s,
hctx->ccid3hctx_x));
next_tmout = max(hctx->ccid3hctx_t_rto, 2*hctx->ccid3hctx_t_ipi);

ccid3_pr_debug("%s, sk=%p, Scheduled no feedback timer to "
"expire in %lu jiffies (%luus)\n",
dccp_role(sk), sk,
usecs_to_jiffies(next_tmout), next_tmout);

sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
jiffies + max_t(u32, 1, usecs_to_jiffies(next_tmout)));
jiffies + usecs_to_jiffies(next_tmout));

/* set idle flag */
hctx->ccid3hctx_idle = 1;
Expand Down Expand Up @@ -607,7 +607,6 @@ static int ccid3_hc_tx_init(struct ccid *ccid, struct sock *sk)

/* Set transmission rate to 1 packet per second */
hctx->ccid3hctx_x = hctx->ccid3hctx_s;
hctx->ccid3hctx_t_rto = USEC_PER_SEC;
hctx->ccid3hctx_state = TFRC_SSTATE_NO_SENT;
INIT_LIST_HEAD(&hctx->ccid3hctx_hist);

Expand Down

0 comments on commit 731a414

Please sign in to comment.