lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] static vs dynamic netbufs


From: Joel Cunningham
Subject: [lwip-devel] static vs dynamic netbufs
Date: Mon, 22 Dec 2014 17:35:44 +0000 (GMT)

I have a question about netbuf usage and the BSD socket implementation.  From looking at netbuf.c and sockets.c, it appears there are APIs in netbuf.c for allocating netbufs from a netbuf memory pool.  This APIs are netbuf_new() and netbuf_delete().  The sockets layer uses a netbuf in lwip_sendto(), with either a subsequent call to netbuf_alloc() or netbuf_ref(), but not a netbuf from netbuf_new(), instead a static struct on the stack.

What's the intended use of the netbuf pool?  Should the socket layer ever use that?  Further, I've noticed some of the netbuf APIs assume a dynamic netbuf, e.g. netbuf_chain() calls memp_free on the tail netbuf (which would be incorrect with a static netbuf).

http://lwip.wikia.com/wiki/Netconn_send - this indicates lwip_sendto() should be using netbuf_new().  Typo?

Thanks,

Joel


reply via email to

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