lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: [lwip] lwip 0.4.2: missing mem_free() with broadcasts?


From: Horst Garnetzke
Subject: [lwip-users] Re: [lwip] lwip 0.4.2: missing mem_free() with broadcasts?
Date: Wed, 08 Jan 2003 22:13:29 -0000

Adam Dunkels wrote:

> On Wednesday 28 November 2001 10:25, you wrote:
>>> Are you allocating heap memory for incoming pbufs (i.e., pbuf type
>>>PBUF_RAM)?


 >>Yes ...

>>? is that a problem ?


> It can be since is will call mem_malloc() that in turn will call sem_wait() 
> which may block the thread. Also, it may cause memory fragmentation. The pbuf 
> pool (type PBUF_POOL) is probably better suited for this, but it will 
> allocate a chain of pbufs so that driver will have to be prepared to handle 
> this.


I found this situation about 2 month ago!
I solved this problem by changing your mem_malloc() etc. routines from 
semaphore blocking to interrupt disabling (splhi(),splx()). But I see 
that this works in my embedded environment and not under linux of course.

> 
> Look in src/netif/ethernetif.c for an example of how the pbuf pool might be 
> used in a driver.


This may be a better solution - I'll follow your hints.
Thanks a lot.

-Horst

-- 
Horst Garnetzke                      address@hidden

[This message was sent through the lwip discussion list.]




reply via email to

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