lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] lwip does not ack retransmissions


From: Alain M.
Subject: Re: [lwip-users] lwip does not ack retransmissions
Date: Wed, 28 Jan 2009 00:19:28 -0200
User-agent: Thunderbird 2.0.0.17 (X11/20080914)

Hi John,

I have read this thread carefully but I managed to get lost. Now that you solved the problem, could you please give us a quick description of what caused the problem and the solution??

This could happen to any of us...

Thanks,
Alain

john bougs escreveu:
So perhaps you could submit a task at
http://savannah.nongnu.org/projects/lwip to sort this out
so it doesn't get
forgotten. But thinking about it, it shouldn't be that
difficult really...
in fact I speculate it would just involve adding something
like the
following in pbuf.c:

#if TCP_QUEUE_OOSEQ
#include "lwip/tcp.h"
#endif

#if TCP_QUEUE_OOSEQ
#define ALLOC_PBUF(p) do { (p) = alloc_pbuf_pool(); } while
(0)
#else
#define ALLOC_PBUF(p) do { (p) =
memp_malloc(MEMP_PBUF_POOL); } while (0)
#endif

#if TCP_QUEUE_OOSEQ
/* Attempt to reclaim some memory from queued
out-of-sequence packets */
/* It's better to give priority to new packets if
we're running out. */
static struct pbuf *
alloc_pbuf_pool(void)
{
  struct tcp_pcb *pcb;
  struct pbuf *p;

retry:
  p = memp_malloc(MEMP_PBUF_POOL);
  if (NULL == p)
  {
    for (pcb=tcp_active_pcbs; NULL != pcb; pcb =
pcb->next) {
      if (NULL != pcb->ooseq) {
        tcp_segs_free(pcb->ooseq);
        pcb->ooseq = NULL;
        goto retry;
      }
    }
  }
  return p;
}
#endif /* TCP_QUEUE_OOSEQ */

Then change the two calls to memp_malloc(MEMP_PBUF_POOL) in
pbuf_alloc() to
 ALLOC_PBUF_POOL(p).

If you don't mind giving this a spin, that would be
great. I'm not in a
position to test it (I've just written it off the top
of my head).

Had to change the macro name to ALLOC_PBUF_POOL, and the second call to use (q).... but it worked. From an efficiency view point this works a little better, but not much. Sometimes the TCP_QUEUE_OOSEQ = 0 creates a bunch of traffic, but they both take about the same time to resolve the issue ...200-400ms.
I understand what happening now so am much happier.  I will submit the request 
tomorrow.  Thank you for your help.



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






reply via email to

[Prev in Thread] Current Thread [Next in Thread]