tcp bbr: improve handling of retransmissions in LAST-ACK
When performing a timer based retransmission, clear the
BBR_RWND_COLLAPSED flag. If it sticks, t_rxtshift is never incremented
resulting in unlimited retransmissions in the LAST-ACK state.
Reported by: Illia Vynohradov
Reviewed by: Peter Lei
MFC after: 3 days
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61586
asmc: make asmc_sysctl_add_system() void
Its only caller already discarded the return value with (void). Match
the other sysctl subtree builders.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D61537
asmc: do not report absent sensors as a temperature
A key can exist for a sensor the model was never built with; the SMC
answers those with a fixed sentinel instead of an error. Return ENXIO
for the sentinel instead of publishing it as a reading.
MFC after: 3 days
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D61489
asmc: report temperatures in deciKelvin
The handler returned the raw key's high byte, dropping the sign and
fraction of the sp78 encoding, and published -1 on a failed read.
Read through asmc_sensor_read() instead, convert to deciKelvin, and
register the leaves as "IK". Changes the unit of dev.asmc.N.temp.*.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61487
asmc.4: fix the unterminated SYNOPSIS and FILES blocks
The SYNOPSIS .Bd and the FILES .Bl were both left open, producing two
mandoc block-nesting errors. Reduce SYNOPSIS to the .Cd line man4
style calls for, and close the FILES list.
MFC after: 3 days
Reviewed by: ziaee, ngie
Differential Revision: https://reviews.freebsd.org/D61486
asmc: propagate sysctl read and write errors
Several handlers discarded the key transport's result: fan speed, SMS
and ambient light handlers published a value regardless of read
success; a rejected fan speed or keyboard backlight write reported success;
fan id returned EPERM on an unreadable key instead of ENXIO.
asmc_fan_getvalue()/asmc_fan_setvalue() now return the error and pass
the speed out by reference instead of returning -1 for failure.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61485
asmc: register the fan id sysctl with a string format
Every fan sysctl was registered with a hardcoded "I" format, but id
is CTLTYPE_STRING. Carry the format in the table instead.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61484
asmc: clear the sensor counts in detach
The key arrays are freed but the counts were left set, leaving the
softc describing freed memory. Reachable via the attach error path,
which calls detach directly.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61483
asmc: do not drop shutdown notification when the system node fails
asmc_attach() registered the MBSS shutdown-cause handler
(EVENTHANDLER_REGISTER(shutdown_pre_sync, asmc_shutdown, ...))
after attempting to add the dev.asmc.N.system sysctl subtree. If that
subtree registration failed, the error path took goto nosms, jumping clean
over the shutdown-handler registration. On T2 Macs this silently drops
the only thing standing between a clean shutdown and bridgeOS's
watchdog power-cycling the machine.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61482
asmc: remove the unused sc_dev softc field
It was never assigned or read. legacy code.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61481
asmc: print the last field of the SMC revision correctly
Use be16dec() at the correct offset instead of an unaligned,
off-by-two-bytes read through a cast pointer.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61479
asmc: restore SMC state across suspend/resume
Reinit the SMS interrupt mask, motion thresholds, and shock window on
resume. Guard the backlight rewrite on sc_has_light. Add
device_suspend to release manual fan control before sleep and restore
it on resume.
MFC after: 3 days
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D61478
tcp bbr: improve persits timeout computation
t_srtt and t_rttvar use different lengths of fractions, therefore use
the appropriate shift value.
Reviewed by: Peter Lei
MFC after: 3 days
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61600
Merge commit 72a20b8e2987 from llvm git (by Gabriel Baraldi):
[SLPVectorizer] Check std::optional coming out of getPointersDiff (#175784)
Fixes https://github.com/llvm/llvm-project/issues/175768
There are other unchecked uses std::optional in this pass but I couldn't
figure out a test that triggers them
This fixes a clang crash in the SLP vectorizer, hit when building
audio/csound on powerpc64le. The hardened libc++ traps on the disengaged
optional, so clang dies with exit code 133. The second hunk is adapted to
llvm 21, where analyzeConstantStrideCandidate() is still isStridedLoad().
Reviewed by: dim
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D61354
(cherry picked from commit e56090afb68b6c036d6b54c7b66d762d98bd96d0)
tcp bbr: improve retransmit timout calculation
The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.
Reviewed by: Peter Lei
MFC after: 3 days
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61581
tcp bbr: improve invalidating rtt
Invalidate the rtt based on t_rxtshift instead of resetting t_srtt to 0,
because using the latter also affects the retransmission timeout.
Reviewed by: Peter Lei
MFC after: Netflix, Inc.
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61585
tcp bbr: improve retransmit timout calculation
The retransmission timeout should the srtt + 4 * rttvar.
The srtt is using 5 bits of fractions and rttvar is using 4 bits of
fractions, some specific shifting is required.
Reviewed by: Peter Lei
MFC after: 3 days
MFC to: stable/15
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D61586
if_bridge: Use bridge's FIB for incoming unicasts
A unicast frame for the bridge is handed to the stack with rcvif set
to the bridge, but it kept the FIB of the member it arrived on. With
the bridge in another FIB, replies were looked up in the wrong routing
table and dropped.
Set the FIB of the bridge on such frames. If member_ifaddrs is
enabled and the bridge inherited its MAC address from a member, keep
the old behaviour, since the frame may be for an address configured on
that member.
Reviewed by: zlei
Differential Revision: https://reviews.freebsd.org/D61517
ubldr: Pass the whole loaderdev name to disk_parsedev()
p - 4 is one byte before the string for 3-letter types, so whether
loaderdev=mmc0p2 parsed depended on that byte. disk_parsedev() now skips any
name prefix itself.
Reported by: llm-postcr
Reviewed by: imp
Approved by: imp
Fixes: d18ed8e19c3c ("stand: Try to parse vdisk correctly")
Sponsored by: Netfix
Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/105
loader.efi: Clear the zstd stream pointer in zstd_fini()
do_download_ramdisk() calls decomp_fini() a second time to free the buffer when
it gives up after a finished download, so zstd freed its strem twice and libsa
libsa panicked. Clear the pointer like xz_fini().
Reported by: llm-postcr
Reviewed by: imp
Approved by: imp
Fixes: afee781523e4 ("loader.efi: Recognize new memdisk=<url> and memcd=<url> options")
Sponsored by: Netflix
sysconf: Add ucl and pkg targets
ucl reads and rewrites Universal Configuration Language files with
libucl(3), the private library pkg(8) links, so what sysconf reads is
what pkg reads. Each file is parsed on its own and every scalar is
addressed by its dotted path (FreeBSD-ports.enabled); the last file
to define a path is authoritative. A write changes only the one
statement, in the file's own separator, terminator, quoting, and
boolean style, then re-parses the result with libucl and refuses the
write unless the parsed contents differ in exactly the requested key.
Removing the last key of an object removes the object.
Arrays are leaves, read back as compact JSON. name+=word and
name-=word on an array add and strike elements. Under an array a
path component is an index, as uclcmd(1) spells it: name.i reaches
one element (name.i=value sets it, name.i+=word edits it, -x name.i
strikes it), name.i.j reaches into a nested array, and name.# is the
count (name.#=value appends). A negative index counts from the end.
Under an object the same component is a key, so a key named 404 or #
[21 lines not shown]
pci_dw: Honor the max-link-speed property
The root port reports in LNKCAP the highest link speed the core was
synthesized for, which can be more than the PHY behind it supports. On
the RK3568 pcie2x1 the root port advertises 8GT/s while the PHY only
does 5GT/s. The link stays at 2.5GT/s after the directed speed change.
Read max-link-speed from the device tree and write it to the Max Link
Speed field of LNKCAP and to the Target Link Speed field of LNKCTL2
before requesting the speed change. Nothing changes when the property
is absent.
Tested on a Quartz64 Model A with a Samsung 970 EVO Plus NVMe drive: the
link now trains at 5GT/s and the sequential throughput goes from 200MB/s
to 400MB/s.
Differential Revision: https://reviews.freebsd.org/D61014
mcommphy: Set the 10/100 TX delay of the YT8511
The TX clock delay of the YT8511 is split in two registers. The delay
used in gigabit mode is in the clock gating page and was already set
from the RGMII mode, but the one used in the 10/100 modes is in the next
page and was left at its reset value of 2ns. With a phy-mode that does
not ask for a TX delay in the PHY, the MAC provides it and the PHY adds
another 2ns in the 10/100 modes.
Set it like the gigabit one, like Linux does.
Tested on a Quartz64 Model A, gigabit and 100Mbit links.
Reviewed by: oh
Differential Revision: https://reviews.freebsd.org/D61015
top: implement pid highlighting
Implement PID highlighting. This can be activated by pressing
'L' and entering a PID to highlight. Highlighting can be cleared
by entering '+' as a PID to highlight. This feature is inspired by
the OpenBSD top, which uses 'P' key for that. We have to use 'L'
because 'P' is already used for toggling per-CPU statistics.
Reviewed by: kib
Obtained from: OpenBSD (partially)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61090