OpenBSD cvs log

created 2022-02-12T20:21:58Z
begin 2022-02-08T00:00:00Z
end 2022-02-09T00:00:00Z
path src/sys
commits 11

date 2022-02-08T03:38:00Z
author dlg
files src/sys/dev/pci/if_ix.c log diff annotate
src/sys/dev/pci/ixgbe.h log diff annotate
message rework checksum/vlan offloading, and enable it for ipv6 too.

this is based on work by jan@ and bluhm@. the most interesting
change on top of their work is to move the parsing of the IP packets
to figure out ip and udp/tcp offsets 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.

we got away with this before because we were lucky with the code
that's generated on strict alignment archs for looking at the ip
hl and proto fields. that luck might run out though.

while here i've also tweaked the vlan handling code, and generally
tried to make it more readable.

ok bluhm@ jmatthew@

date 2022-02-08T08:56:41Z
author visa
files src/sys/kern/kern_event.c log diff annotate
src/sys/kern/sys_generic.c log diff annotate
src/sys/sys/event.h log diff annotate
src/sys/sys/eventvar.h log diff annotate
message poll(2): Switch to kqueue backend

Implement the poll(2) system call on top of the kqueue subsystem.
This obsoletes the old, non-MP-safe poll backend.

On entering poll(2), the new code translates each pollfd array entry
into a set of knotes. When these knotes receive events through kqueue,
the events are translated back to pollfd format.

Entries in the pollfd array can refer to the same file descriptor with
overlapping event masks. To allow such overlap with knotes, use an extra
kn_pollid key that separates knotes of different pollfd entries.

Adapted from DragonFly BSD, initial implementation by mpi@.

Tested in snaps for three weeks.

OK mpi@

date 2022-02-08T09:41:04Z
author jsg
files src/sys/dev/fdt/mvkpcie.c log diff annotate
message fix off by one in bounds test
ok miod@ kettenis@

date 2022-02-08T11:28:19Z
author dlg
files src/sys/kern/uipc_mbuf.c log diff annotate
message use sizeof(long) - 1 in m_pullup to determine payload alignment.

this makes it consistent with the rest of the network stack when
determining alignment.

ok bluhm@

date 2022-02-08T11:55:19Z
author dlg
files src/sys/dev/pci/if_ixl.c log diff annotate
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@

date 2022-02-08T14:24:36Z
author stsp
files src/sys/dev/pci/if_iwm.c log diff annotate
message Fix a KASSERT in iwm(4) being triggered for the wrong reason.

iwm_wakeup() must initialize the task reference counter only if
resuming the device succeeds. Otherwise, the newstate task will
not be scheduled and hence the ref counter must remain at zero.

Problem observed by + ok kettenis@

date 2022-02-08T17:25:10Z
author deraadt
files src/sys/arch/amd64/amd64/acpi_machdep.c log diff annotate
message The suspend/resume code is a sticky mess of MI, MD, and ACPI sequencing.
This splits out the MI sequencing, backing it with per-architecture helper
functions. Further steps will be neccesary because ACPI and MD are too
tightly coupled, but soon we'll be able to use this code for more architectures
(which depends on figuring out the lowest-level cpu sleeping method)
ok kettenis

date 2022-02-08T17:25:11Z
author deraadt
files src/sys/arch/amd64/conf/GENERIC log diff annotate
src/sys/arch/arm64/arm64/acpi_machdep.c log diff annotate
src/sys/arch/i386/conf/GENERIC log diff annotate
src/sys/arch/i386/i386/acpi_machdep.c log diff annotate
src/sys/conf/files log diff annotate
message The suspend/resume code is a sticky mess of MI, MD, and ACPI sequencing.
This splits out the MI sequencing, backing it with per-architecture helper
functions. Further steps will be neccesary because ACPI and MD are too
tightly coupled, but soon we'll be able to use this code for more architectures
(which depends on figuring out the lowest-level cpu sleeping method)
ok kettenis

date 2022-02-08T17:25:12Z
author deraadt
files src/sys/dev/acpi/acpi.c log diff annotate
src/sys/dev/acpi/acpibtn.c log diff annotate
src/sys/dev/acpi/acpisony.c log diff annotate
src/sys/dev/acpi/acpithinkpad.c log diff annotate
src/sys/dev/acpi/acpitoshiba.c log diff annotate
src/sys/dev/acpi/acpivar.h log diff annotate
src/sys/kern/subr_suspend.c log diff annotate
src/sys/sys/device.h log diff annotate
message The suspend/resume code is a sticky mess of MI, MD, and ACPI sequencing.
This splits out the MI sequencing, backing it with per-architecture helper
functions. Further steps will be neccesary because ACPI and MD are too
tightly coupled, but soon we'll be able to use this code for more architectures
(which depends on figuring out the lowest-level cpu sleeping method)
ok kettenis

date 2022-02-08T18:08:33Z
author deraadt
files src/sys/net/pf.c log diff annotate
message Do not /0 if timeout[PFTM_INTERVAL] manages to become zero
crash noticed by gnezdo, a seperate commit will fix the identified
cause, but being careful at this point is a good idea.
ok sashan

date 2022-02-08T23:19:47Z
author deraadt
files src/sys/arch/arm64/arm64/acpi_machdep.c log diff annotate
message oops, a typo snuck in