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