OpenBSD cvs log

created 2021-01-05T15:12:06Z
begin 2020-12-26T00:00:00Z
end 2020-12-27T00:00:00Z
path src/sys
commits 9

date 2020-12-26T03:45:57Z
author cheloha
files src/sys/dev/sdmmc/sdmmc_io.c log diff annotate
message sdmmc(4): sdmmc_io_function_enable(): don't sleep on lbolt

Just sleep for 1 second on the nowake channel instead.

With input from kettenis@, mpi@, and claudio@.

ok kettenis@

date 2020-12-26T11:06:52Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message better manage the lifetime of the dmamem used for various rings.

ok jmatthew@

date 2020-12-26T11:31:42Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message sprinkle some bus_dmamap_syncs around the sq.

ok jmatthew@

date 2020-12-26T11:40:44Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message sprinkle some bus_dmamap_syncs around the cq handling.

ok jmatthew@

date 2020-12-26T11:49:43Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message add some bus_dmamap_syncs around the rq.

ok jmatthew@

date 2020-12-26T11:59:18Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message add bus_dmamap_sync ops around the eq.

ok jmatthew@

date 2020-12-26T12:26:01Z
author dlg
files src/sys/dev/pci/if_mcx.c log diff annotate
message reuse the calculated vector as the argument to pci_intr_map_msix.

doing the maths again feels error prone.

date 2020-12-26T14:26:48Z
author visa
files src/sys/kern/sys_generic.c log diff annotate
message Simplify parameters of pselregister().

OK mpi@

date 2020-12-26T16:30:58Z
author cheloha
files src/sys/net/bpf.c log diff annotate
src/sys/net/bpfdesc.h log diff annotate
message bpf(4): bpf_d struct: replace bd_rdStart member with bd_nreaders member

bd_rdStart is strange. It nominally represents the start of a read(2)
on a given bpf(4) descriptor, but there are several problems with it:

1. If there are multiple readers, the bd_rdStart is not set by subsequent
readers, so their timeout is screwed up. The read timeout should really
be tracked on a per-thread basis in bpfread().

2. We set bd_rdStart for poll(2), select(2), and kevent(2), even though
that makes no sense. We should not be setting bd_rdStart in bpfpoll()
or bpfkqfilter().

3. bd_rdStart is buggy. If ticks is 0 when the read starts then
bpf_catchpacket() won't wake up the reader. This is a problem
inherent to the design of bd_rdStart: it serves as both a boolean
and a scalar value, even though 0 is a valid value in the scalar
range.

So let's replace it with a better struct member. "bd_nreaders" is a
count of threads sleeping in bpfread(). It is incremented before a
thread goes to sleep in bpfread() and decremented when a thread wakes
up. If bd_nreaders is greater than zero when we reach bpf_catchpacket()
and fbuf is non-NULL we wake up all readers.

The read timeout, if any, is now tracked locally by the thread in
bpfread().

Unlike bd_rdStart, bpfpoll() and bpfkqfilter() don't touch
bd_nreaders.

Prompted by mpi@. Basic idea from dlg@. Lots of input from dlg@.

Tested by dlg@ with tcpdump(8) (blocking read) and flow-collector
(https://github.com/eait-itig/flow-collector, non-blocking read).

ok dlg@