All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 19/25] Share ccid3_hc_tx_idle_rtt function via tfrc_ccids
@ 2007-11-01  0:31 Leandro
  2007-11-01 12:39 ` [PATCH 19/25] Share ccid3_hc_tx_idle_rtt function via Tommi Saviranta
  0 siblings, 1 reply; 2+ messages in thread
From: Leandro @ 2007-11-01  0:31 UTC (permalink / raw)
  To: dccp

[CCID-3/4] Share ccid3_hc_tx_idle_rtt function via tfrc_ccids

Signed-off-by: Leandro Melo de Sales <leandro@embedded.ufcg.edu.br>

Index: leandro.new/net/dccp/ccids/ccid3.c
=================================--- leandro.new.orig/net/dccp/ccids/ccid3.c
+++ leandro.new/net/dccp/ccids/ccid3.c
@@ -121,13 +121,6 @@ static inline void ccid3_update_send_int
 
 }
 
-static u32 ccid3_hc_tx_idle_rtt(struct ccid3_hc_tx_sock *hctx, ktime_t now)
-{
-	u32 delta = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count);
-
-	return delta/hctx->ccid3hctx_rtt;
-}
-
 /**
  * ccid3_hc_tx_update_x  -  Update allowed sending rate X
  * @stamp: most recent time if available - can be left NULL.
@@ -151,7 +144,7 @@ static void ccid3_hc_tx_update_x(struct 
 	 * a sender is idle if it has not sent anything over a 2-RTT-period.
 	 * For consistency with X and X_recv, min_rate is also scaled by 2^6.
 	 */
-	if (ccid3_hc_tx_idle_rtt(hctx, now) >= 2) {
+	if (tfrc_hc_tx_idle_rtt(hctx, now) >= 2) {
 		min_rate = rfc3390_initial_rate(sk);
 		min_rate = max(min_rate, 2 * hctx->ccid3hctx_x_recv);
 	}
Index: leandro.new/net/dccp/ccids/ccid4.c
=================================--- leandro.new.orig/net/dccp/ccids/ccid4.c
+++ leandro.new/net/dccp/ccids/ccid4.c
@@ -133,13 +133,6 @@ static inline void ccid4_update_send_int
 
 }
 
-static u32 ccid4_hc_tx_idle_rtt(struct ccid4_hc_tx_sock *hctx, ktime_t now)
-{
-	u32 delta = ktime_us_delta(now, hctx->ccid4hctx_t_last_win_count);
-
-	return delta/hctx->ccid4hctx_rtt;
-}
-
 /**
  * ccid4_hc_tx_x_header_penalty  -  Update allower sending rate X
  * @hctx: half-connection to adjust
@@ -174,7 +167,7 @@ static void ccid4_hc_tx_update_x(struct 
 	 * a sender is idle if it has not sent anything over a 2-RTT-period.
 	 * For consistency with X and X_recv, min_rate is also scaled by 2^6.
 	 */
-	if (ccid4_hc_tx_idle_rtt(hctx, now) >= 2) {
+	if (tfrc_hc_tx_idle_rtt(hctx, now) >= 2) {
 		min_rate = rfc3390_initial_rate(sk);
 		min_rate = max(min_rate, 2 * hctx->ccid4hctx_x_recv);
 	}
Index: leandro.new/net/dccp/ccids/lib/tfrc_ccids.c
=================================--- leandro.new.orig/net/dccp/ccids/lib/tfrc_ccids.c
+++ leandro.new/net/dccp/ccids/lib/tfrc_ccids.c
@@ -32,3 +32,13 @@ inline u64 rfc3390_initial_rate(struct s
 }
 
 EXPORT_SYMBOL_GPL(rfc3390_initial_rate);
+
+u32 tfrc_hc_tx_idle_rtt(struct tfrc_hc_tx_sock *hctx, ktime_t now)
+{
+	u32 delta = ktime_us_delta(now, hctx->tfrchctx_t_last_win_count);
+
+	return delta/hctx->tfrchctx_rtt;
+}
+
+EXPORT_SYMBOL_GPL(tfrc_hc_tx_idle_rtt);
+
Index: leandro.new/net/dccp/ccids/lib/tfrc_ccids.h
=================================--- leandro.new.orig/net/dccp/ccids/lib/tfrc_ccids.h
+++ leandro.new/net/dccp/ccids/lib/tfrc_ccids.h
@@ -173,3 +173,5 @@ static const char *tfrc_tx_state_name(en
 #endif
 
 extern u64 rfc3390_initial_rate(struct sock *sk);
+
+extern u32 tfrc_hc_tx_idle_rtt(struct tfrc_hc_tx_sock *hctx, ktime_t now);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 19/25] Share ccid3_hc_tx_idle_rtt function via
  2007-11-01  0:31 [PATCH 19/25] Share ccid3_hc_tx_idle_rtt function via tfrc_ccids Leandro
@ 2007-11-01 12:39 ` Tommi Saviranta
  0 siblings, 0 replies; 2+ messages in thread
From: Tommi Saviranta @ 2007-11-01 12:39 UTC (permalink / raw)
  To: dccp

On Wed, Oct 31, 2007 at 21:31:57 -0300, Leandro wrote:
> [CCID-3/4] Share ccid3_hc_tx_idle_rtt function via tfrc_ccids
> 
> Signed-off-by: Leandro Melo de Sales <leandro@embedded.ufcg.edu.br>

Acked-by: Tommi Saviranta <wnd@iki.fi>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-01 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-01  0:31 [PATCH 19/25] Share ccid3_hc_tx_idle_rtt function via tfrc_ccids Leandro
2007-11-01 12:39 ` [PATCH 19/25] Share ccid3_hc_tx_idle_rtt function via Tommi Saviranta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.