lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Packet queues (was Re: [bug #11400] ARP multi-packet-qu


From: Jonathan Larmour
Subject: Re: [lwip-devel] Packet queues (was Re: [bug #11400] ARP multi-packet-queue modifies TCP ...)
Date: Tue, 10 Apr 2007 15:15:37 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20070301)

Kieran Mansley wrote:

I'd like to avoid special cases if I can, so if it could sensibly be
generalised to all pbuf types, that would be nice.  That way it would
just become an additional flag on the pbuf->flags variable that was
independent of type.  Doing so wouldn't add any additional code over
your proposal I think - might even make it simpler - and would make it
easier to use this feature from other places (e.g. the TCP side of
things) if we find it necessary in the future.

That's a little more work than I was envisaging, but not much. Currently lwIP ubiquitously tests the flags with pure equality, for example:
 if (pbuf->flags == PBUF_FLAG_RAM)
so an extra bit ORd in will break that.

Unhelpfully, PBUF_FLAG_RAM is defined as "0x00U", so it isn't even a bit at all. It would have to be given a new value, but that's not a problem.

I guess the best solution would be to use test macros e.g.:
#define PBUF_FLAG_RAM 0x08U
#define PBUF_FLAG_NOCOPY 0x10U

#define PBUF_IS_RAM(_p) ((_p)->flags & PBUF_FLAG_RAM)
#define PBUF_NEEDS_COPY(_p) (0 == ((_p)->flags & PBUF_FLAG_NOCOPY))

Perhaps we should add a this as a task to the savannah tracker.  Would
you be willing to take ownership of this for the time being?  I'm in no
hurry for a solution, but I think it would definitely be an improvement
and shouldn't get forgotten.

My employer is keen to have a single copy implementation for some low memory System-On-Chips, so hopefully this should happen quite soon. But to make sure, I will create a task assigned to myself.

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
  **  Visit us at ESC Silicon Valley <http://www.embedded.com/esc/sv> **
  **  April 3-5 2007, Booth 1922, San Jose McEnery Convention Center  **
------["The best things in life aren't things."]------      Opinions==mine




reply via email to

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