aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/lib/loss_interval.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-12-06 10:18:11 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:56:43 -0500
commitb84a2189c4e1835c51fd6b974a0497be9bc4ba87 (patch)
treed488b0a45618ac37c605b10b093f8f03a050a7fc /net/dccp/ccids/lib/loss_interval.c
parent30a0eacd479f1c7c15fe0496585ff29f76de3378 (diff)
[TFRC]: New rx history code
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 <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids/lib/loss_interval.c')
-rw-r--r--net/dccp/ccids/lib/loss_interval.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c
index a5f59af8df4..c0a933a1d28 100644
--- a/net/dccp/ccids/lib/loss_interval.c
+++ b/net/dccp/ccids/lib/loss_interval.c
@@ -129,6 +129,13 @@ static u32 dccp_li_calc_first_li(struct sock *sk,
129 u16 s, u32 bytes_recv, 129 u16 s, u32 bytes_recv,
130 u32 previous_x_recv) 130 u32 previous_x_recv)
131{ 131{
132/*
133 * FIXME:
134 * Will be rewritten in the upcoming new loss intervals code.
135 * Has to be commented ou because it relies on the old rx history
136 * data structures
137 */
138#if 0
132 struct tfrc_rx_hist_entry *entry, *next, *tail = NULL; 139 struct tfrc_rx_hist_entry *entry, *next, *tail = NULL;
133 u32 x_recv, p; 140 u32 x_recv, p;
134 suseconds_t rtt, delta; 141 suseconds_t rtt, delta;
@@ -216,10 +223,10 @@ found:
216 dccp_pr_debug("%s(%p), receive rate=%u bytes/s, implied " 223 dccp_pr_debug("%s(%p), receive rate=%u bytes/s, implied "
217 "loss rate=%u\n", dccp_role(sk), sk, x_recv, p); 224 "loss rate=%u\n", dccp_role(sk), sk, x_recv, p);
218 225
219 if (p == 0) 226 if (p != 0)
220 return ~0;
221 else
222 return 1000000 / p; 227 return 1000000 / p;
228#endif
229 return ~0;
223} 230}
224 231
225void dccp_li_update_li(struct sock *sk, 232void dccp_li_update_li(struct sock *sk,