aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-11-20 14:33:17 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:41 -0500
commit6c08b2cf4843788e66a5e69b5512538e686ae3e3 (patch)
treeec4ddefc1600d0fed860670e4d1457632d37b1f1 /net/dccp
parentebb53d75657f86587ac8cf3e38ab0c860a8e3d4f (diff)
[CCID3]: Revert use of MSS instead of s
This updates the CCID3 code with regard to two instances of using `MSS' in place of `s': 1. The RFC3390-based initial rate: both rfc3448bis as well as the Faster Restart draft now consistently use `s' instead of MSS. 2. Now agrees with section 4.2 of rfc3448bis: "If the sender is ready to send data when it does not yet have a round trip sample, the value of X is set to s bytes per second, for segment size s [...]" Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/ccids/ccid3.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index f56aaecb56b3..5bf110b28abc 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -83,18 +83,21 @@ static void ccid3_hc_tx_set_state(struct sock *sk,
83} 83}
84 84
85/* 85/*
86 * Compute the initial sending rate X_init according to RFC 3390: 86 * Compute the initial sending rate X_init in the manner of RFC 3390:
87 * w_init = min(4 * MSS, max(2 * MSS, 4380 bytes)) 87 *
88 * X_init = w_init / RTT 88 * X_init = min(4 * s, max(2 * s, 4380 bytes)) / RTT
89 *
90 * Note that RFC 3390 uses MSS, RFC 4342 refers to RFC 3390, and rfc3448bis
91 * (rev-02) clarifies the use of RFC 3390 with regard to the above formula.
89 * For consistency with other parts of the code, X_init is scaled by 2^6. 92 * For consistency with other parts of the code, X_init is scaled by 2^6.
90 */ 93 */
91static inline u64 rfc3390_initial_rate(struct sock *sk) 94static inline u64 rfc3390_initial_rate(struct sock *sk)
92{ 95{
93 const struct dccp_sock *dp = dccp_sk(sk); 96 const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
94 const __u32 w_init = min(4 * dp->dccps_mss_cache, 97 const __u32 w_init = min_t(__u32, 4 * hctx->ccid3hctx_s,
95 max(2 * dp->dccps_mss_cache, 4380U)); 98 max_t(__u32, 2 * hctx->ccid3hctx_s, 4380));
96 99
97 return scaled_div(w_init << 6, ccid3_hc_tx_sk(sk)->ccid3hctx_rtt); 100 return scaled_div(w_init << 6, hctx->ccid3hctx_rtt);
98} 101}
99 102
100/* 103/*
@@ -336,8 +339,8 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
336 hctx->ccid3hctx_x = rfc3390_initial_rate(sk); 339 hctx->ccid3hctx_x = rfc3390_initial_rate(sk);
337 hctx->ccid3hctx_t_ld = now; 340 hctx->ccid3hctx_t_ld = now;
338 } else { 341 } else {
339 /* Sender does not have RTT sample: X = MSS/second */ 342 /* Sender does not have RTT sample: X_pps = 1 pkt/sec */
340 hctx->ccid3hctx_x = dp->dccps_mss_cache; 343 hctx->ccid3hctx_x = hctx->ccid3hctx_s;
341 hctx->ccid3hctx_x <<= 6; 344 hctx->ccid3hctx_x <<= 6;
342 } 345 }
343 ccid3_update_send_interval(hctx); 346 ccid3_update_send_interval(hctx);