lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #10111] [RFC] Hardware checksum offloading


From: Simon Kuenzer
Subject: [lwip-devel] [patch #10111] [RFC] Hardware checksum offloading
Date: Sat, 25 Sep 2021 18:42:05 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0

URL:
  <https://savannah.nongnu.org/patch/?10111>

                 Summary: [RFC] Hardware checksum offloading
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: skuenzer
            Submitted on: Sat 25 Sep 2021 10:42:04 PM UTC
                Category: TCP
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

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
<https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-2070002>.

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. 

I wasn't actually sure to which branch I should send you this contribution. I
selected the STABLE-2_1_x branch because we tested the feature with this
branch with our Unikraft project <https://github.com/unikraft/>. We run lwIP
directly on top of virtual network cards, like netfront (Xen) and virtio-net
(KVM/QEMU).

As outlook: The introduced pbuf fields are even interesting for us for the
receiving side: In virtual environments you can receive traffic from physical
networks and from other virtual machines running on the same host. In the
latter case, the checksum computation might be still incomplete and we should
not drop the packet. The virtio standard
<https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-2140004>
(but also Xen netfront does this) introduces another flag that indicates if
the checksum for a packet was already checked. This could been done by a
physical network card that originally received the packet. In such a scenario
you would also be able to skip checking in lwIP.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 25 Sep 2021 10:42:04 PM UTC  Name:
0001-pbuf-Introduce-PBUF_FLAG_CSUM_PARTIAL.patch  Size: 4KiB   By: skuenzer

<http://savannah.nongnu.org/patch/download.php?file_id=51964>
-------------------------------------------------------
Date: Sat 25 Sep 2021 10:42:04 PM UTC  Name:
0002-inet_chksum-Partial-checksums.patch  Size: 6KiB   By: skuenzer

<http://savannah.nongnu.org/patch/download.php?file_id=51965>
-------------------------------------------------------
Date: Sat 25 Sep 2021 10:42:04 PM UTC  Name:
0003-tcp_out-Partial-checksumming.patch  Size: 7KiB   By: skuenzer

<http://savannah.nongnu.org/patch/download.php?file_id=51966>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?10111>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

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