CVSROOT:        /cvs
Module name:    src
Changes by:     d...@cvs.openbsd.org    2022/02/08 04:55:19

Modified files:
        sys/dev/pci    : if_ixl.c 

Log message:
bring back IPv4, TCP4/6 and UDP4/6 checksum offloading.

this was first introduced in r1.176 by jan@. this diff includes two
fixes to that implementation.

the most important one is to parse the ip and tcp headers before a
possible call to m_defrag. if an l4 offload is requested, it's only
requested by the stack when the payload is correctly aligned and
with each header contiguous in memory. this means you can use
m_getptr and cast the packet data to the relevant headers to read
them directly because that's what the stack does when it's working
on them. this makes it cheap to work on them too.

however, if you m_defrag, it ignores the alignment and ends up
making it unsafe to dereference the ip and tcp/udp payloads on
strict alignment architectures. if we want to look at the headers
after m_defrag, we'd likely have to copy them onto the stack first.

the other fix is to reset the offload bits between packets in the
loop in ixl_start.

another difference is that this code skips parsing the packet if
no checksum offload is requested.

tests and a tweak by bluhm@ to actually use the offloading
tested by me on sparc64 and x86 boxes

ok bluhm@ jmatthew@

Reply via email to