Clear and reinitialize the HAL state in our softc when we resume. While it
may be ok to keep the state around during a normal suspend/resume, it is
questionable to do so for unhibernate, where the hardware has been
fully reset. This fixes hangs when trying to bring down the interface
(including when we do so for a suspend or reboot) after an unhibernate.
ok stsp@
Don't starve nowait failures behind a large queue of pmr requests.
1.126 replaced ths flag used to indicate that a nowait allocation
had failed with a static to be addded to the list for the page
daemon to process in this case. ensuring the check is done with a lock
instead of fiddling with a volatile.. ok fine.
Unlike the previous flag, which was considered before processing the list,
the static was added to to the tail of the list, therefore adding it behind a
potentially large queue of pmr requests - which was already known
to be a problem in version 1.107 as witnessed by this commit message:
" Make sure low pages are deactivated first when there is a shortage of inactive
pages. Without this the system can have a ton of high pages on the active list
and never swapout anything if there's a shortage of low pages."
The previous flag could also have been set repeatedly by multipled nowait failures so
repeated failures would always push the pagedaemon down this path instead of
processing the list. This change also ensured that only one such "nowait" request
[19 lines not shown]
Introduce OF_is_enabled(), a helper function to figure out whether the
device tree node is available to use or not. So far we have done this
manually by explicitly checking for "disabled". Nowadays though there's
also "reserved" for devices that are there but shouldn't be touched, and
at some point we might need to handle "fail", too. We can't just check
for "okay" as some device trees only have "ok" or not even a status
property, which we should treat as "okay".
ok kettenis@
Only advertise HWCAP2_SVE2 (and other SVE features) if SVE is actually
supprted. The SVEver field in ID_AA64ZFR0_EL1 is also for streaming SVE
mode, which is also known as SME. An Apple decided to implement SME but
not SVE on their M4 CPU cores. So do what Linux does and only set these
if HWCAP_SVE is set.
ok jca@, patrick@, kurt@
announce PMF support only if the access point supports PMF
Fixes association to buggy access points which will not initiate WPA with
us if the PMF-capable bit is set in our assoc requests.
Problem reported by mvs@
update ieee80211_classify to RFC8325 and rate-limit high-prio QoS packets
The previous implementation based on RFC2474 did not rate-limit high-prio
packets and had no high-prio mapping for DSCP_EF, which is used by ssh(1).
The goal of this change is to send DSCP_EF with high QoS priority at the
wifi layer, without allowing misbehaving applications to send too many
such packets at once.
Access points usually send a beacon every 100ms, and everything else must
happen in-between beacons. Which means, with 2ms per Tx op, a channel will
start becoming completely blocked if an application can grab about 50 VO Tx
opportunities per beacon.
To balance this with typing latency, we need to consider that users are
typing comfortably at a latency between 20-200ms.
Based on this, let's aim for roughly 50ms typing latency. Which means we
want to allow up to 2 VO Tx OPs per 100ms. Beyond this threshold we mark
[3 lines not shown]
Stop doing `if_timer' modifications. We don't set `if_watchdog' handler
so the watchdog timeout is not used. However, `if_timer' is prtected with
kernel lock and this makes upcoming genet_start() unlocking useless.
If someone want to implement watchdog for bse(4), it should be done in
mp-safe way, may be with preceding if_slowtimo reworking.
No objections from kettenis.
Do not check ifp->if_flags and ifq_is_oactive() within genet_start().
Our caller, the interface queues layer, already did this.
No objections from kettenis.
initialize TIDs 4-7 for net80211 TX aggregation
802.11 QoS has 8 user priorities, of which we only use 4 in our current
mapping from EDCA categories to Tx aggregation queues. We will soon update
this mapping for better QoS behaviour and use Tx aggregation on TIDs 4-7.
ok phessler@
refactor the matching of sk->sk_states entries in pf_find_state()
ive been looking at and trying to comprehend this code for what
feels like months of my life, and the af-to handling in particular.
it wasn't until i found the PF_AFRT handling in pf_test that it
suddenly clicked.
i figure it doesnt hurt to pull the code here apart a bit and put
some comments in place to help future travellers.
ok sashan@
Do not force the page daemon to sleep when there are outstanding paging requests.
This partially reverts the changes made in rev 1.131
Currently, this serializes the processing of pmr requests when
scheduling pageouts into only processing one pmr request. while there
appears to be a desire not to "over swap" this also I believe means
we can "under swap" if we can not schedule enough pageouts to
satisfy this request, at which point I believe we can miss wakeups
under load - especially if the pmr request can not be satisfied
and remains on the list.
I think the intent here can be achieved, but not without some
careful rework first. The current method of only waking up one
sleeper on any pmr request is very different from how this
code worked in the past and very different from the rest of the
kernel, where processes compete for freed resources to progress
the entire system forward. Serializing only one pmr requestor
to be woken up after every round of potentally sceheduling a bunch
[7 lines not shown]
Revert the change made in rev 1.126 of uvm_pdaemon.c
While the commit message was
"Do not try to release memory if all we need is balancing the page lists."
This is not what this actually did. It also removed the minumum amount of
pages that the page daemon would attempt to free, and most importantly,
it would make the page daemon potentially go back to sleep when woken
wihtout waking the sleepers that went to sleep waiting for it to free
memory and wake them up.
Since *someone* probably went to sleep when waking the page daemon, and
today we have no idea if that sleeper's request could have been satisfied
by the page daemon's free page reserve (as we have no idea how fragmented
the free pages are, or where they are in memory) this is currently dangerous.
While the "hack" of freeing up 16 pages every time it is woken is indeed
a hack, it does mean that something that is failing to allocate will force
[17 lines not shown]
rewrite SOCKS4/4A/5 parsing code to use sshbuf functions instead
of manual pointer fiddling. Should make the code safer and easier
to read. feedback/ok markus@
i2c_ASN1_BIT_STRING() vs ASN1_STRING_FLAG_BITS_LEFT
A nasty quirk in the bit string handling is that the serialization
produced by i2d_ASN1_BIT_STRING() depends on whether the the magic
ASN1_STRING_FLAG_BITS_LEFT is set.
If ASN1_STRING_FLAG_BITS_LEFT is set, the number of unused bits is
carried in a->flags & 0x07 and the remainder of the bit string is
in a->data. This is terrible and undocumented but handled correctly.
If ASN1_STRING_FLAG_BITS_LEFT is not set, all trailing zero bits are
(intended to be) chopped off with all sorts of hilarious side effects.
I broke this quite thoroughly when I incorrectly ported an overflow
check from BoringSSL in:
https://github.com/openbsd/src/commit/f81cc285d2aed8b36615119a306533696f3eb66c
The result is that we currently return ret = a->length + 1 for both NULL
and non-NULL pp. The calls to asn1_ex_i2c() in asn1_i2d_ex_primitive()
thus report consistent lengths back, making it succeed.
[21 lines not shown]
asn1basic: add example showing current bogus encoding
There is a bug in i2c_ASN1_BIT_STRING() resulting in nonsense encoding of
some BIT STRINGs with trailing zeroes if ASN1_STRING_FLAG_BITS_LEFT is not
set (a rare corner case). This test currently passes when it shouldn't.
i2c_ASN1_BIT_STRING(): zap nonsensical comment
The /* should not happen */ happens if a->data is all zeroes (where
there used to be an OOB access a few years back), which is a legitimate
BIT STRING, so this is just nonsense.
ok jsing kenjiro