From 9ece48fb91770bc9696ccecc4e1ba7e927e02315 Mon Sep 17 00:00:00 2001 From: Michael Blizek Date: Sat, 13 Feb 2010 14:46:51 +0100 Subject: [PATCH] retransmit send timing bugfix --- net/cor/snd.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/net/cor/snd.c b/net/cor/snd.c index 59dbe0525be..4212a088bd7 100644 --- a/net/cor/snd.c +++ b/net/cor/snd.c @@ -163,13 +163,19 @@ static void cor_xmit(struct sk_buff *skb, int atomic) dev_queue_xmit(skb2); } +static void set_retrans_timeout(struct sk_buff *skb, struct neighbor *nb) +{ + struct skb_procstate *ps = skb_pstate(skb); + ps->funcstate.retransmit_queue.timeout = jiffies + + msecs_to_jiffies(100 + nb->latency); +} + void retransmit_timerfunc(unsigned long arg) { unsigned long iflags; struct neighbor *nb = (struct neighbor *) arg; struct sk_buff *skb = 0; - struct skb_procstate *ps = 0; unsigned long timeout; @@ -179,16 +185,16 @@ void retransmit_timerfunc(unsigned long arg) if (0 == skb) goto out; + + timeout = skb_pstate(skb)->funcstate.retransmit_queue.timeout; - ps = skb_pstate(skb); - timeout = ps->funcstate.retransmit_queue.timeout; - - if (time_before(timeout, jiffies)) { + if (time_after(timeout, jiffies)) { __skb_queue_head(&(nb->retrans_list), skb); goto modtimer; } + + set_retrans_timeout(skb, nb); - ps->funcstate.retransmit_queue.timeout = jiffies + nb->latency; __skb_queue_tail(&(nb->retrans_list), skb); spin_unlock_irqrestore( &(nb->retrans_lock), iflags ); @@ -295,7 +301,7 @@ static void schedule_retransmit(struct sk_buff *skb, struct neighbor *nb) rm.seqno = ps->funcstate.retransmit_queue.seqno; rm.nb = nb; - ps->funcstate.retransmit_queue.timeout = jiffies + nb->latency; + set_retrans_timeout(skb, nb); ref_counter_init(&(ps->funcstate.retransmit_queue.refs), &skb_refcnt); htable_insert(&retransmits, (char *) skb, rm_to_key(&rm)); spin_lock_irqsave( &(nb->retrans_lock), iflags ); -- 2.11.4.GIT