|
From: | Sakhuja, Nitin |
Subject: | Re: [lwip-users] TCP/UDP checksum offload in hardware |
Date: | Wed, 30 Mar 2022 15:58:09 +0000 |
While searching the lwIP developer archives on this topic, I came across the following: https://lists.nongnu.org/archive/html/lwip-devel/2021-09/msg00036.html Quoted from the above thread: These patches implement the capability to offload checksum computation to
modern network cards. For each pbuf the stack can point to a checksum field
that should be computed and filled by the device. Expensive checksumming of
payload bytes can be offloaded which means that this feature is intended for
checksums of transport protocols only (like TCP, UDP). This is inline with
todays standards, like you find with virtio-net
As initial implementation, I have it done for TCP, specifically for segments and control packets that are sent. For this purpose, lwip will compute a partial checksum of only the pseudo header. Starting with this partial checksum, the hardware will continue computing the final 16bit ones’ complement over the payload. In principle, UDP can be added, too, but I think it makes sense to have discussed the basic infrastructure first… I am open for comments. Maybe you have a better name suggestion for the checksum functions introduced with patch 2.
Best Regards -Nitin From: Sakhuja, Nitin Hello All, From my understanding, lwIP supports an all-or-none approach for checksum generation in software vs hardware i.e. either the complete TCP/UDP checksum is generated in software or it is fully offloaded to hardware. However there are platforms that support partial checksum offload where-in software is required to first generate the IP pseudo-header checksum. The packet with this partial checksum is sent to hardware which
then checksums the rest of the L4 payload. This may require the following support to be added in lwIP:
Is the above understanding correct and has anyone explored the option of partial checksum generation? Best regards -Nitin |
[Prev in Thread] | Current Thread | [Next in Thread] |