CCID 4: Reduce allowed sending rate by a factor that
PATCH 4/5 CCID 4: Reduce allowed sending rate by a factor that
Signed-off-by Tommi Saviranta <[email protected]>
---
net/dccp/ccids/ccid4.c +19 -0
@@ -44,6 +44,12 @@ static int ccid4_debug; #define ccid4_pr_debug(format, a...)#endif +/* +* The header size on data packets is estimated as 36 bytes [RFC XXXX, +* Section 5] (floyd-01) +*/ +#define CCID4HCTX_H 36 +DECLARE_TFRC_TX_CACHE (ccid4_tx_hist);/*
@@ -121,6 +127,17 @@ static u32 ccid4_hc_tx_idle_rtt(struct c }/** +* ccid4_hc_tx_x_header_penalty - Update allower sending rate X +* @hctx: half-connection to adjust +* This function adjusts sending rate according to [TFRC-SP, Section 5] +*/ +static inline void ccid4_hc_tx_x_header_penalty (struct ccid4_hc_tx_sock *hctx) +{ + hctx->ccid4hctx_x *= hctx->ccid4hctx_s; +do_div (hctx->ccid4hctx_x, (hctx->ccid4hctx_s +CCID4HCTX_H )); +} + +/** * ccid4_hc_tx_update_x - Update allowed sending rate X * @stamp: most recent time if available - can be left NULL. * This function tracks draft rfc3448bis, check there for latest details.
@@ -156,6 +173,7 @@ static void ccid4_hc_tx_update_x(struct hctx->ccid4hctx_x =max (hctx->ccid4hctx_x, (((__u64 )hctx->ccid4hctx_s) <<6 ) /TFRC_T_MBI ); +ccid4_hc_tx_x_header_penalty (hctx); }else if (ktime_us_delta (now, hctx->ccid4hctx_t_ld) - (s64 )hctx->ccid4hctx_rtt >=0 ) {
@@ -164,6 +182,7 @@ static void ccid4_hc_tx_update_x(structmax (min (2 * hctx->ccid4hctx_x, min_rate),scaled_div (((__u64 )hctx->ccid4hctx_s) <<6 , hctx->ccid4hctx_rtt)); +ccid4_hc_tx_x_header_penalty (hctx); hctx->ccid4hctx_t_ld = now; }
ツ Leandro Sales
Acked-by Leandro Sales on v1 4/5Re: [PATCH 4/5] CCID 4: Reduce allowed sending rate by a factor that accounts for packet header size
2007/9/20, Tommi Saviranta <[email protected]>:
Quoted 53 lines
Signed-off-by Tommi Saviranta <[email protected]>---
diff -Nrupa/net/dccp/ccids/ccid4.cb/net/dccp/ccids/ccid4.cnet/dccp/ccids/ccid4.c 2007-09-20 14:02:59.000000000 +0300 renamed from net/dccp/ccids/ccid4.c 2007-09-20 13:32:42.000000000 +0300 +19
-1@@ -44,6 +44,12 @@ static int ccid4_debug; #define ccid4_pr_debug(format, a...) #endif +/* + * The header size on data packets is estimated as 36 bytes [RFC XXXX, + * Section 5] (floyd-01) + */ +#define CCID4HCTX_H 36 + DECLARE_TFRC_TX_CACHE(ccid4_tx_hist); /*@@ -121,6 +127,17 @@ static u32 ccid4_hc_tx_idle_rtt(struct c } /** + * ccid4_hc_tx_x_header_penalty - Update allower sending rate X + * @hctx: half-connection to adjust + * This function adjusts sending rate according to [TFRC-SP, Section 5] + */ +static inline void ccid4_hc_tx_x_header_penalty(struct ccid4_hc_tx_sock *hctx) +{ + hctx->ccid4hctx_x *= hctx->ccid4hctx_s; + do_div(hctx->ccid4hctx_x, (hctx->ccid4hctx_s + CCID4HCTX_H)); +} + +/** * ccid4_hc_tx_update_x - Update allowed sending rate X * @stamp: most recent time if available - can be left NULL. * This function tracks draft rfc3448bis, check there for latest details.@@ -156,6 +173,7 @@ static void ccid4_hc_tx_update_x(struct hctx->ccid4hctx_x = max(hctx->ccid4hctx_x, (((__u64)hctx->ccid4hctx_s) << 6) / TFRC_T_MBI); + ccid4_hc_tx_x_header_penalty(hctx); } else if (ktime_us_delta(now, hctx->ccid4hctx_t_ld) - (s64)hctx->ccid4hctx_rtt >= 0) {@@ -164,6 +182,7 @@ static void ccid4_hc_tx_update_x(struct max(min(2 * hctx->ccid4hctx_x, min_rate), scaled_div(((__u64)hctx->ccid4hctx_s) << 6, hctx->ccid4hctx_rtt)); + ccid4_hc_tx_x_header_penalty(hctx); hctx->ccid4hctx_t_ld = now; } -
Quoted 4 lines
To unsubscribe from this list: send the line "unsubscribe dccp" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Acked-by Leandro Sales <[email protected]>
Re: [PATCH 4/5] CCID 4: Reduce allowed sending rate by a factor that accounts for packet header size
In reply to Tommi SavirantaQuoted 3 lines
+ * The header size on data packets is estimated as 36 bytes [RFC XXXX,
+ * Section 5] (floyd-01)
+ */
Reference the Internet Draft here rather than RFC which does not exist.
Otherwise looks fine.