summaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/lib
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-12-06 12:28:39 -0200
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:56:42 -0800
commitd58d1af03a6a3ddf296ae3aeb4ff234af4b15958 (patch)
tree44194b47b1c1b188f300ec1d1f6f0eed6e9a8849 /net/dccp/ccids/lib
parent34a9e7ea91bb4acb45ae5331e7403304029329b2 (diff)
downloadop-kernel-dev-d58d1af03a6a3ddf296ae3aeb4ff234af4b15958.zip
op-kernel-dev-d58d1af03a6a3ddf296ae3aeb4ff234af4b15958.tar.gz
[TFRC]: Rename dccp_rx_ to tfrc_rx_
This is in preparation for merging the new rx history code written by Gerrit Renker. 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')
-rw-r--r--net/dccp/ccids/lib/loss_interval.c14
-rw-r--r--net/dccp/ccids/lib/packet_history.c90
-rw-r--r--net/dccp/ccids/lib/packet_history.h48
3 files changed, 76 insertions, 76 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c
index f2ca4eb..a5f59af 100644
--- a/net/dccp/ccids/lib/loss_interval.c
+++ b/net/dccp/ccids/lib/loss_interval.c
@@ -129,7 +129,7 @@ static u32 dccp_li_calc_first_li(struct sock *sk,
u16 s, u32 bytes_recv,
u32 previous_x_recv)
{
- struct dccp_rx_hist_entry *entry, *next, *tail = NULL;
+ struct tfrc_rx_hist_entry *entry, *next, *tail = NULL;
u32 x_recv, p;
suseconds_t rtt, delta;
ktime_t tstamp = ktime_set(0, 0);
@@ -138,18 +138,18 @@ static u32 dccp_li_calc_first_li(struct sock *sk,
int step = 0;
u64 fval;
- list_for_each_entry_safe(entry, next, hist_list, dccphrx_node) {
- if (dccp_rx_hist_entry_data_packet(entry)) {
+ list_for_each_entry_safe(entry, next, hist_list, tfrchrx_node) {
+ if (tfrc_rx_hist_entry_data_packet(entry)) {
tail = entry;
switch (step) {
case 0:
- tstamp = entry->dccphrx_tstamp;
- win_count = entry->dccphrx_ccval;
+ tstamp = entry->tfrchrx_tstamp;
+ win_count = entry->tfrchrx_ccval;
step = 1;
break;
case 1:
- interval = win_count - entry->dccphrx_ccval;
+ interval = win_count - entry->tfrchrx_ccval;
if (interval < 0)
interval += TFRC_WIN_COUNT_LIMIT;
if (interval > 4)
@@ -176,7 +176,7 @@ found:
return ~0;
}
- delta = ktime_us_delta(tstamp, tail->dccphrx_tstamp);
+ delta = ktime_us_delta(tstamp, tail->tfrchrx_tstamp);
DCCP_BUG_ON(delta < 0);
rtt = delta * 4 / interval;
diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c
index e1ab853..255cca1 100644
--- a/net/dccp/ccids/lib/packet_history.c
+++ b/net/dccp/ccids/lib/packet_history.c
@@ -116,58 +116,58 @@ EXPORT_SYMBOL_GPL(tfrc_tx_hist_rtt);
*/
static struct kmem_cache *tfrc_rx_hist_slab;
-struct dccp_rx_hist_entry *dccp_rx_hist_entry_new(const u32 ndp,
+struct tfrc_rx_hist_entry *tfrc_rx_hist_entry_new(const u32 ndp,
const struct sk_buff *skb,
const gfp_t prio)
{
- struct dccp_rx_hist_entry *entry = kmem_cache_alloc(tfrc_rx_hist_slab,
+ struct tfrc_rx_hist_entry *entry = kmem_cache_alloc(tfrc_rx_hist_slab,
prio);
if (entry != NULL) {
const struct dccp_hdr *dh = dccp_hdr(skb);
- entry->dccphrx_seqno = DCCP_SKB_CB(skb)->dccpd_seq;
- entry->dccphrx_ccval = dh->dccph_ccval;
- entry->dccphrx_type = dh->dccph_type;
- entry->dccphrx_ndp = ndp;
- entry->dccphrx_tstamp = ktime_get_real();
+ entry->tfrchrx_seqno = DCCP_SKB_CB(skb)->dccpd_seq;
+ entry->tfrchrx_ccval = dh->dccph_ccval;
+ entry->tfrchrx_type = dh->dccph_type;
+ entry->tfrchrx_ndp = ndp;
+ entry->tfrchrx_tstamp = ktime_get_real();
}
return entry;
}
-EXPORT_SYMBOL_GPL(dccp_rx_hist_entry_new);
+EXPORT_SYMBOL_GPL(tfrc_rx_hist_entry_new);
-static inline void dccp_rx_hist_entry_delete(struct dccp_rx_hist_entry *entry)
+static inline void tfrc_rx_hist_entry_delete(struct tfrc_rx_hist_entry *entry)
{
kmem_cache_free(tfrc_rx_hist_slab, entry);
}
-int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq,
+int tfrc_rx_hist_find_entry(const struct list_head *list, const u64 seq,
u8 *ccval)
{
- struct dccp_rx_hist_entry *packet = NULL, *entry;
+ struct tfrc_rx_hist_entry *packet = NULL, *entry;
- list_for_each_entry(entry, list, dccphrx_node)
- if (entry->dccphrx_seqno == seq) {
+ list_for_each_entry(entry, list, tfrchrx_node)
+ if (entry->tfrchrx_seqno == seq) {
packet = entry;
break;
}
if (packet)
- *ccval = packet->dccphrx_ccval;
+ *ccval = packet->tfrchrx_ccval;
return packet != NULL;
}
-EXPORT_SYMBOL_GPL(dccp_rx_hist_find_entry);
-struct dccp_rx_hist_entry *
- dccp_rx_hist_find_data_packet(const struct list_head *list)
+EXPORT_SYMBOL_GPL(tfrc_rx_hist_find_entry);
+struct tfrc_rx_hist_entry *
+ tfrc_rx_hist_find_data_packet(const struct list_head *list)
{
- struct dccp_rx_hist_entry *entry, *packet = NULL;
+ struct tfrc_rx_hist_entry *entry, *packet = NULL;
- list_for_each_entry(entry, list, dccphrx_node)
- if (entry->dccphrx_type == DCCP_PKT_DATA ||
- entry->dccphrx_type == DCCP_PKT_DATAACK) {
+ list_for_each_entry(entry, list, tfrchrx_node)
+ if (entry->tfrchrx_type == DCCP_PKT_DATA ||
+ entry->tfrchrx_type == DCCP_PKT_DATAACK) {
packet = entry;
break;
}
@@ -175,29 +175,29 @@ struct dccp_rx_hist_entry *
return packet;
}
-EXPORT_SYMBOL_GPL(dccp_rx_hist_find_data_packet);
+EXPORT_SYMBOL_GPL(tfrc_rx_hist_find_data_packet);
-void dccp_rx_hist_add_packet(struct list_head *rx_list,
+void tfrc_rx_hist_add_packet(struct list_head *rx_list,
struct list_head *li_list,
- struct dccp_rx_hist_entry *packet,
+ struct tfrc_rx_hist_entry *packet,
u64 nonloss_seqno)
{
- struct dccp_rx_hist_entry *entry, *next;
+ struct tfrc_rx_hist_entry *entry, *next;
u8 num_later = 0;
- list_add(&packet->dccphrx_node, rx_list);
+ list_add(&packet->tfrchrx_node, rx_list);
num_later = TFRC_RECV_NUM_LATE_LOSS + 1;
if (!list_empty(li_list)) {
- list_for_each_entry_safe(entry, next, rx_list, dccphrx_node) {
+ list_for_each_entry_safe(entry, next, rx_list, tfrchrx_node) {
if (num_later == 0) {
if (after48(nonloss_seqno,
- entry->dccphrx_seqno)) {
- list_del_init(&entry->dccphrx_node);
- dccp_rx_hist_entry_delete(entry);
+ entry->tfrchrx_seqno)) {
+ list_del_init(&entry->tfrchrx_node);
+ tfrc_rx_hist_entry_delete(entry);
}
- } else if (dccp_rx_hist_entry_data_packet(entry))
+ } else if (tfrc_rx_hist_entry_data_packet(entry))
--num_later;
}
} else {
@@ -208,7 +208,7 @@ void dccp_rx_hist_add_packet(struct list_head *rx_list,
* We have no loss interval history so we need at least one
* rtt:s of data packets to approximate rtt.
*/
- list_for_each_entry_safe(entry, next, rx_list, dccphrx_node) {
+ list_for_each_entry_safe(entry, next, rx_list, tfrchrx_node) {
if (num_later == 0) {
switch (step) {
case 0:
@@ -220,10 +220,10 @@ void dccp_rx_hist_add_packet(struct list_head *rx_list,
step = 2;
/* OK, find next data packet */
num_later = 1;
- win_count = entry->dccphrx_ccval;
+ win_count = entry->tfrchrx_ccval;
break;
case 2:
- tmp = win_count - entry->dccphrx_ccval;
+ tmp = win_count - entry->tfrchrx_ccval;
if (tmp < 0)
tmp += TFRC_WIN_COUNT_LIMIT;
if (tmp > TFRC_WIN_COUNT_PER_RTT + 1) {
@@ -236,29 +236,29 @@ void dccp_rx_hist_add_packet(struct list_head *rx_list,
num_later = 1;
break;
case 3:
- list_del_init(&entry->dccphrx_node);
- dccp_rx_hist_entry_delete(entry);
+ list_del_init(&entry->tfrchrx_node);
+ tfrc_rx_hist_entry_delete(entry);
break;
}
- } else if (dccp_rx_hist_entry_data_packet(entry))
+ } else if (tfrc_rx_hist_entry_data_packet(entry))
--num_later;
}
}
}
-EXPORT_SYMBOL_GPL(dccp_rx_hist_add_packet);
+EXPORT_SYMBOL_GPL(tfrc_rx_hist_add_packet);
-void dccp_rx_hist_purge(struct list_head *list)
+void tfrc_rx_hist_purge(struct list_head *list)
{
- struct dccp_rx_hist_entry *entry, *next;
+ struct tfrc_rx_hist_entry *entry, *next;
- list_for_each_entry_safe(entry, next, list, dccphrx_node) {
- list_del_init(&entry->dccphrx_node);
- dccp_rx_hist_entry_delete(entry);
+ list_for_each_entry_safe(entry, next, list, tfrchrx_node) {
+ list_del_init(&entry->tfrchrx_node);
+ tfrc_rx_hist_entry_delete(entry);
}
}
-EXPORT_SYMBOL_GPL(dccp_rx_hist_purge);
+EXPORT_SYMBOL_GPL(tfrc_rx_hist_purge);
__init int packet_history_init(void)
{
@@ -269,7 +269,7 @@ __init int packet_history_init(void)
goto out_err;
tfrc_rx_hist_slab = kmem_cache_create("tfrc_rx_hist",
- sizeof(struct dccp_rx_hist_entry), 0,
+ sizeof(struct tfrc_rx_hist_entry), 0,
SLAB_HWCACHE_ALIGN, NULL);
if (tfrc_rx_hist_slab == NULL)
goto out_free_tx;
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h
index 34b180b..5b0b983 100644
--- a/net/dccp/ccids/lib/packet_history.h
+++ b/net/dccp/ccids/lib/packet_history.h
@@ -57,51 +57,51 @@ extern u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head,
/*
* Receiver History data structures and declarations
*/
-struct dccp_rx_hist_entry {
- struct list_head dccphrx_node;
- u64 dccphrx_seqno:48,
- dccphrx_ccval:4,
- dccphrx_type:4;
- u32 dccphrx_ndp; /* In fact it is from 8 to 24 bits */
- ktime_t dccphrx_tstamp;
+struct tfrc_rx_hist_entry {
+ struct list_head tfrchrx_node;
+ u64 tfrchrx_seqno:48,
+ tfrchrx_ccval:4,
+ tfrchrx_type:4;
+ u32 tfrchrx_ndp; /* In fact it is from 8 to 24 bits */
+ ktime_t tfrchrx_tstamp;
};
-extern struct dccp_rx_hist_entry *
- dccp_rx_hist_entry_new(const u32 ndp,
+extern struct tfrc_rx_hist_entry *
+ tfrc_rx_hist_entry_new(const u32 ndp,
const struct sk_buff *skb,
const gfp_t prio);
-static inline struct dccp_rx_hist_entry *
- dccp_rx_hist_head(struct list_head *list)
+static inline struct tfrc_rx_hist_entry *
+ tfrc_rx_hist_head(struct list_head *list)
{
- struct dccp_rx_hist_entry *head = NULL;
+ struct tfrc_rx_hist_entry *head = NULL;
if (!list_empty(list))
- head = list_entry(list->next, struct dccp_rx_hist_entry,
- dccphrx_node);
+ head = list_entry(list->next, struct tfrc_rx_hist_entry,
+ tfrchrx_node);
return head;
}
-extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq,
+extern int tfrc_rx_hist_find_entry(const struct list_head *list, const u64 seq,
u8 *ccval);
-extern struct dccp_rx_hist_entry *
- dccp_rx_hist_find_data_packet(const struct list_head *list);
+extern struct tfrc_rx_hist_entry *
+ tfrc_rx_hist_find_data_packet(const struct list_head *list);
-extern void dccp_rx_hist_add_packet(struct list_head *rx_list,
+extern void tfrc_rx_hist_add_packet(struct list_head *rx_list,
struct list_head *li_list,
- struct dccp_rx_hist_entry *packet,
+ struct tfrc_rx_hist_entry *packet,
u64 nonloss_seqno);
-extern void dccp_rx_hist_purge(struct list_head *list);
+extern void tfrc_rx_hist_purge(struct list_head *list);
static inline int
- dccp_rx_hist_entry_data_packet(const struct dccp_rx_hist_entry *entry)
+ tfrc_rx_hist_entry_data_packet(const struct tfrc_rx_hist_entry *entry)
{
- return entry->dccphrx_type == DCCP_PKT_DATA ||
- entry->dccphrx_type == DCCP_PKT_DATAACK;
+ return entry->tfrchrx_type == DCCP_PKT_DATA ||
+ entry->tfrchrx_type == DCCP_PKT_DATAACK;
}
-extern u64 dccp_rx_hist_detect_loss(struct list_head *rx_list,
+extern u64 tfrc_rx_hist_detect_loss(struct list_head *rx_list,
struct list_head *li_list, u8 *win_loss);
#endif /* _DCCP_PKT_HIST_ */
OpenPOWER on IntegriCloud