Re: [patch #6253] Added csum to struct pbuf.
Andrey Volkov <avolkov <at> varma-el.com>
2007-11-01 12:48:29 GMT
Frédéric Bernon wrote:
> Follow-up Comment #2, patch #6253 (project lwip):
>> Is HWD_SUPPORT_CSUM will be appropriate?
> CHECKSUM_HARDWARE_SUPPORT (to be in the same spirit than other
> CHECKSUM_xxx) ?
> Do you have read "task #6849 : Test how checksum on copy could be
> integrated into the stack" (https://savannah.nongnu.org/task/?6849) ?
Yes, but I introduce this field mainly for next purposes:
1) speed up reassembly of incoming ip packets. In reassembly case,
ip payload csum of each fragment should be stored somewhere.
(IMHO, pbuf is very appropriate for it).
2) Hardware usually could calculate ip payload/headers checksum,
but not tcp/udp pseudo checksum, hence ip csum should be stored.
Also, I dislike to mix different levels of stack in one piece
of code. I.e. if I've ip checksum in eth driver, I could undef
CHECKSUM_CHECK_IP, but not CHECKSUM_CHECK_TCP/CHECKSUM_CHECK_UDP,
since I don't know it in driver level.
3) In my hwd. driver, I don't 'memcpy' incoming packets, DMA do it
directly to pbuf.