CCID4 Testing - Some Results

2007-12-06 Thread Gerrit Renker
Below are some test results with the latest CCID4 subtree; two tests were 
performed:

 (a) iperf throughput tests
 (b) audio streaming using paraslash.

Both tests were performed using DCCPv6 only, so DCCPv4 supposedly works also.


1. iperf throughput testing 
---
To make iperf accept IPv6 addresses, the -V option had to be passed to
the program; below are the results of running between two hosts
connected via a 100Mbps (crossover) LAN:

  ++---++
  |  `s'   |  iperf throughput | packets per second |
  ++---++
  |   16b  |  12.6 kbps|  98.43 |
  |   32b  |  25.1 kbps|  98.05 |
  |   64b  |  50.3 kbps|  98.24 |
  |  128b  | 101.0 kbps|  98.63 |
  |  256b  | 201.0 kbps|  98.14 |
  |  512b  | 402.0 kbps|  98.14 |
  | 1024b  | 805.0 kbps|  98.27 |
  | 1420b  | 1.12 Mbps |  98.60 |
  ++---++

The tests were run over DCCPv6 only which is why the highest MPS is 1420 bytes
(Ethernet; with minimum set of features the MPS is 1440 for v4 and 1420 for v6).

It is noticeable that CCID4 uses a built-in speed-limiter: the 
packets-per-second
speed is the same in each case (the value is only approximate, the column simply
shows throughput / (8 * s), one would want to take IPv6/DCCP header sizes into
the calculation as well; not done here).

So in this regard CCID4 behaves like CCID3: when there is no loss, it quickly
climbs up to link speed, or rather maximum the speed limit.

How the results were obtained: when iperf is used without the `-b' option, it
   completely tries to overrun the socket with data,
   so for all packet sizes less than 1420 bytes,
   the -b switch was set to the default value (1 
Mbps);
   for 1420b it was set to `-5m' which corresponds 
to a
   constant bitrate of 5Mbps.


2. Audio streaming using paraslash
--
CCID4 was set as default CCID using the {rx,tx}_ccid sysctls and a longer (50 
min) MP3
file was streamed from server to client. It is a less boring setup than iperf, 
since when
there is a problem, it will become audible very quickly.

When doing the MP3-streaming, I had on DCCPv6
 * average packet size: 160 bytes
 * and the X_recv observed in the DCCP-Acks was
   frequently set to 6042 bytes/sec
 * which corresponds to ~ 48kbps, which is in agreement with the above table
 * and it also agrees perfectly with the encoding of the MP3 file -- its
   header says that it was encoded for 48 kbps joint-stereo and I think
   that means constant bitrate since VBR in MP3 is a bit more complex.

Gerrit   
-
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


Re: [PATCH 3/7] [TFRC]: Rename tfrc_tx_hist to tfrc_tx_hist_slab, for consistency

2007-12-06 Thread Gerrit Renker
| Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
-
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


Re: [PATCH 4/7] [TFRC]: Make the rx history slab be global

2007-12-06 Thread Gerrit Renker
| Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
-
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


Re: [PATCH 5/7] [TFRC]: Rename dccp_rx_ to tfrc_rx_

2007-12-06 Thread Gerrit Renker
| Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
-
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


Re: [RFC2][PATCH 7/7] [TFRC]: New rx history code

2007-12-06 Thread Arnaldo Carvalho de Melo
Em Thu, Dec 06, 2007 at 02:02:25PM +, Gerrit Renker escreveu:
 | The first six patches in this series are unmodified, so if you
 | are OK with them please send me your Signed-off-by.
 Patches [1/7], [2/7], and [6/7] already have a signed-off and there are
 no changes. Just acknowledged [3..5/7], will look at [7/7] now.

OK, please let me know if there are still any problems.

The removal of timestamp insertion in ccid3_hc_rx_insert_options will be
put in another cset.

- Arnaldo
-
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


[PATCH 6/7] [CCID3]: The receiver of a half-connection does not set window counter values

2007-12-06 Thread Arnaldo Carvalho de Melo
From: Gerrit Renker [EMAIL PROTECTED]

Only the sender sets window counters [RFC 4342, sections 5 and 8.1].

Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
Signed-off-by: Ian McDonald [EMAIL PROTECTED]
Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
---
 net/dccp/ccids/ccid3.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index c95dca8..5ff5aab 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -733,7 +733,6 @@ static int ccid3_hc_rx_insert_options(struct sock *sk, 
struct sk_buff *skb)
return 0;
 
hcrx = ccid3_hc_rx_sk(sk);
-   DCCP_SKB_CB(skb)-dccpd_ccval = hcrx-ccid3hcrx_ccval_last_counter;
 
if (dccp_packet_without_ack(skb))
return 0;
-- 
1.5.3.4

-
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


[PATCH 4/7] [TFRC]: Make the rx history slab be global

2007-12-06 Thread Arnaldo Carvalho de Melo
This is in preparation for merging the new rx history code written by Gerrit 
Renker.

Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
---
 net/dccp/ccids/ccid3.c  |   35 ++---
 net/dccp/ccids/lib/packet_history.c |   95 ++-
 net/dccp/ccids/lib/packet_history.h |   43 ++--
 3 files changed, 60 insertions(+), 113 deletions(-)

diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 5dea690..07920bb 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -49,8 +49,6 @@ static int ccid3_debug;
 #define ccid3_pr_debug(format, a...)
 #endif
 
-static struct dccp_rx_hist *ccid3_rx_hist;
-
 /*
  * Transmitter Half-Connection Routines
  */
@@ -807,9 +805,9 @@ static int ccid3_hc_rx_detect_loss(struct sock *sk,
}
 
 detect_out:
-   dccp_rx_hist_add_packet(ccid3_rx_hist, hcrx-ccid3hcrx_hist,
-  hcrx-ccid3hcrx_li_hist, packet,
-  hcrx-ccid3hcrx_seqno_nonloss);
+   dccp_rx_hist_add_packet(hcrx-ccid3hcrx_hist,
+   hcrx-ccid3hcrx_li_hist, packet,
+   hcrx-ccid3hcrx_seqno_nonloss);
return loss;
 }
 
@@ -852,8 +850,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct 
sk_buff *skb)
return;
}
 
-   packet = dccp_rx_hist_entry_new(ccid3_rx_hist, opt_recv-dccpor_ndp,
-   skb, GFP_ATOMIC);
+   packet = dccp_rx_hist_entry_new(opt_recv-dccpor_ndp, skb, GFP_ATOMIC);
if (unlikely(packet == NULL)) {
DCCP_WARN(%s(%p), Not enough mem to add rx packet 
  to history, consider it lost!\n, dccp_role(sk), sk);
@@ -936,7 +933,7 @@ static void ccid3_hc_rx_exit(struct sock *sk)
ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM);
 
/* Empty packet history */
-   dccp_rx_hist_purge(ccid3_rx_hist, hcrx-ccid3hcrx_hist);
+   dccp_rx_hist_purge(hcrx-ccid3hcrx_hist);
 
/* Empty loss interval history */
dccp_li_hist_purge(hcrx-ccid3hcrx_li_hist);
@@ -1013,33 +1010,13 @@ MODULE_PARM_DESC(ccid3_debug, Enable debug messages);
 
 static __init int ccid3_module_init(void)
 {
-   int rc = -ENOBUFS;
-
-   ccid3_rx_hist = dccp_rx_hist_new(ccid3);
-   if (ccid3_rx_hist == NULL)
-   goto out;
-
-   rc = ccid_register(ccid3);
-   if (rc != 0)
-   goto out_free_rx;
-out:
-   return rc;
-
-out_free_rx:
-   dccp_rx_hist_delete(ccid3_rx_hist);
-   ccid3_rx_hist = NULL;
-   goto out;
+   return ccid_register(ccid3);
 }
 module_init(ccid3_module_init);
 
 static __exit void ccid3_module_exit(void)
 {
ccid_unregister(ccid3);
-
-   if (ccid3_rx_hist != NULL) {
-   dccp_rx_hist_delete(ccid3_rx_hist);
-   ccid3_rx_hist = NULL;
-   }
 }
 module_exit(ccid3_module_exit);
 
diff --git a/net/dccp/ccids/lib/packet_history.c 
b/net/dccp/ccids/lib/packet_history.c
index b628714..e1ab853 100644
--- a/net/dccp/ccids/lib/packet_history.c
+++ b/net/dccp/ccids/lib/packet_history.c
@@ -114,48 +114,33 @@ EXPORT_SYMBOL_GPL(tfrc_tx_hist_rtt);
 /*
  * Receiver History Routines
  */
-struct dccp_rx_hist *dccp_rx_hist_new(const char *name)
+static struct kmem_cache *tfrc_rx_hist_slab;
+
+struct dccp_rx_hist_entry *dccp_rx_hist_entry_new(const u32 ndp,
+ const struct sk_buff *skb,
+ const gfp_t prio)
 {
-   struct dccp_rx_hist *hist = kmalloc(sizeof(*hist), GFP_ATOMIC);
-   static const char dccp_rx_hist_mask[] = rx_hist_%s;
-   char *slab_name;
-
-   if (hist == NULL)
-   goto out;
-
-   slab_name = kmalloc(strlen(name) + sizeof(dccp_rx_hist_mask) - 1,
-   GFP_ATOMIC);
-   if (slab_name == NULL)
-   goto out_free_hist;
-
-   sprintf(slab_name, dccp_rx_hist_mask, name);
-   hist-dccprxh_slab = kmem_cache_create(slab_name,
-sizeof(struct dccp_rx_hist_entry),
-0, SLAB_HWCACHE_ALIGN, NULL);
-   if (hist-dccprxh_slab == NULL)
-   goto out_free_slab_name;
-out:
-   return hist;
-out_free_slab_name:
-   kfree(slab_name);
-out_free_hist:
-   kfree(hist);
-   hist = NULL;
-   goto out;
-}
+   struct dccp_rx_hist_entry *entry = kmem_cache_alloc(tfrc_rx_hist_slab,
+   prio);
 
-EXPORT_SYMBOL_GPL(dccp_rx_hist_new);
+   if (entry != NULL) {
+   const struct dccp_hdr *dh = dccp_hdr(skb);
 
-void dccp_rx_hist_delete(struct dccp_rx_hist *hist)
-{
-   const char* name = kmem_cache_name(hist-dccprxh_slab);
+   entry-dccphrx_seqno = DCCP_SKB_CB(skb)-dccpd_seq;
+   entry-dccphrx_ccval = 

[PATCH 7/7] [TFRC]: New rx history code

2007-12-06 Thread Arnaldo Carvalho de Melo
Credit here goes to Gerrit Renker, that provided the initial implementation for
this new codebase.

I modified it just to try to make it closer to the existing API, renaming some
functions, add namespacing and fix one bug where the tfrc_rx_hist_alloc was not
freeing the allocated ring entries on the error path.

Original changeset comment from Gerrit:
  ---
This provides a new, self-contained and generic RX history service for TFRC
based protocols.

Details:
 * new data structure, initialisation and cleanup routines;
 * allocation of dccp_rx_hist entries local to packet_history.c,
   as a service exported by the dccp_tfrc_lib module.
 * interface to automatically track highest-received seqno;
 * receiver-based RTT estimation (needed for instance by RFC 3448, 6.3.1);
 * a generic function to test for `data packets' as per  RFC 4340, sec. 7.7.

Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
---
 net/dccp/ccids/ccid3.c  |  288 --
 net/dccp/ccids/ccid3.h  |   14 +-
 net/dccp/ccids/lib/loss_interval.c  |   13 ++-
 net/dccp/ccids/lib/packet_history.c |  290 +--
 net/dccp/ccids/lib/packet_history.h |   83 +--
 5 files changed, 330 insertions(+), 358 deletions(-)

diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index 5ff5aab..faacffa 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -641,6 +641,15 @@ static int ccid3_hc_tx_getsockopt(struct sock *sk, const 
int optname, int len,
 /*
  * Receiver Half-Connection Routines
  */
+
+/* CCID3 feedback types */
+enum ccid3_fback_type {
+   CCID3_FBACK_NONE = 0,
+   CCID3_FBACK_INITIAL,
+   CCID3_FBACK_PERIODIC,
+   CCID3_FBACK_PARAM_CHANGE
+};
+
 #ifdef CONFIG_IP_DCCP_CCID3_DEBUG
 static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
 {
@@ -667,59 +676,60 @@ static void ccid3_hc_rx_set_state(struct sock *sk,
hcrx-ccid3hcrx_state = state;
 }
 
-static inline void ccid3_hc_rx_update_s(struct ccid3_hc_rx_sock *hcrx, int len)
-{
-   if (likely(len  0))/* don't update on empty packets (e.g. ACKs) */
-   hcrx-ccid3hcrx_s = tfrc_ewma(hcrx-ccid3hcrx_s, len, 9);
-}
-
-static void ccid3_hc_rx_send_feedback(struct sock *sk)
+static void ccid3_hc_rx_send_feedback(struct sock *sk,
+ const struct sk_buff *skb,
+ enum ccid3_fback_type fbtype)
 {
struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk);
struct dccp_sock *dp = dccp_sk(sk);
-   struct tfrc_rx_hist_entry *packet;
ktime_t now;
-   suseconds_t delta;
+   s64 delta = 0;
 
ccid3_pr_debug(%s(%p) - entry \n, dccp_role(sk), sk);
 
+   if (unlikely(hcrx-ccid3hcrx_state == TFRC_RSTATE_TERM))
+   return;
+
now = ktime_get_real();
 
-   switch (hcrx-ccid3hcrx_state) {
-   case TFRC_RSTATE_NO_DATA:
+   switch (fbtype) {
+   case CCID3_FBACK_INITIAL:
hcrx-ccid3hcrx_x_recv = 0;
+   hcrx-ccid3hcrx_pinv   = ~0U;   /* see RFC 4342, 8.5 */
break;
-   case TFRC_RSTATE_DATA:
-   delta = ktime_us_delta(now,
-  hcrx-ccid3hcrx_tstamp_last_feedback);
-   DCCP_BUG_ON(delta  0);
-   hcrx-ccid3hcrx_x_recv =
-   scaled_div32(hcrx-ccid3hcrx_bytes_recv, delta);
+   case CCID3_FBACK_PARAM_CHANGE:
+   /*
+* When parameters change (new loss or p  p_prev), we do not
+* have a reliable estimate for R_m of [RFC 3448, 6.2] and so
+* need to  reuse the previous value of X_recv. However, when
+* X_recv was 0 (due to early loss), this would kill X down to
+* s/t_mbi (i.e. one packet in 64 seconds).
+* To avoid such drastic reduction, we approximate X_recv as
+* the number of bytes since last feedback.
+* This is a safe fallback, since X is bounded above by X_calc.
+*/
+   if (hcrx-ccid3hcrx_x_recv  0)
+   break;
+   /* fall through */
+   case CCID3_FBACK_PERIODIC:
+   delta = ktime_us_delta(now, 
hcrx-ccid3hcrx_tstamp_last_feedback);
+   if (delta = 0)
+   DCCP_BUG(delta (%ld) = 0, (long)delta);
+   else
+   hcrx-ccid3hcrx_x_recv =
+   scaled_div32(hcrx-ccid3hcrx_bytes_recv, delta);
break;
-   case TFRC_RSTATE_TERM:
-   DCCP_BUG(%s(%p) - Illegal state TERM, dccp_role(sk), sk);
+   default:
return;
}
 
-   packet = tfrc_rx_hist_find_data_packet(hcrx-ccid3hcrx_hist);
-   if (unlikely(packet == NULL)) {
-   DCCP_WARN(%s(%p), no data 

[PATCHES 0/7]: DCCP patches for 2.6.25

2007-12-06 Thread Arnaldo Carvalho de Melo
Hi David,

Please consider pulling from:

master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.25

Best Regards,

- Arnaldo

 b/net/dccp/ccids/Kconfig  |   13 
 b/net/dccp/ccids/ccid3.c  |   35 --
 b/net/dccp/ccids/ccid3.h  |   14 
 b/net/dccp/ccids/lib/Makefile |2 
 b/net/dccp/ccids/lib/loss_interval.c  |   14 
 b/net/dccp/ccids/lib/packet_history.c |   27 -
 b/net/dccp/ccids/lib/packet_history.h |3 
 b/net/dccp/ccids/lib/tfrc.c   |   48 +++
 b/net/dccp/ccids/lib/tfrc.h   |   18 -
 b/net/dccp/dccp.h |   13 
 net/dccp/ccids/ccid3.c|  322 --
 net/dccp/ccids/lib/loss_interval.c|   13 
 net/dccp/ccids/lib/packet_history.c   |  496 +++---
 net/dccp/ccids/lib/packet_history.h   |  177 
 14 files changed, 579 insertions(+), 616 deletions(-)
-
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


[PATCH 3/7] [TFRC]: Rename tfrc_tx_hist to tfrc_tx_hist_slab, for consistency

2007-12-06 Thread Arnaldo Carvalho de Melo
Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
---
 net/dccp/ccids/lib/packet_history.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/net/dccp/ccids/lib/packet_history.c 
b/net/dccp/ccids/lib/packet_history.c
index 1d4d6ee..b628714 100644
--- a/net/dccp/ccids/lib/packet_history.c
+++ b/net/dccp/ccids/lib/packet_history.c
@@ -53,7 +53,7 @@ struct tfrc_tx_hist_entry {
 /*
  * Transmitter History Routines
  */
-static struct kmem_cache *tfrc_tx_hist;
+static struct kmem_cache *tfrc_tx_hist_slab;
 
 static struct tfrc_tx_hist_entry *
tfrc_tx_hist_find_entry(struct tfrc_tx_hist_entry *head, u64 seqno)
@@ -66,7 +66,7 @@ static struct tfrc_tx_hist_entry *
 
 int tfrc_tx_hist_add(struct tfrc_tx_hist_entry **headp, u64 seqno)
 {
-   struct tfrc_tx_hist_entry *entry = kmem_cache_alloc(tfrc_tx_hist, 
gfp_any());
+   struct tfrc_tx_hist_entry *entry = kmem_cache_alloc(tfrc_tx_hist_slab, 
gfp_any());
 
if (entry == NULL)
return -ENOBUFS;
@@ -85,7 +85,7 @@ void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp)
while (head != NULL) {
struct tfrc_tx_hist_entry *next = head-next;
 
-   kmem_cache_free(tfrc_tx_hist, head);
+   kmem_cache_free(tfrc_tx_hist_slab, head);
head = next;
}
 
@@ -278,17 +278,17 @@ EXPORT_SYMBOL_GPL(dccp_rx_hist_purge);
 
 __init int packet_history_init(void)
 {
-   tfrc_tx_hist = kmem_cache_create(tfrc_tx_hist,
-sizeof(struct tfrc_tx_hist_entry), 0,
-SLAB_HWCACHE_ALIGN, NULL);
+   tfrc_tx_hist_slab = kmem_cache_create(tfrc_tx_hist,
+ sizeof(struct 
tfrc_tx_hist_entry), 0,
+ SLAB_HWCACHE_ALIGN, NULL);
 
-   return tfrc_tx_hist == NULL ? -ENOBUFS : 0;
+   return tfrc_tx_hist_slab == NULL ? -ENOBUFS : 0;
 }
 
 void packet_history_exit(void)
 {
-   if (tfrc_tx_hist != NULL) {
-   kmem_cache_destroy(tfrc_tx_hist);
-   tfrc_tx_hist = NULL;
+   if (tfrc_tx_hist_slab != NULL) {
+   kmem_cache_destroy(tfrc_tx_hist_slab);
+   tfrc_tx_hist_slab = NULL;
}
 }
-- 
1.5.3.4

-
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


[PATCH 1/7] [TFRC]: Provide central source file and debug facility

2007-12-06 Thread Arnaldo Carvalho de Melo
From: Gerrit Renker [EMAIL PROTECTED]

This patch changes the tfrc_lib module in the following manner:

 (1) a dedicated tfrc source file to call the packet history 
 loss interval init/exit functions.
 (2) a dedicated tfrc_pr_debug macro with toggle switch `tfrc_debug'.

Commiter note: renamed tfrc_module.c to tfrc.c, and made CONFIG_IP_DCCP_CCID3
select IP_DCCP_TFRC_LIB.

Signed-off-by: Gerrit Renker [EMAIL PROTECTED]
Signed-off-by: Ian McDonald [EMAIL PROTECTED]
Signed-off-by: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
---
 net/dccp/ccids/Kconfig  |   13 ++---
 net/dccp/ccids/lib/Makefile |2 +-
 net/dccp/ccids/lib/packet_history.c |   27 ++-
 net/dccp/ccids/lib/packet_history.h |3 +-
 net/dccp/ccids/lib/tfrc.c   |   48 +++
 net/dccp/ccids/lib/tfrc.h   |   17 +---
 6 files changed, 75 insertions(+), 35 deletions(-)
 create mode 100644 net/dccp/ccids/lib/tfrc.c

diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig
index 3d7d867..1227594 100644
--- a/net/dccp/ccids/Kconfig
+++ b/net/dccp/ccids/Kconfig
@@ -38,6 +38,7 @@ config IP_DCCP_CCID2_DEBUG
 config IP_DCCP_CCID3
tristate CCID3 (TCP-Friendly) (EXPERIMENTAL)
def_tristate IP_DCCP
+   select IP_DCCP_TFRC_LIB
---help---
  CCID 3 denotes TCP-Friendly Rate Control (TFRC), an equation-based
  rate-controlled congestion control mechanism.  TFRC is designed to
@@ -63,10 +64,6 @@ config IP_DCCP_CCID3
 
  If in doubt, say M.
 
-config IP_DCCP_TFRC_LIB
-   depends on IP_DCCP_CCID3
-   def_tristate IP_DCCP_CCID3
-
 config IP_DCCP_CCID3_DEBUG
  bool CCID3 debugging messages
  depends on IP_DCCP_CCID3
@@ -110,5 +107,13 @@ config IP_DCCP_CCID3_RTO
is serious network congestion: experimenting with larger values 
should
therefore not be performed on WANs.
 
+config IP_DCCP_TFRC_LIB
+   tristate
+   default n
+
+config IP_DCCP_TFRC_DEBUG
+   bool
+   depends on IP_DCCP_TFRC_LIB
+   default y if IP_DCCP_CCID3_DEBUG
 
 endmenu
diff --git a/net/dccp/ccids/lib/Makefile b/net/dccp/ccids/lib/Makefile
index 5f940a6..68c93e3 100644
--- a/net/dccp/ccids/lib/Makefile
+++ b/net/dccp/ccids/lib/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_IP_DCCP_TFRC_LIB) += dccp_tfrc_lib.o
 
-dccp_tfrc_lib-y := loss_interval.o packet_history.o tfrc_equation.o
+dccp_tfrc_lib-y := tfrc.o tfrc_equation.o packet_history.o loss_interval.o
diff --git a/net/dccp/ccids/lib/packet_history.c 
b/net/dccp/ccids/lib/packet_history.c
index 4805de9..1d4d6ee 100644
--- a/net/dccp/ccids/lib/packet_history.c
+++ b/net/dccp/ccids/lib/packet_history.c
@@ -35,7 +35,6 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include linux/module.h
 #include linux/string.h
 #include packet_history.h
 
@@ -277,39 +276,19 @@ void dccp_rx_hist_purge(struct dccp_rx_hist *hist, struct 
list_head *list)
 
 EXPORT_SYMBOL_GPL(dccp_rx_hist_purge);
 
-extern int __init dccp_li_init(void);
-extern void dccp_li_exit(void);
-
-static __init int packet_history_init(void)
+__init int packet_history_init(void)
 {
-   if (dccp_li_init() != 0)
-   goto out;
-
tfrc_tx_hist = kmem_cache_create(tfrc_tx_hist,
 sizeof(struct tfrc_tx_hist_entry), 0,
 SLAB_HWCACHE_ALIGN, NULL);
-   if (tfrc_tx_hist == NULL)
-   goto out_li_exit;
 
-   return 0;
-out_li_exit:
-   dccp_li_exit();
-out:
-   return -ENOBUFS;
+   return tfrc_tx_hist == NULL ? -ENOBUFS : 0;
 }
-module_init(packet_history_init);
 
-static __exit void packet_history_exit(void)
+void packet_history_exit(void)
 {
if (tfrc_tx_hist != NULL) {
kmem_cache_destroy(tfrc_tx_hist);
tfrc_tx_hist = NULL;
}
-   dccp_li_exit();
 }
-module_exit(packet_history_exit);
-
-MODULE_AUTHOR(Ian McDonald [EMAIL PROTECTED], 
- Arnaldo Carvalho de Melo [EMAIL PROTECTED]);
-MODULE_DESCRIPTION(DCCP TFRC library);
-MODULE_LICENSE(GPL);
diff --git a/net/dccp/ccids/lib/packet_history.h 
b/net/dccp/ccids/lib/packet_history.h
index 0670f46..9a2642e 100644
--- a/net/dccp/ccids/lib/packet_history.h
+++ b/net/dccp/ccids/lib/packet_history.h
@@ -39,8 +39,7 @@
 #include linux/ktime.h
 #include linux/list.h
 #include linux/slab.h
-
-#include ../../dccp.h
+#include tfrc.h
 
 /* Number of later packets received before one is considered lost */
 #define TFRC_RECV_NUM_LATE_LOSS 3
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c
new file mode 100644
index 000..3a7a183
--- /dev/null
+++ b/net/dccp/ccids/lib/tfrc.c
@@ -0,0 +1,48 @@
+/*
+ * TFRC: main module holding the pieces of the TFRC library together
+ *
+ * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
+ * Copyright (c) 2007 Arnaldo Carvalho de Melo [EMAIL PROTECTED]
+ */
+#include 

Re: [PATCHES 0/7]: DCCP patches for 2.6.25

2007-12-06 Thread David Miller
From: Arnaldo Carvalho de Melo [EMAIL PROTECTED]
Date: Thu,  6 Dec 2007 19:02:47 -0200

   Please consider pulling from:
 
 master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.25

Pulled and pushed out to net-2.6.25, thanks!
-
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