lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #6253] Added csum to struct pbuf.


From: Jonathan Larmour
Subject: [lwip-devel] [patch #6253] Added csum to struct pbuf.
Date: Wed, 31 Oct 2007 19:56:20 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070530 Fedora/1.5.0.12-1.fc5 Firefox/1.5.0.12

Follow-up Comment #3, patch #6253 (project lwip):

struct pbuf is very good right now for being exactly 32 bytes, which is very
amenable to keeping pbuf buffer pools aligned on hardware that supports DMA -
usually there are alignment constraints, particularly if caching is also
involved, in which case you have to keep packet data and other data (including
struct pbuf itself) in different cache lines. Now this isn't something which
is very easy in lwIP at the moment, but only because it's been deliberately
postponed until after 1.3. I think there's a task for it somewhere. But I have
made my own modifications in my source base, and when the time comes after
1.3, I was going to raise the issue.

So increasing its size should be avoided if at all possible. Even an option
isn't so good - some hardware has hardware-assisted checksum computation, and
devices like that would probably support DMA too.

But I think there are further issues that make such a change difficult - this
causes every pbuf that is to be sent to be increased too. And every pbuf in a
pbuf chain, when there only need be one per whole packet.

There are other possibilities, but the one that occurs to me most is to
include the checksum in the pbuf contents somewhere, either the start or end.
This fact could be indicated by a pbuf flag (or two, if you want to allow
choice of start or end).

There may well be other solutions, particularly if you consider the
possibility of reducing u16_t ref to a u8_t.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6253>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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