kernel_optimize_test/net/dccp/ccids/lib/loss_interval.h
Ian McDonald 66a377c504 [DCCP]: Fix CCID3
This fixes CCID3 to give much closer performance to RFC4342.

CCID3 is meant to alter sending rate based on RTT and loss.

The performance was verified against:
http://wand.net.nz/~perry/max_download.php

For example I tested with netem and had the following parameters:
Delayed Acks 1, MSS 256 bytes, RTT 105 ms, packet loss 5%.

This gives a theoretical speed of 71.9 Kbits/s. I measured across three
runs with this patch set and got 70.1 Kbits/s. Without this patchset the
average was 232 Kbits/s which means Linux can't be used for CCID3 research
properly.

I also tested with netem turned off so box just acting as router with 1.2
msec RTT. The performance with this is the same with or without the patch
at around 30 Mbit/s.

Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-08-26 23:40:50 -07:00

58 lines
1.6 KiB
C

#ifndef _DCCP_LI_HIST_
#define _DCCP_LI_HIST_
/*
* net/dccp/ccids/lib/loss_interval.h
*
* Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
* Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz>
* Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*/
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/time.h>
#define DCCP_LI_HIST_IVAL_F_LENGTH 8
struct dccp_li_hist {
kmem_cache_t *dccplih_slab;
};
extern struct dccp_li_hist *dccp_li_hist_new(const char *name);
extern void dccp_li_hist_delete(struct dccp_li_hist *hist);
struct dccp_li_hist_entry {
struct list_head dccplih_node;
u64 dccplih_seqno:48,
dccplih_win_count:4;
u32 dccplih_interval;
};
static inline struct dccp_li_hist_entry *
dccp_li_hist_entry_new(struct dccp_li_hist *hist,
const gfp_t prio)
{
return kmem_cache_alloc(hist->dccplih_slab, prio);
}
static inline void dccp_li_hist_entry_delete(struct dccp_li_hist *hist,
struct dccp_li_hist_entry *entry)
{
if (entry != NULL)
kmem_cache_free(hist->dccplih_slab, entry);
}
extern void dccp_li_hist_purge(struct dccp_li_hist *hist,
struct list_head *list);
extern u32 dccp_li_hist_calc_i_mean(struct list_head *list);
extern int dccp_li_hist_interval_new(struct dccp_li_hist *hist,
struct list_head *list, const u64 seq_loss, const u8 win_loss);
#endif /* _DCCP_LI_HIST_ */