This was the list where PCBs were temporary linked to avoid sleep with
`inpt_mtx' mutex(9) held. in_pcbnotifyall() and in6_pcbnotify are the
last list users, so switch them to in_pcb_iterator() too, moreover they
already do in_pcb_is_iterator() check.
Note, in_pcb_iterator() does necessary reference couter handling,
unlocked `inp' dereference is safe.
ok bluhm
virtio 1.x requires that all queue setup, including the queue interrupt
vector, is done before setting the queue_enable register to 1. This
conflicts with how we do things right now:
* We implicitly make queue setup in virtio_alloc_vq(), which is called
from the child driver attach functions. This also sets queue_enable=1.
* Later, we allocate the interrupts and set the queue interrupt vectors
in the second half of the virtio transport attach functions.
This is a violation of a MUST from the standard and causes problems with
some hypervisors, in particular those that have no virtio 0.9 support,
which has no such ordering requirements.
To fix this:
* Move the interrupt allocation to a new virtio_attach_finish() function.
This does all queue setup, including the interrupt vectors.
* Don't call virtio_setup_queue() in virtio_alloc_vq() anymore.
* We can also move the setting of the DRIVER_OK flag into this function.
virtio_attach_finish() must be called before using any virtqueue or
writing any virtio config register.
While there,
* also streamline the attach error handling in all drivers.
* skip initially setting sc_config_change to NULL, the softc is
initialized to 0.
ok jan@
tested by bluhm@
In tcp_mss_adv() max(9) was used to guarantee that mss it not too
small. Unfortunately max() uses u_int and mss could get negative
in some error conditions.
Rearrange the code to directly return in case of errors. Also read
tcp_mssdflt only once to head towards atomic integer sysctl.
OK mvs@
. uvm_pagewait(): do not require an exclusive lock to release it & sleep
. uvm_page{de,}activate(): lists updates are serialized by the `pageqlock' mutex
More assertions could be relaxed but only those 3 are necessary for running
the lower fault handler in parrallel.
ok miod@
Only unlock soreceive() path, somove() path still locked exclusively. Also
exclusive socket lock will be taken in the soreceive() path each time
before pru_rcvd() call.
Note, both socket and `sb_mtx' locks are held while SS_CANTRCVMORE
modified, so socket lock is enough to check it in the protocol input
path.
ok bluhm
This is the statistics implemented with per-CPU counters and the
`carp_opts' array of atomically accessed integers.
Replace the `carp_opts' array with individual `carpctl_*' variables
and use sysctl_bounded_arr() instead of sysctl_int(). Keep current
`carpctl_*' variables bounds as is, they would be adjusted with
separate diff.
ok bluhm
This should not have any functional difference on existing setups, as
so far any time this function would have been used, it would have led
to a kernel panic as it's been a NULL pointer.
This fixes bootup on the MNT Reform2 with the RK3588 module.
ok kettenis@
i've had a couple of reports of redundant firewalls misbehaving
since these changes, so until i can figure out what's wrong i'm
backing them out.
reported by hrvoje popovski and mark patruck
802.1ax says that LLDP packets sent to the multicast groups listed
in 802.1ab (the lldp spec) should be treated as "control frames"
so they can be processed by an lldp agent on physical interface.
in our situation that means we shouldn't aggregate LLDP packets so
they appear to enter the system on aggr(4) interfaces, we should
let the physical port interfaces handle them. this will allow
AF_FRAME sockets listening on aggr port interfaces receive lldp
packets.
jmatthew@ says it looks good.
Replace selinfo data with klist. Introduce `sc_mtx' mutex(9) to protect
`sc_frames_data' and `sc_rklist'.
Additionally tested by Laurence Tratt.
ok kirill mglocker
this allows userland to use sockets to send and receive Ethernet
frames. as per the upcoming frame.4 man page:
frame protocol family sockets are designed as an alternative to bpf(4)
for handling low data and packet rate communication protocols. Rather
than filtering every frame entering the system before the network stack
like bpf(4), the frame protocol family processing avoids this overhead by
running after the built in protocol handlers in the kernel. For this
reason, it is not possible to handle IPv4 or IPv6 packets with frame
protocol sockets because the kernel network stack consumes them before
the receive handling for frame sockets is run.
if you've used udp sockets then these should feel much the same.
my main motivation is to implement an lldp agent in userland, but
without having to have bpf look at every packet when lldp happens
every minute or two.
the only feedback i had was positive, so i'm putting it in
ok claudio@
This quirk was introduced as a workaround, not the fix for the real
issue. The root cause was fixed in the previous commit (v1.227) to
uvide.c with skip uvideo_vs_set_alt for bulk endpoint.
OK mglocker@ kn@
pfsync doesnt know the source address in IP packets before it calls
ip_output, so the extra bpf attachment has a distorted view of what
IP packets are being sent anyway. you can tcpdump on the pfsync
syncdev if you want to see what will be on the wire.
Some firmware phy types are not being mapped to ifmedia yet.
Print a message when this happens since the driver might not
work without a known media type.
The real fix will be to get missing media types mapped properly.