summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2022-02-08 11:55:20 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2022-02-08 11:55:20 +0000
commiteae3426ea2db8267e1b6f7eb39fc55ba47269a5d (patch)
tree0ed61e1088b6c3d9edcbfdf2e810ac1d99f0dacb /lib
parent6b430579ca865f4bbd1db0992675be1931f0f639 (diff)
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@
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions