FreeBSD git weekly: 2026-07-13 to 2026-07-19

Introduction

This is a display of mostly-automatically-classified git commits from 2026-07-13 to 2026-07-19.

Table of contents and commits per category:

(1) Highlighted commits (these are copies, not in stats)
4 3.0% Userland programs
5 3.7% Documentation
40 29.9% Hardware support
8 6.0% Networking
11 8.2% System administration
8 6.0% Libraries
1 0.7% Filesystems
41 30.6% Kernel
6 4.5% Build system
1 0.7% Internal organizational stuff
3 2.2% Testing
1 0.7% Style, typos, and comments
0 0.0% Contrib code
5 3.7% Reverted commits
0 0.0% Unclassified commits
134 100% total
Technical notes about this page

Highlighted commits

For extra visibility, these are copies of commits found in other sections. Most (if not all) come from the commit message containing "Relnotes:", or commits modifying UPDATING.

bhyve: add configurable SMBIOS OEM Strings
Add the option "oemstring" to allow setting the DMI type 11 ("OEM
Strings") SMBIOS structure. These are free-form strings, available for
any purpose, but can be especially useful to pass configuration,
secrets, and credential information into a Linux guest and consumed by
systemd.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57516
cbd442efe85d9ae371581565670dfc0287afbf8e John De Boskey 2026-07-18 21:39:33

Userland programs

Commits about commands found in man section 1 (other than networking).

tail: Allow repetitive or contraditory options
Unlike its GNU counterpart, our tail(1) has always errored out if given
repetitive or contradictory options, even prior to Keith Bostic's 1991
reimplementation.  There is no good reason to continue to do so, not
even tradition, since many other commands (including head(1)) simply
apply the rightmost option in cases like this.

MFC after:      1 week
Reviewed by:    allanjude, markj
Differential Revision:  https://reviews.freebsd.org/D58192
9fc14dbe4897c4541113b9ba98236fbd7eb75380 Dag-Erling Smørgrav 2026-07-13 06:42:40
fetch: Stop setting an alarm
Now that fetchTimeout works reliably, setting an alarm is not only no
longer necessary but counterproductive, as it will trigger even if the
connection is not actually stalled but merely slow.

While here, improve the wording of the manual page's description of the
various options for setting a timeout.

MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D57911
3dddfe29248c47d1a80dc96a76a308ae910b2a24 Dag-Erling Smørgrav 2026-07-13 06:43:46
mkimg: Add ms-basic-data alias for GPT
While preparing GPT-schemed RaspberryPi images for the NanoBSD
Reimagined GSoC 2026 project, a discrepancy was identified between
mkimg(1) and gpart(8) regarding Microsoft Basic Data partitions (GUID
!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7).

Currently, mkimg(1) relies on the MBR-centric name "ntfs" to identify
this partition type under the GPT scheme.  Conversely, gpart(8)
identifies this type as "ms-basic-data".

To allow automation scripts (such as those consuming from gpart backup)
to use a common partition type across tools, add ALIAS_MS_BASIC_DATA as
a valid alias.

This is part of a larger effort to avoid a custom, MBR-based image
generation logic for embedded SoCs like the Raspberry Pi, standardizing
on GPT layouts across all supported FreeBSD embedded devices.

Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58198
67f1c082b5ec37e2060b74e6f1f952ed38761468 Jose Luis Duran 2026-07-13 12:25:30
ministat: parse comma used as decimal delimiter
This allows to use output of '/usr/bin/time -ao foo' as direct input to
ministat(1).

While here make diagnostic message more verbose.
77a201b1705dbd97ea9ebe5b25b1d4ddac8a7d38 Gleb Smirnoff 2026-07-17 00:49:55

Documentation

Man pages, release notes, etc.

kqueue.2: document NOTE_PDSIGCHLD
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58123
4cd67a0eea4eba63cf50a45a4665d8700df8d188 Konstantin Belousov 2026-07-10 15:26:50
libfetch: Document fetchTimeout
Document the global fetchTimeout variable, now that it works reliably.

MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D57910
27b411734c75a7a5abe641d7fbb99dfc622e9aba Dag-Erling Smørgrav 2026-07-13 06:43:42
ptrace.2: Document PT_SET_SC_RET
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58247
f967dd04c880e9c9c68cd20de135d77b3ca1c26d Konstantin Belousov 2026-07-15 13:42:44
man: Fix RFC 1918 network prefix lengths
According to RFC 1918, the following IP prefixes are reserved for
private internets:

    10.0.0.0/8
    172.16.0.0/12
    192.168.0.0/16

This PR fixes the prefix lengths in references to private networks
("RFC 1918 networks", "the standard private IP address ranges").
The changes are limited to man pages.

Signed-off-by:  Yusuke Ichiki <public@yusuke.pub>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2328
MFC after:      3 days
1403ca10189c47ad1de3915eeb030deddc114685 Yusuke Ichiki 2026-07-17 14:58:42
kqueue.2: document EVFILT_PROCDESC support for NOTE_FORK
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58292
3f88f6b89942a7f3aa6bb682b02b7307d060b52f Konstantin Belousov 2026-07-17 05:38:57

Hardware support

Hardware drivers and architecture-specific code.

FDT: implement fdt_ether_get_addr()
Introduce fdt_ether_get_addr() in fdt_common.c/h that tries standard
DT properties in the correct order and falls back to a random address
when needed. This should be used by ethernet drivers instead of open-coding
the same logic.

MFC after:      2 weeks

Reviewed by:    mhorne, adrian, bz, jrtc27
Differential Revision:  https://reviews.freebsd.org/D58104
920518cf2e75012135104886d92814c048baa2fb Michal Meloun 2026-07-13 08:34:22
ena: Put taskqueues into correct domain if !RSS
When compiled without 'options RSS', the ena driver created taskqueues
using taskqueue_start_threads_cpuset passing a mask value of NULL,
both in the ena_setup_tx_resources path (for enqueues) and in the
ena_create_io_queues path (for the completion-processing).

In the default configuration, on most EC2 instances, this results in
taskqueues running in the right NUMA domain, but only by accident; in
non-default configurations (e.g. with with multiple EBS volumes
attached and associated NVMe taskqueues) the taskqueues may land in
the wrong NUMA domain even on instance types where the one-EBS-one-ENA
case produces the desired results.

Set (struct ena_que)->domain and use that to inform the choice of CPU
sets.  On a c8gn.48xlarge EC2 instance this doubles throughput on a
32-TCP-stream benchmark.

Reviewed by:    akiyano
MFC after:      7 days
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D57918
2e21f7e8140447c2dcbc964ff3482f12f9bd6683 Colin Percival 2026-06-27 23:33:46
mlx5ib: initialize DEVX subscription state before the eventfd fdget()
In the DEVX_SUBSCRIBE_EVENT handler the eventfd path can fail and
"goto err" before the subscription's xa keys and ev_file have been set;
they are still zeroed from kzalloc().  The cleanup then looks up a
level-1 xa entry with key 0, gets NULL, and faults dereferencing it.

Initialize the fields the cleanup path relies on right after the
subscription is allocated, before it is linked and before the fallible
fdget(), so a later failure unwinds cleanly.

Reviewed by: kib
Sponsored by: Nvidia networking
MFC after: 1 month
9c7629d69cebafba3eea6787d3bfc100d60c3b19 Ariel Ehrenberg 2026-06-15 08:16:30
mlx5ib: use the eventfd_ctx API for DEVX event subscriptions
The DEVX_SUBSCRIBE_EVENT redirect path resolved the user's eventfd with
fdget(), which on FreeBSD only finds LinuxKPI files.  rdma-core creates
the eventfd with the native FreeBSD eventfd(2), so the lookup failed and
subscription returned EBADF; the delivery side likewise assumed a
LinuxKPI-pollable file.

Use the LinuxKPI eventfd_ctx API instead: eventfd_ctx_fdget() resolves
the native eventfd, eventfd_signal() notifies it, and eventfd_ctx_put()
releases it.  DEVX async events can then be delivered through a redirect
eventfd.

Reviewed by: kib
Sponsored by: Nvidia networking
MFC after: 1 month
40cc9de950f7e6ba2049467fa05c46b9161f49a5 Ariel Ehrenberg 2026-06-15 08:27:56
snd_uaudio: Initialize mixer_lock with MTX_RECURSE
Fixes:                https://cgit.freebsd.org/src/commit/?id=fc9dc8482396 ("snd_uaudio: Lock usbd_transfer_start() in uaudio_mixer_ctl_set()")
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296682
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
954001a9dd363da9184706657eb34f9622bb220f Christos Margiolis 2026-07-11 12:57:35
Commit group #0: virtio
virtio: Add feature bit definitions up to VirtIO v1.3

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2319
f9a4dd60b0cf4ce920a83b125f81ee401fc471ce Faraz Vahedi 2026-07-09 20:00:07

virtio: Report feature masks on negotiation failure

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2319
5d0488b29dc5b3e8201d04cf7a015dce9e774d5d Faraz Vahedi 2026-07-09 20:01:20

virtio: Accept VIRTIO_F_RING_RESET in the modern PCI transport

Accept per-virtqueue reset when the device offers it, alongside
the V1 flag.  Negotiating the feature merely permits the use of
per-virtqueue reset and imposes no obligation on a driver that
never uses it, while refusing capability-only transport features
can make strict devices reject the feature set altogether.

No functional change on hosts that do not offer RING_RESET.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2319
8bdc312dac550c292c58a6a3243b08bc8c944b74 Faraz Vahedi 2026-07-09 20:01:44
acpi_cpu(4): Call ACPI_GET_FEATURES() on a reset 'features' variable
This is to prevent child drivers from using the features returned by
previous drivers (in an arbitrary order).  None of the existing ones do
that, so this is purely defensive.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
664ad9ac4c9047d29d5f37d43174e1b469e2ec80 Olivier Certner 2026-07-07 13:34:21
amd64 efirt: register all runtime regions as fictitious
This is needed for VM_PHYS_TO_PAGE() to work, which is needed for
pmap_map_io_transient() to work, which is needed for uiomove_fromphys()
to work.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296348
Reported and tested by: Anton Saietskii <vsasjason@gmail.com>
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58274
a2f50c4b32d1c126cf2309dab61d27d6329908f8 Konstantin Belousov 2026-07-16 06:49:21
ena: Swap cleanup order
As RX processing is heavier than TX completions processing, swap the
order and process TX completions first, in order to avoid starving the
completions and causing potential missing TX completions.

Submitted by: Ofir Tabachnik <ofirt@amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58239
f08def9ed97f45700eb0611a3fd9240210c9303e Arthur Kiyanovski 2026-07-14 20:20:06
ena: Batch RX statistics updates
Move per-packet counter_enter/counter_exit pairs out of the RX
processing loop and batch them into a single update after the
loop completes.

Previously, each received packet triggered two separate
counter_enter/counter_exit blocks -- one for bytes and one for
packet count. This commit accumulates totals in local variables
and updates all four counters (ring and hw stats for both packets
and bytes) in a single counter_enter/counter_exit block after the
loop.

Also move the stats update to after the refill and LRO flush
so that the error path (goto update_stats) and the normal path
converge at the same label, avoiding code duplication.

Submitted by: David Arinzon <darinzon@amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58240
3ba01cb4c61cc1e29c4d1d7ea4b73cdffb5ce3c2 David Arinzon 2026-04-16 11:22:04
ena: Fix false 'missing TX completions' warnings due to timestamp race
Sporadic 'Found a Tx that wasn't completed on time' warnings appear
under sustained TX load, always reporting '1 msecs since last cleanup'
despite the 5-second timeout threshold.

The per-packet TX timestamp uses struct bintime (128 bits: two 64-bit
fields sec and frac) which is read and written non-atomically. A race
exists between the missing TX completion check
(check_missing_comp_in_tx_queue reading the timestamp) and the TX
submit path or cleanup path writing it on another CPU. Since the two
fields are not updated atomically, the check can observe a partially
written timestamp - one field from the old value and one from the new.
This can produce a timestamp with {sec=0, frac=valid}, causing the
check to compute a time offset equal to system uptime and falsely
exceeding the 5-second timeout.

Confirmed by instrumentation showing all occurrences had sec=0 with
valid frac/mbuf, cleanup_running=0, and ticks==last_cleanup_ticks.

Replace struct bintime with sbintime_t (a single 64-bit value) for
tx_buf->timestamp. An aligned 64-bit store/load cannot be torn on
64-bit architectures. Additionally, snapshot the timestamp into a
local variable in the check path to prevent a read-then-read race
where the timestamp could be zeroed between the zero-check and the
offset calculation.

Testing:
On m6i.large (FreeBSD 15.0-RELEASE-p6 amd64, 2 IO queues), two
instances with MTU 1500. Ran iperf -P 20 -u -b 320kpps (CPU
saturated at ~7 Gbps aggregate).

Without the fix: 8 warnings in 6 hours (first at ~72 min).
With the fix: 0 warnings after 20+ hours under identical conditions.

Fixes: https://cgit.freebsd.org/src/commit/?id=9b8d05b8ac78 ("Add support for Amazon Elastic Network Adapter (ENA) NIC")
Submitted by: Gilad Ben Yakov <giladben@amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58241
74bcb1151bb94279a4269fc842aa2be00800545e Gilad Ben Yakov 2026-06-21 12:45:38
ena: Update driver version to v2.8.4
Bug Fixes:
* Fix false 'missing TX completions' warnings due to timestamp race
* Put taskqueues into correct NUMA domain if !RSS

Minor Changes:
* Batch RX statistics updates
* Swap RX/TX completions cleanup order

Submitted by: Arthur Kiyanovski <akiyano@amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58242
605e699cd6ca4feae6c73c5c5ea8337054897116 Arthur Kiyanovski 2026-07-14 19:38:34
firewire: per-unit-directory child device support
Added structure to allow multiple device to attach to the same driver.
Also removed the deprecation warning from the man page.

Differential Revision:  https://reviews.freebsd.org/D58201
Reviewed by:    adrian
21143476a5767b49ca722e6f28b19770703b537e Abdelkader Boudih 2026-07-17 04:02:36
fwcam: match unit directories, defer probe to first open
Migrated fwcam to use per-unit-directory child device

Differential Revision:  https://reviews.freebsd.org/D58202
Reviewed by:    adrian
58bd89647617dab2906db16ae30f7a935c2f8acb Abdelkader Boudih 2026-07-17 04:03:04
fwisound: match unit directories instead of IDENTIFY
Migrated fwisound to use per-unit-directory child device

Differential Revision:  https://reviews.freebsd.org/D58203
Reviewed by:    adrian
c402d2e4b70023c633e6b3af5436de7033166d04 Abdelkader Boudih 2026-07-17 04:03:53
fwdv: match unit directories instead of IDENTIFY
Migrated fwdv to use per-unit-directory child device

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58204
2b9ed8da552c5825bf261214665a48f81999db0d Abdelkader Boudih 2026-07-17 04:08:19
firewire: remove SPL calls
SPL is a no-op on amd64. Real locking is already handled by fc_mtx and
per-driver mutexes.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D58210
dd9fac5e4f003de0275f82efa0c326d7ee154623 Abdelkader Boudih 2026-07-17 04:08:43
arm64/vmm: Fix vgic_v3 copy paste error for writing to GICD_ICENABLERn
Otherwise we try to disable the wrong IRQ.

Fixes:          https://cgit.freebsd.org/src/commit/?id=47e073941f4e ("Import the kernel parts of bhyve/arm64")
MFC after:      1 week
422a530c80080f2585ecefe812d609079b851fe3 Jessica Clarke 2026-07-17 23:55:21
arm64/vmm: Fix vgic_v3 dropping EOI for disabled IRQs
Now that IRQs can properly be disabled by GICD_ICENABLERn, an EOI for a
disabled IRQ ends up being lost, since we don't assign it to a list
register and don't enable maintenance interrupts for such cases. As a
result, we keep the IRQ active, which stops it from ever being delivered
again (which would be true even if we supported the active and pending
state). Keep disabled but active IRQs around in list registers so we can
see the EOI having taken place in a future sync (noting that since we
already don't create list registers in active and pending state there
are no concerns with causing a disabled IRQ to be delivered).

Fixes:          https://cgit.freebsd.org/src/commit/?id=47e073941f4e ("Import the kernel parts of bhyve/arm64")
MFC after:      1 week
123dfd378959aecc97cfc1d9b457453194d6f25b Jessica Clarke 2026-07-17 23:57:15
dpaa2: Apply if_flags and MAC filters in dpaa2_ni_init()
dpaa2_ni_init() only enabled the DPNI object; it never pushed the
promiscuous/allmulti state or the multicast filter table to the MC
firmware.  The SIOCSIFFLAGS handler ignores flag changes that arrive
while the interface is down, yet still latches them into sc->if_flags,
so a promiscuous mode request made before the first up was silently
lost and could never be applied afterwards: the up path runs
dpaa2_ni_init(), which did not read the flags, and every later
SIOCSIFFLAGS compares against the already-latched value and sees no
change.

This is exactly what happens when if_bridge adds a dpni member while
the dpni is still down, e.g. rc.conf's

    create_args_bridge0="... addm dpni0"

running at bridge clone time, before ifconfig_dpni0="up" is processed.
bridge_ioctl_add() puts the member into promiscuous mode at addm time;
the request never reaches the firmware, so the DPNI continues to
hardware-filter unicast destined to other MACs.  ifconfig still
reports PROMISC (a stack-level flag), which makes the failure
invisible: the host stays reachable only via the DPNI's own MAC
address (e.g. with net.link.bridge.inherit_mac=1), while bridged
epair/vnet jail traffic is silently dropped on RX.

Reapply both pieces of administrative state after enabling the DPNI,
as other NIC drivers do in their init path.  This also restores
multicast memberships joined while the interface was down.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006
Reported by:    jhibbits

Signed-off-by: Nick Price <nick@spun.io>

Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D58330
dc12e3e0e72a73f1ad1a14d8d0fa4e2147151720 Nick Price 2026-07-19 02:27:36
i386: supply thermal interrupt handler
This fixes a build break for i386.

Reviewed by:    kib, olce, Koine Yuusuke <koinec@yahoo.co.jp>
Fixes:  https://cgit.freebsd.org/src/commit/?id=87ba088fa310 ("x86/local_apic.c: Add support for installing a thermal interrupt handler")
Differential Revision:  https://reviews.freebsd.org/D58332
cb325dcedfa291c9bfe350a513694df3776a17a4 Ryan Libby 2026-07-19 03:19:52
Commit group #1: hwpstate_intel: Fix i386 build
hwpstate_intel: Fix i386 build

Reviewed by:    olce
Fixes:  https://cgit.freebsd.org/src/commit/?id=7b26353a59d6
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58208
bdc0f7678257eaa739b9c816285504470e71e3de Harry Schmalzb 2026-07-13 05:29:34

hwpstate_intel: Minimize ifdef for i386 build

Reported by:    jrtc27
Fixes:  https://cgit.freebsd.org/src/commit/?id=bdc0f7678257
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
02c440e204041e92da403a64b70c2e1fdf3a4f73 ShengYi Hung 2026-07-19 14:00:27
Commit group #2: aq(4)
aq(4): expand and correct offloads, fix VLAN/multicast filtering

Advertise the offloads the hardware already performs, correct the TX
descriptor's L3 family selection, and correct the VLAN and multicast
receive-filter paths.

Offloads: advertise IFCAP_HWCSUM_IPV6 (adding CSUM_IP6_TCP/UDP/TSO to
isc_tx_csum_flags) and IFCAP_VLAN_HWTSO, and enable the RX outer
(S-VLAN) tag parse mode in aq_hw_offload_set().

TX descriptor L3 family: aq_setup_offloads() derived tx_desc_cmd_ipv4
from CSUM_IP|CSUM_TSO, but CSUM_TSO is (CSUM_IP_TSO|CSUM_IP6_TSO) and
tcp_output() sets both bits without regard to address family, so an
IPv6 TSO frame matched on CSUM_IP_TSO and went out with the IPv4
header-checksum command set on a frame that carries no IPv4 header.
The checksum flags cannot distinguish the family; key the bit off
IPI_TX_IPV4 instead, which iflib derives from the parsed ethertype,
as the IPI_TX_INTR test below it already does.  Plain IPv6 checksum
offload was unaffected, as CSUM_IP6_TCP alone never matched the mask.

RX VLAN tag stripping: ring init hardwired hardware tag stripping off
while the RX path still set M_VLANTAG and the writeback tag for every
tagged frame, so a tagged frame arrived with the tag in line while the
mbuf claimed it stripped and ether_demux() parsed four bytes short of
the payload.  Program per-ring stripping from IFCAP_VLAN_HWTAGGING and
set M_VLANTAG only under the same capability, so the two states stay
coherent.

VLAN filter and promiscuous edge cases: filter only when 1..16 VLANs are
registered -- with none (or more than the 16 the table holds) fall back
to VLAN-promiscuous and pass all tags, rather than dropping every tagged
frame against an empty filter table; and keep VLAN-promiscuous set
whenever the interface is IFF_PROMISC, so adding or removing a VLAN under
promisc does not clear it and start dropping tagged frames.

Multicast reconcile: ifdi_multi_set is declarative, but aq_if_multi_set()
only added -- shrinking the list left accept-all-multicast latched or
stale exact slots enabled, defeating hardware multicast filtering until
a reinit.  Clear the exact slots before reprogramming the current list,
and always drive accept-all-multicast from the current state so a shrink
clears it.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58145
dcede1ec9de3b24fc9fbeeebc99ca34d226995f9 Nick Price 2026-07-19 16:40:36

aq(4): drop errored RX frames instead of resetting the interface

aq_isc_rxd_pkt_get() returned EBADMSG when a receive descriptor's
MAC/receive-error bit (rx_stat bit 0) was set.  iflib treats any error
from isc_rxd_pkt_get() as a fatal ring fault and answers with
IFC_DO_RESET -- a full interface reinitialization.  A per-frame receive
error is not a ring fault: on a marginal link or cable the Atlantic
delivers errored frames continuously, so each one triggered another
reset and the interface reset-stormed itself into carrying no traffic
instead of merely dropping the bad frames.

The Atlantic delivers errored frames to the host by design (Linux drops
them in software via buff->is_error), and iflib offers no per-frame
error return that isn't a reset.  Follow the vmxnet3 model: on a receive
error zero the fragment lengths and return success.  iflib then discards
the packet (assemble_segments() excludes zero-length fragments) while
still recycling the descriptors through the refill path -- no reset.
Also drop frames flagged with an RX-DMA fault (rdm_err), not just the
MAC-error bit; and keep iri_len non-zero on that drop path, since iflib
asserts iri_len != 0.

The genuinely structural errors -- more segments than isc_rx_nsegments,
or a pkt_len inconsistent with the descriptor count -- still return
EBADMSG, since those indicate a confused ring where a reset is the right
recovery.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58136
73cd4048807dc0b3a5329bfc9a80ea4bf2d975fd Nick Price 2026-07-19 16:40:46

aq(4): honor the kernel RSS policy and add a TX traffic-class helper

Align RX steering with the kernel RSS framework and factor out the
active-traffic-class count.

RSS key and indirection table: on an options RSS kernel the stack owns a
canonical hash key and a hash-to-bucket indirection table binding each
bucket to a CPU.  aq programmed a random arc4rand() key and a plain
i % rss_qs table, so the hash it stamped in iri_flowid and the queue it
steered a flow to did not match the CPU the stack chose -- defeating RSS
affinity.  Under #ifdef RSS take the key from rss_getkey() and each entry
from rss_get_indirection_to_bucket(), as e1000/ixgbe/ixl do; the non-RSS
build keeps the random key and round-robin table.

RSS hash-type policy: drop the private hw.aq.enable_rss_udp knob (RDTUN,
default on) and add aq_rss_hashconfig(), which under options RSS returns
rss_gethashconfig() and otherwise the same UDP-off default.  UDP 4-tuple
hashing scatters a fragmented datagram's pieces across queues because
only the first fragment carries the L4 ports, so it is now off by default
and re-enabled the standard way, via net.inet.rss.udp_4tuple, matching
ix/ixl/mlx5.  On Atlantic 1 the UDP-off action stays the existing L3L4
flow-filter workaround; only its policy source changes.

TX traffic-class helper: factor the active-TC count (one per active
8-ring group, capped at HW_ATL_B0_TCS_MAX) out of aq_hw_qos_set() into
aq_hw_active_tcs(), so there is a single definition of the policy; the
Atlantic 2 RSS redirection table reuses it.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58137
9b4585afd31384573fcebd156d0e4af32bcddf9e Nick Price 2026-07-19 16:41:37

aq(4): harden the attach, detach, and reset error paths

Correct several attach/detach/reset paths that either swallowed failures
or acted on undefined state.

MSI-X attach-failure double-free: aq_if_msix_intr_assign() freed the
per-RX-ring interrupts in its failure path and then returned an error, so
iflib's IFDI_DETACH freed the same irq structures again --
bus_teardown_intr() on a dangling tag and bus_release_resource() on an
already-released IRQ, panicking a box that should have simply failed to
attach.  Let iflib own the teardown; drop the failure-path loop and the
now-dead index bookkeeping.

Detach loop bound: aq_if_detach() freed the per-ring interrupts looping
to isc_nrxqsets while indexing rx_rings[], which is sized by
rx_rings_count; index by rx_rings_count to match every other RX-ring
loop.

AQ_HW_WAIT_FOR final poll: the macro derived its result from the loop
counter rather than the condition, so a condition that became true on the
last iteration reported ETIMEDOUT.  Worst for the acquire-on-read
firmware RAM semaphore, which was acquired in hardware but reported as a
timeout.  Return based on the last evaluation of the condition.

RBL MAC reset SPI cleanup: mac_soft_reset_rbl() fired the global reset
without first tearing down the SPI/flash interface, so a flash burst in
flight left the SPI bus wedged, the RBL could not re-read flash, and the
reset returned EBUSY -- fatal at attach ("MAC reset failed: 16").  Set
bit 4 of the SPI control register (0x53c) before the global reset, as the
sibling FLB path and the Linux driver do.

Reset failure propagation: aq_hw_reset() discarded fw_ops->reset()'s
return, so a failed attach-time fw2x capability read left fw_caps == 0
permanently and stats silently froze.  Propagate the error so the reset
fails and is retried.

aq_hw_init failure propagation: aq_hw_init() discarded
aq_hw_init_tx_path()/aq_hw_init_rx_path() returns and reported success,
bringing the interface up half-initialized; capture both and goto
err_exit (mainly the Atlantic 2 RX action-resolver path, which returns
EBUSY on ART semaphore timeout).

Link-state outputs: aq_hw_get_link_state() left *link_speed and *fc_neg
unwritten on early-return paths, and the caller acts on them
uninitialized, so a transient firmware get_mode() failure could fabricate
a phantom link-up at a garbage speed and program a garbage RX-pause bit.
Initialize both to safe link-down values before calling get_mode().

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58138
557866b899b632ca4160953e5430cd9ccba8b570 Nick Price 2026-07-19 16:41:49

aq(4): harden the interrupt and MAC-statistics paths

Firmware-statistics accounting and interrupt-routing fixes.

Stats delta underflow: guard the MAC statistics delta accumulation
against counter wrap or a firmware counter reset, so a snapshot smaller
than the previous one does not underflow into a huge spurious delta.

Skip stats on a failed read: aq_update_hw_stats() ignored
aq_hw_mpi_read_stats()'s return and committed the on-stack mbox into
last_stats unconditionally.  On a failed read that snapshot is garbage or
zero and poisons the delta baseline (a zeroed snapshot wipes last_stats,
so the next good read double-counts).  Check the return and skip the
accumulation and the last_stats commit on failure.

Mailbox/stats separation: struct aq_hw_stats served both as the raw fw1x
MCP mailbox layout and as the driver's canonical stats snapshot, so any
field added to it would silently shift the fw1x mailbox read.  Give the
fw1x mailbox its own raw layout in struct aq_hw_fw_mbox and let
aq_hw_stats become purely driver-owned; with the coupling gone, add
first-class aggregate octet fields (brc/btc) that Atlantic 2 B0 firmware
can populate directly.  No A1 behavior change.  The raw block is a named
struct (aq_fw1x_mbox_stats) with a _Static_assert tying its size to
aq_hw_stats' matching prefix, so the fw1x memcpy cannot silently misalign
if either field list drifts.  Also drop the unused FW1X_MPI_STATE_ADR /
FW1X_MPI_CONTROL_ADR macros and the redundant fw1x_get_stats() dpc
assignment that the caller immediately overwrites.

Per-speed interrupt moderation: aq_hw_interrupt_moderation_set()
hardcoded speed_index = 0, so every link speed got the 10G timer pair and
the other rows were dead.  Record the negotiated rate and index the
tables by ffs(speed) - 1, reordering the rows to match the
enum aq_fw_link_speed bit positions so the index cannot drift from the
enum.  Rename the two per-speed timer tables (AQ_HW_NIC_timers_table_
{rx,tx}_ -> aq_itr_timers_{rx,tx}), function-local static arrays whose
SCREAMING_CASE vendor names read like macros.

Hardware error interrupts: route both hardware error causes (interrupt
map register 0) to the admin vector so they are actually delivered.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58139
65fd3b4165eff52f3447c70db8d10ef67875c022 Nick Price 2026-07-19 16:46:29

aq(4): remove dead code and tidy macros, diagnostics, and naming

Non-functional cleanup, with two diagnostic corrections.

Dead code: delete leftover commented-out AQ_DBG_ENTER/EXIT/PRINT calls
(aq_hw.c, aq_fw2x.c, aq_irq.c, aq_main.c), a commented-out aq_nic_cfg
local, the stale old-signature parameter blocks between the ring-init
declarations and their bodies (aq_ring.c), a trailing note on a live
statement, and the unused DumpHex() vendor debug helper (no callers; its
body only compiled under AQ_CFG_DEBUG_LVL > 3).

Register-write macros: parenthesize AQ_WRITE_REG_BIT's msk/shift/value
arguments so a compound argument cannot mis-bind, give AQ_HW_FLUSH() an
explicit hw parameter instead of capturing it from caller scope, and drop
the duplicate lowercase aq_hw_write_reg[_bit] aliases (converting the 43
call sites to the uppercase spelling) so there is a single form.

Diagnostics: the aq_log* family expanded through the base log macro, which
ignored its level and printed unconditionally, while the error traces
gated on a debug level that defaulted below LOG_ERR and so were suppressed
-- backwards.  Gate the base log macro the way the trace one does and
default the level to lvl_error, so the once-per-event firmware reset /
capability errors are visible by default while the verbose info/dump
output stays opt-in.

Naming: rename identifiers carried verbatim from the vendor import that do
not match style -- names mixing an ALL-CAPS macro-style prefix with a
lowercase tail, and a trailing underscore the vendor used as a
"file-local" marker in place of static.

- dbg_level_ / dbg_categories_ -> aq_dbg_level / aq_dbg_categories: these
  are real globals (the log/trace macros reference them from every
  translation unit), so the trailing underscore was never a stand-in for
  static; give them the aq_ namespace so the driver stops exporting
  generically-named global symbols.
- log_base_ / trace_base_ -> aq_log_base / aq_trace_base: the internal
  macros behind the aq_log*/trace* families.
- bootExitCode / flbStatus -> boot_exit_code / flb_status (aq_fw.c);
  flb_status now matches the identically-purposed variable already spelled
  that way in the sibling FLB-reset path.

Cosmetic: terminate the ring/HW-init, MSI-X admin-handler, and
media-change error messages with a newline so they are not garbled into
adjacent dmesg output, and label the per-queue rx_bytes sysctl "RX Octets"
(it was copy-pasted "TX Octets").

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58140
f1796e8781ca8a632ffa0861b2e09944d225c479 Nick Price 2026-07-19 16:47:38

aq(4): add Atlantic 2 (AQC113) device support

Add support for the Marvell Atlantic 2 (AQC113/114/115/116) controllers,
a new chip generation that is not register-compatible with the Atlantic 1
parts aq(4) supports today.  Adapted from the OpenBSD/NetBSD if_aq driver.

Register and device definitions (aq2_hw.h): the firmware handshake
(MIF_BOOT / MCP_HOST_REQ_INT / MIF_HOST_FINISHED), the 0x12000/0x13000
firmware interface windows, and the action-resolver table (ART) that
replaces Atlantic 1's discrete RX filters, plus the Atlantic 2 PCI device
ids and the aq_is_atlantic2() helper.  Reserve a chip-feature bit
(AQ_HW_CHIP_ATLANTIC2) and add the aq_hw fields the firmware fills at boot
(ART base index, statistics interface version A0/B0).  The per-VLAN-filter
resolver-tag field comes from the Linux driver; the BSD sources never
write it.

Firmware operations (aq_fwa2.c): Atlantic 2 talks to the management CPU
through the 0x12000/0x13000 register windows plus the boot handshake,
rather than Atlantic 1's mailbox in shared RAM.  Implement that as a third
aq_firmware_ops vtable (reset, set_mode, get_mode, get_mac_addr,
get_stats); aq_fwa2_reboot() boots the firmware, selects the A2 ops, and
reads the version and ART base index, failing fast on the
crash-init / boot-failed bits.  fwa2_set_mode advertises full duplex only
(the media model exposes no half-duplex types) and writes and acks the
link options before raising ACTIVE mode, so a forced media change does not
begin negotiation with a stale rate mask.  enum aq_fw_link_speed gains
aq_fw_10M, which Atlantic 2 supports and Atlantic 1 does not.

Probe and attach: list the device ids with their media types and link
speeds (all copper; AQC113* up to 10G, AQC116C to 1G), populate
hw->device_id, and tag the generation with AQ_HW_CHIP_ATLANTIC2 so
IS_CHIP_FEATURE() recognises it uniformly.  Branch firmware bring-up and
reset on the generation: aq_hw_init_ucp() and aq_hw_reset() reboot the MCP
instead of the Atlantic 1 RBL/FLB reset -- without a real datapath reset
every stop/init cycle reprograms the rings on a live, desynced RX DMA
engine and the receive path stays dead.  aq_hw_init() programs the
Atlantic 2 launch-time clock ratio in place of the Atlantic 1
MRRS / TX-DMA request-limit clamp.  Add an AQ_LINK_10M capability bit
(Atlantic 2 links at 10M, Atlantic 1 cannot), offer 10baseT media, and map
IFM_10_T to aq_fw_10M.

With every supported media type now present, replace the per-speed switch
statements in aq_media.c with a single {link bit, fw rate, IFM_* subtype,
Mbit/s} table -- one source of truth for the supported link speeds.

With this an Atlantic 2 card probes, brings up its firmware, reads its
MAC, and negotiates link; the RX action-resolver datapath comes next.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58141
dc5c0fc51cf47d6dfc737343e06805db294258e9 Nick Price 2026-07-19 16:48:05

aq(4): program the Atlantic 2 multiqueue datapath

Wire up the Atlantic 2 receive datapath: the action-resolver table (ART),
multiqueue RSS, QoS, and interrupt moderation.

RX action-resolver table: Atlantic 2 replaces Atlantic 1's discrete RX
filter registers with an ART -- hardware computes a per-packet
classification tag, then walks {tag, mask, action} rows to drop, assign a
queue, or assign a TC.  aq_hw_art_filter_set() installs one row under the
ART semaphore; aq_hw_init_rx_path() enables the resolver, tags L2
unicast/broadcast, installs the unicast/all-multicast and VLAN drop rows,
and assigns every 802.1p priority to TC 0 (mirroring the Atlantic 1
user-priority map, since our RX side is a single 8-ring group in TC 0).
Tag every enabled VLAN filter in the per-filter resolver-tag field -- a
register the BSD ports never write -- because the VLAN drop row matches
resolver tag 0, so without it all tagged receive was dead under VLAN
filtering.  Promiscuous mode disables the drop rows rather than toggling
the Atlantic 1 promiscuous bits; all ART callers surface a semaphore
timeout consistently.  The Atlantic 1 RX_TCP_RSS_HASH and TPO2
programming is gated to Atlantic 1.

Multiqueue RSS and QoS: fill Atlantic 2's own per-TC redirection table
(AQ2_RPF_RSS_REDIR), skipping the Atlantic 1 table and its write-enable
handshake.  Program Atlantic 2's smaller packet-buffer sizes, its wider
data-TC credit/weight fields, and its ring-to-TC map, using
aq_hw_active_tcs() for the TC loops.

RSS hash types: the Atlantic 2 resolver has per-protocol hash-type enables
in REDIR2, so build the mask from aq_rss_hashconfig() instead of
hardcoding every protocol -- UDP 4-tuple hashing now follows the kernel
policy (off by default) with no L3L4 flow-filter workaround, and
aq_hw_udp_rss_enable() is skipped on Atlantic 2.  The kernel-to-hardware
hash-type mapping is a small static lookup table rather than a nine-branch
chain, since the two bit spaces do not share a simple shift.

Tx interrupt moderation: Atlantic 2's per-ring Tx moderation control
register lives at a different address, but its field layout matches the
value the driver already builds, so write that value straight to it; Rx
moderation is shared.

HW-validated on AQC107 <-> AQC113C: TCP RSS spreads across 7/8 RX queues
under 16 parallel flows, rx_err=0.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58142
418e7fd13b5aa201c0f9eb65ab2f9a0c1810ba23 Nick Price 2026-07-19 16:48:14

aq(4): correct Atlantic 2 register access

Four Atlantic 2 register-access corrections found in bring-up.

B0 aggregate octet counters: the B0 firmware statistics interface reports
only aggregate rx/tx good octets, not the per-cast breakdown A0 and
Atlantic 1 provide, so every octet sysctl read a permanent zero while
frame counters advanced.  Populate the aggregate octet fields from the B0
buffer; aq_update_hw_stats() accumulates them directly when the per-cast
octets are absent.

Drop the duplicate attach-time MCP reboot: aq_hw_mpi_create() already
reboots the A2 firmware to read its version and caps, then aq_hw_reset()
immediately rebooted it again -- a full MCP restart plus several
transaction-id-bracketed window reads, adding attach latency and a
duplicate banner.  Give aq_hw_reset() a reboot flag and pass reboot=false
for A2 at attach; the load-bearing down/stop reboot (which resyncs A2 RX
DMA across ifconfig down/up) keeps reboot=true.

Skip Atlantic 1 register accesses on Atlantic 2: gate out the 0x7040
Atlantic 1 TPO write (which A2 lacks; already a no-op via the unset TPO2
feature, but Linux hw_atl2 omits it), and guard the
aq_hw_mpi_read_stats() direct reads of reg_rx_dma_stat_counter7 (dpc) and
the LRO counter (cprc) with !ATLANTIC2 -- those are Atlantic 1 codegen
offsets that on Atlantic 2 land on unrelated registers and can report
bogus input-drop / LRO counts.

HW-validated on AQC107 <-> AQC113C: A1 stats unchanged, A2 IQDROPS stays
0, attach consumes one MCP reboot instead of two, bidirectional iperf3
clean.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58143
c325b4024d61fe20f8140d6891074ca7276c4d58 Nick Price 2026-07-19 16:48:23
Commit group #3: re(4)
re(4): quiesce RTL8168G+ and reset before freeing buffers in re_stop()

The STOPREQ command written by re_stop() is not defined for
RTL8168G and later; issuing it can wedge the MAC.

Replace it on those parts with the vendor-documented sequence:

* settle delay
* bounded poll for Tx queue empty
* clear TE/RE
* then bounded poll of the MCU command register (0xD3) FIFO-empty bits.

Also reset the controller before the Rx/Tx buffer free: a controller that
has not quiesced keeps DMAing stale, still-owned descriptors pointing at
freed mbufs (use-after-free under INVARIANTS, cross-NIC mbuf corruption
reported in the PR).

Adds the RL_MCU_* register definitions.

All waits are bounded; error paths only.

* iperf3 --bidir at line rate against RTL8168H (XID 0x541);
  previously wedged the controller until power cycle, with the
  quiesce the reset path recovers.

* Deployed in production on an RTL8168H fleet since 2026-07-01.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58276
PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=166724
38187938f52283143308dd219db35d889da55ea4 Jérémie Jourdin 2026-07-19 18:39:49

re(4): re-arm the Tx doorbell when re_txeof() leaves a non-empty ring

On PCIe parts a TxPoll request can be lost when packets are queued
in quick succession, leaving owned descriptors with no transfer in
progress until the watchdog fires. re_txeof() runs from the interrupt
handlers, re_tick() and re_watchdog(), so re-writing TXSTART whenever
the ring is still non-empty turns a potential 5-second stall into at
most one tick.

One register write on a path that already took an interrupt;
fast path untouched.

* Sustained bidirectional load on RTL8168H; no Tx stalls, no throughput
  regression at 941 Mbps line rate.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58277
PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=166724
4bff6b9f5cef13df8540fa6869bd6707f8e7575d Jérémie Jourdin 2026-07-19 18:42:22

re(4): recover Tx completions whose MSI was swallowed in re_intr_msi()

A Tx completion that raises a status bit between the ISR ack at the top
of re_intr_msi() and the IMR re-enable at the bottom is never re-signalled:
these controllers do not re-assert MSI for an already-set status bit
(this is why hw.re.msi_disable is a known workaround in the PR).

Re-read ISR before re-enabling; if a Tx bit is pending, ack just that bit,
reap the ring and restart the queue. Rx bits are deliberately left set so
they re-arm the interrupt normally and Rx moderation state is untouched.

Also flush the posted IMR write. Mirrors what the INTx path already
achieves via the loop in re_intr().

* MSI interrupt mode on RTL8168H under load; "missed Tx interrupts"
  watchdog recoveries no longer occur.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58278
PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=166724
d11f124e932bfa4fabdc6c5b67735181615a0630 Jérémie Jourdin 2026-07-19 18:45:47

re(4): harden re_watchdog() recovery and log controller state

Distinguish the two failure classes from the PR in a single log line
(ring indices, ISR/IMR, TXCFG, interrupt mode): lost interrupt vs
genuine DMA stall.

Bail out instead of re-initializing when the controller reads back
all-ones (fallen off the bus; reinit cannot help).

Re-assert the driver's existing ASPM-disabled policy before reinit,
since firmware/power transitions re-arming L0s/L1 is a documented
stall trigger.

Diagnostics-only on the recovered path; no fast-path change.

* Field diagnostics running on an RTL8168H production fleet; the log
  format distinguishes lost-doorbell / DMA-stall / dead-controller
  without a debug build.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58279
PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=166724
42f3088bd980a469dbbc3e6b568edb7ce0ab2bc3 Jérémie Jourdin 2026-07-19 18:47:17

re(4): add hw.re.aspm_disable loader tunable

re(4) has unconditionally disabled ASPM L0s/L1 and CLKREQ at attach
for years; on laptops this costs 200mW+ (requested by adrian@ in the PR).

Make it a tunable following the existing hw.re.* pattern:

* default 1 keeps today's behavior;
* 0 preserves the firmware-configured ASPM state at attach and
  skips the watchdog re-assert from the previous revision.

Documented in re.4.

* Verified on RTL8168H (XID 0x541): with hw.re.aspm_disable=0,
  attach no longer logs "ASPM disabled" and pciconf -lcb shows
  the firmware Link Control state preserved -- including Clock PM,
  which the unconditional code previously cleared.

* Default (1) is behaviorally identical to the current driver.

* Note the tunable also stops the driver clearing CLKREQ, a small power
  win even where firmware leaves L0s/L1 off.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58280
PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=166724
b0c14eae10609f7d688b31d112de2a641d9cc516 Jérémie Jourdin 2026-07-19 18:49:12
i386: provide PCPU pc_small_core for amd64 compat
Provide pc_small_core for i386 too to fix an i386 build break from x86
code referring to it.  It won't be set.

Reviewed by:    aokblast, kib
Fixes:  https://cgit.freebsd.org/src/commit/?id=7b26353a59d6 ("hwpstate_intel: Disable package control on hybrid CPU")
Differential Revision:  https://reviews.freebsd.org/D58335
29d15d658d175139196d821b123c30a5b58e135e Ryan Libby 2026-07-19 20:05:58

Networking

Network-related commands, library, and kernel.

sockstat: fix SCTP support
Provide a name for SCTP sockets.

Fixes:          https://cgit.freebsd.org/src/commit/?id=8b2b62b49d88 ("sockstat: consolidate unix(4) protocols in the array of protocols")
f2f50c80ae27a97a66b8d4a1b5dd6ee9d63ff18f Michael Tuexen 2026-07-13 09:08:01
routing: Include <sys/eventhandler.h> in nhop_ctl.h
Fix missing Include which is currently leaked through vnet code.

Reported by: bz
Fixes: https://cgit.freebsd.org/src/commit/?id=d05d1f256082 ("routing: Subscribe nhops to ifnet link events")
Differential Revision: https://reviews.freebsd.org/D57375
8ed5e67e2165fb38d7a0b27e67aa7ca18c68ffac Pouria Mousavizadeh Tehrani 2026-07-13 22:44:43
inpcb: remove unneeded #ifdef INET || INET6
Per sys/conf/files this unit is not compiled for a NOIP kernel.
3ff24c76c140d5c533915caecfe4af201126f243 Gleb Smirnoff 2026-07-15 02:13:25
iflib: Remove an unused field from struct iflib_rxq
Reported by:  Alexander Sideropoulos <Alexander.Sideropoulos@netapp.com>
MFC after:      1 week
fc09c7fee23b3cf3ddc95105ef6ef41d7956232f Mark Johnston 2026-07-15 15:04:46
inpcb: do not set INP_ANONPORT until successful operation
ca4eb3f3989b64dc371c2f114eecae28b25a6481 Gleb Smirnoff 2026-07-15 18:46:05
inpcb: return ENOMEM if bind(2) fails to allocate lbgroup
This is exactly the same as the second part of IPv4's change
136c5e17b61a1/D49153.
3abd3d3cf3f034cb3d4250a95a8d6c41e72971ef Gleb Smirnoff 2026-07-15 18:49:32
nd6: Add router address and DHCPv6-PD flags in PIO headers
Make R-bit per RFC 6275 8.3 and P-bit per RFC 9762 7.1 in
Prefix Information option available to userland for future implementations.

RFC 9762 7.1: For each interface, the client MUST keep a list of every prefix
that was received from a PIO with the P flag set and currently has a non-zero
preferred lifetime.

Differential Revision: https://reviews.freebsd.org/D56207
7c22dda66913347fba2e488440cf00e7f8a26470 Pouria Mousavizadeh Tehrani 2026-07-16 13:24:22
tcp: Align PRR implementation with RFC 9937
- Early return when no new data is delivered
- Switching from PRR-CRB to PRR-SSRB only when both SND.UNA advances and no further loss is indicated.
- Accounting for sequence ranges SACKed before entering recovery in RecoverFS calculation.
- Force a fast retransmit upon entering recovery when prr_out is 0 AND SndCnt is 0.
- Set cwnd to ssthresh post recovery.

Obtained from: mohnishhemanthkumar_gmail.com
Reviewed by: rscheff, tuexen
Differential Revision: https://reviews.freebsd.org/D56535
MFC after: 3 months
506e3e30a43cc04a21aa65a423bbd1cc4e0543f8 Richard Scheffenegger 2026-07-18 08:51:51

System administration

Stuff in man section 8 (other than networking).

bhyve: unsigned <= 0
illumos smatch build is complaining:
    pci_nvme_parse_config() warn: 'sc->max_qentries' unsigned <= 0
    pci_nvme_parse_config() warn: 'sc->ioslots' unsigned <= 0

Because we are using atoi() to translate string to int, we need
to use int type variable for translation.

Reviewed by:    bnovkov
Differential Revision:  https://reviews.freebsd.org/D58213
575529a92d7b35628daace82c2965984c6376e2e Toomas Soome 2026-07-13 19:15:40
loader: Fix indentation mistakes
Somehow, I wound up with space indents rather than tab indents, so fix
this.

Sponsored by:           Netflix
e49fc64b9b0044d99524d7fd1d9de47f6cf873eb Warner Losh 2026-07-13 20:22:57
bsdinstall/netconfig: use a better heuristic for wlan dev desc
For devices like the rtw88, they will show up in `ifconfig -l` as
rtw880, rtw881, etc. We want to query the rtw88.0 and rtw88.1 sysctl
respectively, not rtw.880.

Chances are that there aren't more than 9 wlan devices using the same
driver. Use a better heuristic to get the device description.

Reviewed by:    bz
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
c4b0b13cadac46b7c2cdfeeedeffa596c62568fa Siva Mahadevan 2026-07-09 15:26:32
bhyve: Fix some leaks in usr.sbin/bhyve/block_if.c
Modify `blockif_open` to properly release a partially initialized
`blockif_ctxt` structure on error.

Differential Revision:  https://reviews.freebsd.org/D57887
Reviewed by:    novel, bnovkov, glebius
Tested by:      bnovkov
MFC after:      2 weeks
0228338fc9c6d2243fe4fd3259286d2fbc6df786 Slawa Olhovchenkov 2026-07-13 16:02:43
init(8): extract reroot transient code into reroot_seed
Since init become dynamically linked, reroot appeared to be broken
because init copies itself into a transient tmpfs mount to continue
controlling execution right after the reboot(REROOT) syscall.  Because
the binary is dynamically linked, it cannot be properly executed.

Provide a minimal static binary 'reroot_seed' embedded into the init as
byte stream, which performs what the 'init -r' did, namely, the second
phase reroot.

For the static build of init as part of the /rescue crunch, keep the
inline reroot code.

Reported and tested by: markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58164
4c9f648852629d757165796bb3cd97bb84a0e483 Konstantin Belousov 2026-07-10 19:02:54
pfctl: fix CREATE_TABLE error handling
pfr_add_table() does not set errno, it returns an error (now).
Read the error code from the return value so we display the correct
error message to the user.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
ddbf89234312791e65991efff39a18a9e8e4d077 Kristof Provost 2026-07-13 13:14:10
pfctl: fix incorrect errno checks
These calls return an error value, they do not set errno. Check their
return values.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
40c611d0939f187d9a211e9e497291e251deddd3 Kristof Provost 2026-07-14 07:32:41
stand: Recognize SHT_INIT_ARRAY sections as constructor sections
Pass such a section to the kernel using modinfo, otherwise link_elf.c
won't execute constructors for the file.  This is required for KASAN,
otherwise redzones for global buffers are not poisoned during boot.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58244
4b0ae7e001a97e5449835bb8a2e6c2e6f53aac39 Mark Johnston 2026-07-15 14:58:32
rc.d/dumpon: minor hardening/tightening up
- Scope local variables properly to each function.
- Quote variables that should be treated as single words.
- Replace `${cmd}; if [ $? -eq 0 ]` with `if ${cmd}` for simplicity.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57899
fc186c24b1e72fa3eba91c166f7a554a5cea5828 Enji Cooper 2026-07-16 16:24:54
bhyve: add configurable SMBIOS OEM Strings
Add the option "oemstring" to allow setting the DMI type 11 ("OEM
Strings") SMBIOS structure. These are free-form strings, available for
any purpose, but can be especially useful to pass configuration,
secrets, and credential information into a Linux guest and consumed by
systemd.

MFC after:      1 month
Relnotes:       yes
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D57516
cbd442efe85d9ae371581565670dfc0287afbf8e John De Boskey 2026-07-18 21:39:33
certctl: Enforce 0444 mode on new files
When writing to a file, call fchmod() to ensure the file mode matches
the intended mode, which is 0444.  This was already done when replacing
an existing file, but not when creating a new file, which meant if the
process umask was 077, the resulting certificates and bundle would be
unreadable by unprivileged users.

MFC after:      1 week
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D58304
02f174179a538f89185d275b4e64277baf3acc50 Lexi Winter 2026-07-19 12:45:43

Libraries

Commit group #4: libfetch
libfetch: Overhaul socket read / write

* Make fetch_ssl_read() and fetch_ssl_write() behave more like read(2)
  and write(2), and drop fetch_socket_read() in favor of read(2).

* Don't request POLLERR, it's implied.

* Don't needlessly set errno, it's relatively costly.

* Always check for EAGAIN from writev(2), otherwise we will abort on a
  short write instead of proceeding to poll(2).

* Always check for EAGAIN from poll(2) even though it can't happen on
  FreeBSD; POSIX says it can, and it might in the future.

* Rewrite fetch_read() and fetch_writev() to be more similar to each
  other.  The main difference is that a partial read is treated as
  success while a partial write is treated as failure.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296316
MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D57906
32c341bd1c8b1154128f62fafa6988ed29db564a Dag-Erling Smørgrav 2026-07-13 06:43:28

libfetch: Add read buffering

Previously, we would read FTP control connection messages and HTTP
reponse headers one character at a time.  Now, we read as much as will
fit in our buffer and look for a newline.  If there is data left over,
it will be reused by the next fetch_getln() call.  This also requires
the addition of a fetch_bufread() which takes the buffer into account,
otherwise the start of the HTTP response body will be stuck in the
buffer after we read the last line of the header.

This should noticeably improve HTTP performance, especially for small
transfers.

MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D57907
a1978277379cf65f1339ab062f335c6f1fa6239f Dag-Erling Smørgrav 2026-07-13 06:43:33

libfetch: Apply timeout to connection attempts

Mark the socket non-blocking before connecting and poll for completion,
applying fetchTimeout if set.

MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D57909
848f360c8f9ae8d1d97c61f5d63fc624926d5dcd Dag-Erling Smørgrav 2026-07-13 06:43:37
libfetch: Make fetch_ref an inline
Make fetch_ref() an inline and provide a fetch_deref().

MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D57944
d4e0e1fbc237f0765b9f32b291c087348031c921 Dag-Erling Smørgrav 2026-07-13 06:43:51
libfetch: Reduce copying
Reduce the amount of copying we do when performing buffered reads.

MFC after:      1 week
Reviewed by:    op
Differential Revision:  https://reviews.freebsd.org/D58113
60382b4a04fa39e9bf65b964b1b7b4bed6eaa56a Dag-Erling Smørgrav 2026-07-13 06:43:56
libnetmap: fix error path in nmport_extmem_from_file
Reviewed by:  zlei, vmaffione
Obtained from:  https://github.com/luigirizzo/netmap/commit/b52a2bcae35e56548acfb0849b248a1e4b0c0c3b
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58150
fcaf15e54162fe14483fdf4ac28c67c51e424441 Jose Luis Duran 2026-07-13 12:23:14
libnetmap: fix extra indirection in nmreq_remove_option
Reviewed by:  zlei, vmaffione
Obtained from:  https://github.com/luigirizzo/netmap/commit/7d9177ed9a121e66bf4eaa0acb5d574e408297da
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58151
141b6645204966a0e1ae10dd059c670e2a58e6e1 Giuseppe Lettieri 2026-07-13 12:24:16
libproc: link against libctf if MK_CTF != no instead of MK_CDDL != no
Logic prior to this change would incorrectly try linking when MK_CDDL != no,
instead of MK_CTF != no, which could result in the library and the tests being
broken if/when MK_CTF == no and MK_CDDL != no (an uncommon, but possible
combination with today's build knobs).

This change updates the conditional to correctly track the value of MK_CTF, which
in turn is properly toggled to no if/when MK_CDDL == no as it's a dependent build
knob.

This [niche] build bug has been present in FreeBSD since 2014.

MFC after:      1 week
f2e6a8b9e50c7552037cb635f17b955ead84a813 Enji Cooper 2026-07-16 21:48:37

Filesystems

nullfs: close a race when syncing inotify flags from the lower vnode
After a bypassed VOP, nullfs mirrors the lower vnode's inotify state
onto the upper vnode.  The flags were checked with lockless reads
before being updated with the asserting flag set/unset primitives, so
two threads syncing the same vnode concurrently (or a sync racing a
watch being established) could both decide to make the same change;
the loser then trips the "flags already set" assertion on an
INVARIANTS kernel.  On other kernels the race is harmless.

Keep the lockless check as the fast path, but re-make the decision
under the vnode interlock before actually changing the flags.

Reproduced in a 4-CPU VM with one thread cycling an inotify watch on
a lower-filesystem file while several threads stat(2) the same file
through a nullfs mount: the unpatched INVARIANTS kernel panics under
this load, the patched kernel runs it to completion.

Fixes:                  https://cgit.freebsd.org/src/commit/?id=f1f230439fa4 ("vfs: Initial revision of inotify")
MFC after:              2 weeks
Differential Revision:  D58344
Reviewed by:            markj
Assisted-by:            Claude Code (Fable 5)
d6915bffb7b68d9b55fa3db4e5709463549c379e Alexander Leidinger 2026-07-19 07:38:52

Kernel

Kernel stuff (other than networking, filesystems, and drivers).

kern_thread: Fix i386 p_emuldata KBI assertion
On amd64 there was 4 bytes of padding between the 20-byte p_comm and
(for LP64) 8-byte p_sysent, so the addition of p_execblock just caused
that padding to be eaten up. However, on i386, there was no such
padding, and so the addition of p_execblock rippled through to
p_emuldata.

Fixes:  https://cgit.freebsd.org/src/commit/?id=e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process")
f6ee1d20d36813e9906916f48cf06f44a2fd668d Jessica Clarke 2026-07-13 03:03:03
procdesc: add NOTE_PDSIGCHLD
The note type wakes up when there is something for pdwait(2) to report
on the process descriptor.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58123
2a5e58c59694bc719d7ab82abb1c65ee2045329d Konstantin Belousov 2026-07-09 11:08:45
pdwait(2): make debugging events functional
We need to wake up the pdwait(2) waiters when procdesc event is
reported.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58172
0f1718e0d588375d6ab6be52f5253fe143c5c75f Konstantin Belousov 2026-07-11 15:50:26
kern: add fget_procdesc()
Convert several callers to use fget_procdesc().
Eliminate procdesc_find() and directly use fget_procdesc() in
sys_pdkill().  Previous code structure required to fdrop() procdesc
while the process is locked.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58117
97de8330e1683e41883887d19ea489bda90e5c61 Konstantin Belousov 2026-07-08 14:21:58
Commit group #5: LinuxKPI
LinuxKPI: add system_percpu_wq

In Linux v6.17 system_wq was replaced (renamed to) system_percpu_wq,
with the old name still present.

We just alias system_percpu_wq to linux_system_short_wq like we do
for system_wq to keep both around for the forseeable future.

Note: the original system_wq was a per-cpu queue upstream as well
based on my understanding but we never implemented it as such.
That means we are still lacking a per-cpu implementation for
system_percpu_wq but at least we do not change the status-quo
of the LinuxKPI implementation with this.

Note2: we should add a check somewhere for LINUXKPI_VESION >=
61700 to print a warning if anyone still uses the system_wq
to detect any possible sami-native or out-of-tree drivers
relying on this and not properly updating.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell; emaste (comments on previous review)
Differential Revision: https://reviews.freebsd.org/D57730
058ce52660fb52ada41462d339fb1ce6aca48cf3 Bjoern A. Zeeb 2026-01-21 13:53:34

LinuxKPI: fix lkpi_pci_get_device() reference counting on device

In case we are passed an "odev" (a device to start the search from),
that device would have an extra reference.  The best way to illustrate
this is to look at for_each_pci_dev(), which will return one device
after the other.  Upon first return we return a pdev with a reference.
That pdev is then passed in as odev on the next call.  If we do not
clear the reference it will be leaked.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Fixes:          https://cgit.freebsd.org/src/commit/?id=910cf345d0ee9 ("LinuxKPI: pci: implement ...")
Reviewed by:    dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D57428
f9a37065b6948831f62a33fd0c68c96985b01a41 Bjoern A. Zeeb 2026-06-01 04:58:00

LinuxKPI: pci detach: implement a proper detach (release) path

There are two paths in the LinuxKPI PCI code to instantiate a "pdev"
(LinuxKPI pci_dev).  One is using the FreeBSD bus framework and the
pdev will be the softc.
This commit starts cleaning up the detach path for just that case
to the best possible.

So far we did a lot of the work in linux_pci_detach_device(), which is
the internal handler of the detach function and little in the
(*release) callback (devres cleanup only).
The problem with that is, that we tear down resources which later in the
devres cleanup are needed.  With them not being there anymore we panic, e.g.,
in lkpi_dma_unmap < lkpi_dmam_free_coherent < lkpi_devres_release_free_list.
The solution is to migrate most of the cleanup work into the (*release)
callback, which will automatically be called when the device (kobj) reference
drops to zero.  The only work which should be done immediately is to let the
dirver do its cleanup;  this has to happen before we try to teardown the
resources, but also we do want this to happen when detach is called
(the first time).
One problem we have with the deferred cleanup of the remaining parts is
that we do not know upon calling pci_dev_put() whether this cleared
the last reference and triggered the cleanup or not but we cannot return
from the detach function with pending resources and dangling pointers,
which then may be used.  In order to work around this, we clear the
(*release) callback function when it is run and check for that in the
detach routine.  If the (*release) callback was not run, we refuse to
detach (force would be needed) as we'd rather keep the device than
risk a follow-up panic on leaked resources.  Given this should not happen
in a well programmed world, I believe it is fine to take that and log it
to let the user know.

Try to leave a few comments behind to help with understanding in the
future.

With this we can unload the mt7921 driver (or shutdown the system)
without panic.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    dumbbell
Differential Revision: https://reviews.freebsd.org/D57429
66b25ddf9125b2f3707e0f22b01b47bdff463fa7 Bjoern A. Zeeb 2026-06-01 23:59:01

LinuxKPI: 802.11: lkpi_80211_txq_tx_one() only pass sta if added to drv

If we are doing a direct (*tx) downcall, only pass sta as meta data
if it was added to the driver (via the state machine).  This prevents
us passing a sta not known to the driver leading to possible follow-up
complications/errors.  This will usually happen if (a) we are doing
software scanning, or (b) if net80211 decides to change the ni from
under us and sends a packet with the new ni.

Adjust a debug statement before to also have the added_to_drv field
in it to ease debugging.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
c6e70c68d2ce5cfbcace251ef6ed2f1eae912a74 Bjoern A. Zeeb 2026-07-11 13:35:31
g_eli: better handling of absent/disabled CPUs
Checking hlt_cpus_mask is a no-op, and the mask will be removed in the
next commit. However, we can use the more recent CPU_ABSENT() macro to
check the status.

Reviewed by:    olce
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58157
63d4f044225d1bb86767759b18c0ae63b25a9c03 Mitchell Horne 2026-07-13 19:15:00
smp: remove unused hlt_cpus_mask
It is a relic, apparently once populated by a machdep.hlt_cpus sysctl.
The sysctl was removed, and ULE has never honored this mask. It is now
safe to remove.

Remove the mask, and its few remaining references in: sched_4bsd(4),
hwpmc(4), and hwt(4).

Reviewed by:    olce, kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58158
df0aca0d73064a1a199dbae3857012951f96cf2d Mitchell Horne 2026-07-13 19:15:19
sched/lapic: remove sched_do_timer_accounting()
The check is always true, especially after the removal of hlt_cpus_mask
from sched_4bsd.

Reviewed by:    olce, kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58159
01f165c68103df22cebe26d410c1d4a0e5fae377 Mitchell Horne 2026-07-13 19:15:38
g_eli: disambiguate CPU-bound worker creation
This makes an effort to clarify and correct the intent of the code,
which is to either:

 1. Create one software crypto worker thread for each CPU, to be pinned
    later
 2. Create the number of threads requested by the kern.geom.eli.threads
    tunable

This is as described in geli(8).

If a CPU were somehow* absent, it should be skipped, but not in the
second case when creating a set number of threads.

To achieve this cleanly and correctly:
 - split worker creation logic into a helper function
 - keep the loops separate
 - debug message for absent CPUs is dropped
 - add a short explanatory comment
 - style, rename local var to 'nthreads'

*Practically, it is impossible today to get a bootable system with a
sparsely populated CPU map. Thus these concerns are hypothetical and
this change should have no functional effect.

Finally, while here, guard the sc->sc_workers list insertion with the
appropriate mutex. The code is safe from races today, but this gives a
better guarantee.

Reviewed by:    kib
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58214
185039d27252ae4ce7d6e3d68ba74907091cd565 Mitchell Horne 2026-07-13 19:15:49
linuxkpi: Add `acpi_video_get_edid()`
Like the rest of <acpi/video.h>, this function is unimplemented and
returns `-ENODEV`.

The amdgpu DRM driver started to use it in Linux 6.13.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57576
8909dd2141443625418593f6e63990965f5a2780 Jean-Sébastien Pédron 2026-06-12 14:00:07
exterrctl(2): add kern_exterrctl
Reviewed by:  kib
Effort:         CHERI upstreaming
Sponsored by:   DARPA, AFRL
Differential Revision:  https://reviews.freebsd.org/D58055
db3eca2be2067f7e81d65686b33dcbd475aed363 Brooks Davis 2026-07-15 08:43:50
Commit group #6: exterr: allow exterr to fit pointers on CHERI targets
exterr: allow exterr to fit pointers on CHERI targets

Switch to uint64ptr_t which is a uint64_t on traditional architectures
and a uintptr_t on CHERI architectures.  This has no ABI impact on
non-CHERI kernels.

Fix truncation of 64-bit values on 32-bit kernels.

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58056
844009378da9723180923bb5fc2008d137190b62 Brooks Davis 2026-07-15 08:44:03

exterr_set: sync the definition with the header declaration

This unbreaks buildkernel with TARGET=armv7 (32-bit arm). More work may be required
in order to unbreak `exterr_set` with 32-bit kernels.

Fixes:  https://cgit.freebsd.org/src/commit/?id=844009378da9 ("exterr: allow exterr to fit pointers on CHERI targets")
5cafd6213f145bbe2a70d55eb90a3d894e66115b Enji Cooper 2026-07-17 02:26:17

kern: fix compilation

uintptr64_t -> uint64ptr_t

Fixes:  https://cgit.freebsd.org/src/commit/?id=5cafd6213f145 (exterr_set: sync the definition with the header declaration)
9da8f0e0b4bd4fe4e60ddd2baf9294b28d155cc4 Adrian Chadd 2026-07-17 04:01:16
sys/exterrvar.h: forward declare struct thread
Remove dependency on sys/proc.h.

Reviewed by:    imp
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58235
b3b4763bc1ed328013498a958f0af53ceca2d495 Brooks Davis 2026-07-15 08:44:29
mbuf: make m_unshare() allow unmapped mbufs
m_unshare() had crashed if unmapped mbufs exist in the mbuf chain.
This was because memcpy() with mtod() was used without making sure that
the mbuf was mapped. Use m_copydata() that cares unmapped mbufs instead.

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D58189
f2202ab5abda7fb09538a1ceda77569b67d83084 KUROSAWA Takahiro 2026-07-15 08:28:00
linker: Recognize SHT_INIT_ARRAY sections as constructor sections
We do this already for ET_REL files, but it was missed here.  Note that
this function operates only on dynamically loaded files, not on
preloaded files.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58245
83181995593ac61796d7be63dcb241f5d80faa73 Mark Johnston 2026-07-15 14:59:22
kern: change several int types to bools
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
1f5fe8ad5293aad0308010d408dfdec6ab19e176 Konstantin Belousov 2026-07-15 17:01:20
sys/proc.h: remove spurious blank lines
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
a48a27532567b3ec2178110994f5cea245a54ac2 Konstantin Belousov 2026-07-15 17:30:51
kern/sys_process.c: remove extra ()
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
fed49793ddd197e3dd86c8456b39f569ab74b54c Konstantin Belousov 2026-07-15 20:57:44
fget_procdesc(): change error for non-procdesc type from EBADF to EINVAL
Sponsored by: The FreeBSD Foundation
MFC after:      1 week
e18844223d1eabb7e435ff9da20d88915d3f4675 Konstantin Belousov 2026-07-16 07:50:34
ptrace(2): PT_SET_SC_RET request
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58247
fd5faa5629aed98f4daee84063da3494c4d1eee9 Konstantin Belousov 2026-07-15 02:23:17
witness: fix operation without WITNESS_SKIPSPIN
Since malloc(9) even with M_NOWAIT is forbidden when we hold a spinlock,
we can't print detailed lock tree as the operation tries to allocate
memory.

Fixes:  https://cgit.freebsd.org/src/commit/?id=fb4b0c91195195561560bb2fb2c1ba8da81f7ccf
56ac3351c61f285ee5b8c9bd4411eeaeb20efe26 Gleb Smirnoff 2026-07-17 01:37:03
ktimer: Check for errors from realtimer_gettime()
clock_gettime(CLOCK_TAI) can fail, leaving *ovalue uninitialized.

Reported by:    Hazley Samsudin of GovTech CSG
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58225
2f1ec7d159cbe56d40e7b6d7fc4188c9079e1783 Mark Johnston 2026-07-17 13:08:33
vm_page: Fix dequeue on arches with weak ordering
A vm_page's a.queue field records the page queue index for the page
queue to which the page belongs.  The PGA_ENQUEUED flag indicates
whether the page is actually enqueued in that queue's TAILQ.  When
modifying the a.queue field, you need to hold the page queue lock for
the queue corresponding to the old value, unless the old value is
PQ_NONE.

Suppose a managed page is freed.  vm_page_free_prep() calls
vm_page_dequeue_deferred(), which checks whether the page belongs to a
queue; if so it schedules an asynchronous dequeue operation so that page
queue lock acquisitions can be batched if possible.

The dequeue operation must be completed before the page's plinks.q
fields are reused.  So, during page allocation, we call
vm_page_dequeue() to finish the dequeue operation.  Similarly, since the
buddy allocator uses the plinks.q fields for its own internal linkage,
vm_freelist_add() calls vm_page_dequeue().

_vm_page_pqstate_commit_dequeue() is the function which actually removes
the page from its queue.  It sets a.queue = PG_NONE and removes the page
from its queue.  However, the update to the page's atomic state is
relaxed, so on systems with store reordering, it may race with a
concurrent enqueue of the page into the buddy queues (probably more
likely) or a page queue.

Fix this: use a release store to update the page's queue state in
_vm_page_pqstate_commit_dequeue(), and make sure that vm_page_dequeue()
uses an acquire load when comparing m->a.queue == PQ_NONE.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296767
Reported and tested by: pkubaj
Reviewed by:    alc, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58261
d809a10218884162ed47c658233746c53a98b1aa Mark Johnston 2026-07-17 12:57:06
Commit group #7: LinuxKPI
LinuxKPI: skbuff: improve debugging

Deal with SKB_TRACE_FMT optional arguments; while here properly indent.

Add KASSERT to __skb_unlink() to catch incorrect skbuffs encountered
while debugging a wireless driver (which had other pre-conditions failing).

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
e5bcf7b99fcbe06d381525ffdd5027b846cdc1d3 Bjoern A. Zeeb 2026-02-03 22:13:24

LinuxKPI: skbuff: add skb_put_zero()

Add skb_put_zero() as a simple wrapper around __skb_put_zero().

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
32c983449a7c802bf47578d5304c6d505db7821a Bjoern A. Zeeb 2026-02-03 22:13:24

LinuxKPI: skbuff: implement napi_build_skb()

Implement napi_build_skb() around linuxkpi_build_skb().

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
b36460e5ec4659d0fa14b35c9342c5a154b3db7d Bjoern A. Zeeb 2026-02-03 22:13:24

LinuxKPI: skbuff: implement __skb_linearize()

skb_linearize() is used by mt7921, mt7925, and in the general mt76 tx dma
code. __skb_linearize() is used in the general iwlwifi TX code but given
the way we currently create TX skbs in LinuxKPI 802.11 we never hit that
case.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
9de11cc26ab61d7f80e8af84dbc55d8cbd6f832d Bjoern A. Zeeb 2026-02-03 22:13:24

LinuxKPI: skbuff: add support for frags in linuxkpi_skb_copy()

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
1e4ec01603c4b1e0b0eb524f28f731eb5cb5f6dc Bjoern A. Zeeb 2026-02-03 22:13:24

LinuxKPI: skbuff: add reference counting to the skb

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
cb13e826ec45e11e964e1921d281e0a06ca5e152 Bjoern A. Zeeb 2026-02-03 22:13:24

LinuxKPI: skbuff: add initial page pool support

Add an internal flag which is set by skb_mark_for_recycle() and upon
"skb_free" then selects whether the skb is freed or returned to the
page pool.
There will likely be more details to figure out once the LinuxKPI page
work is done and we support more of the page pool than the bare minimum.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
e4795d3dbee71c463429e2901dad111fbc2d08fc Bjoern A. Zeeb 2026-07-17 11:02:45
LinuxKPI: 802.11: stop ieee80211_start_tx_ba_session() if no HT supported
rtw89(4) would constantly try to start a TX BlockACK session even if no
HT or higher was available.  The only way to stop this (currently) is
to return -EINVAL instead of any other error.

Note: we should investigate if/when to call (*set_tid_config)() as that
will also offer the ability to forbid BA.

Sponsored by:   The FreeBSD Foundation
Reported by:    arved, bnovkov
Tested by:      bnovkov
MFC after:      3 days
8a1600428e937a41b65869c78ce847f7cabbad24 Bjoern A. Zeeb 2026-07-17 20:59:08
Commit group #8: vm_phys: Add a sysctl to dump registered fictitious memory ranges
vm_phys: Add a sysctl to dump registered fictitious memory ranges

I've wanted this a couple of times in the past.  Save the memattr in
the fictitious memory segment structure so that we can report it from
the sysctl handler, and add conversion routines for each platform.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58283
a7e483ee146a93ac89357676fdb9af62ac58b4bc Mark Johnston 2026-07-19 00:29:40

arm64: Fix the build

Fixes:  https://cgit.freebsd.org/src/commit/?id=a7e483ee146a ("vm_phys: Add a sysctl to dump registered fictitious memory ranges")
91b419bc7e15f2138cb211c4d7c5be118c377c20 Mark Johnston 2026-07-19 02:33:08

vm: Make sure NULL is defined for vm_memattr_name()

Fixes:  https://cgit.freebsd.org/src/commit/?id=a7e483ee146a ("vm_phys: Add a sysctl to dump registered fictitious memory ranges")
11edc985cd9c2e1dcceccb7e929c6921b4e20c9b Mark Johnston 2026-07-19 14:09:27
kern_ptrace(): reduce code duplication
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58334
9b21a52495758294e3a50542a59bc47a0c184173 Konstantin Belousov 2026-07-19 01:14:39
EVFILT_PROCDESC: support NOTE_FORK
Reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58292
e8d4d754e1c73b01c89580a26c22f982415c694a Konstantin Belousov 2026-07-16 00:49:02

Build system

Add sbintime.9 manual page
sbintime.9 is a manual page that documents the usage of sbintime_t and
its helper functions.

MFC after:      1 week
Reviewed by:    ziaee, markj
Differential Revision:  https://reviews.freebsd.org/D57931
c3f6c655dd155f4c84ce743c86e07d9f0b6b348a Ka Ho Ng 2026-07-13 00:21:01
mt76: further adjust debugfs compile time options
The debugfs options between the various modules (core and chipsets)
are not 100% de-coupled.  This means we may run into unresolveable
symbols at load time of the modules if we enable certain options
generally or for core but not for the chipset.
For now: always build the core module with debugfs support.
Migrate the CONFIG_MAC80211_DEBUGFS flag into the Makefile of each
chipset so we can individually turn it on.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
ec17c2454bf03f954e460bfe3c95e35f638ba71e Bjoern A. Zeeb 2026-07-11 13:40:29
acpi_einj: Add acpi_if.h to SRCS
This is included via acpivar.h so needs to be in SRCS to be generated.

Reported by:    bz
Fixes:  https://cgit.freebsd.org/src/commit/?id=bc49842769bd ("acpi_einj: Support for ACPI error injection")
Sponsored by:   Arm Ltd
237c69a9906e21b9992585ec8477d8d1cd616b7a Andrew Turner 2026-07-08 05:50:59
bsd.cpu.mk: Add a workaround for erratum 843419
Add a workaround for the Arm Cortex-A53 erratum 843419. This has been
targeted when the build is either unoptimised for any CPU/architecture
or targets the Cortex-A53 or ARMv8.0 architecture.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296240
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296395
Reported by:    Hal Murray <halmurray+freebsd@sonic.net>
Reported by:    Andreas Schuh <x55839@icloud.com>
Reviewed by:    cognet, mmel
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D58212
f1e8b0ff4e13b52c5e41a5eea3e686410af3dd0b Andrew Turner 2026-07-14 15:07:30
packages/sound: Add dependency on bsdconfig
Since the devd rules use sysrc, bsdconfig should be installed.

MFC after:      3 days
82aca8ef0dd73a09e46271158f822a7e49082cd0 Lexi Winter 2026-07-17 11:04:47
mt76: disable debugfs due to missing piece still in review
Until D57524 is not reviewed and committed we will have a missing
function declaration which prevents us to compile (in) debugfs for
mt76 core and mt7921.  Temporary disable debugfs again.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
c589dc4ef77d8e165e449a861c3705002ca4a762 Bjoern A. Zeeb 2026-07-14 06:39:12

Internal organizational stuff

Ignore the white-space-only change for decompress.c
Sponsored by:         Netflix
878bf20fa56a1785b00f6ec6fe3af240c585c2f5 Warner Losh 2026-07-13 20:25:00

Testing

subr_physmem_test: add tests for two edge-cases
Help validate my assertion that "physmem will never report empty
ranges". Part of this is covered by the existing tests, which check the
merging of adjacent/overlapping regions. The other part is to ensure
that addition of zero-sized ranges is ignored.

The physmem implementation also includes logic to ignore the first
physical page of memory (physical addresses 0 to PAGE_SIZE-1). Add a
second test case for this.

Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D45914
1b5ec2e466ee100161017ae2618f91829310f1d6 Mitchell Horne 2026-07-13 19:49:32
stress2: Added new test scenarios
9c6ed9a88d3afb8bc9aba7cf852cc36e03bcd34c Peter Holm 2026-07-14 07:27:42
awk/tests: xfail inf-nan-torture on riscv64
The fix for this is being tracked upstream here:
https://github.com/onetrueawk/awk/issues/269

While here, just cd into $SRCDIR while executing tests,
since the test engine isolates every testcase's working
directory. This ensures that the xfail actually applies
to the next command.

Reviewed by:    mhorne
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
d0b1a389003b1e6ff5bcf35a7c04654ea7ff87bd Siva Mahadevan 2026-06-23 17:12:16

Style, typos, and comments

These could go in other categories, but it's more clear if they're here instead.

thread_stopped(): style
Sponsored by: The FreeBSD Foundation
MFC after:      3 days
2038232e3e40cfc3dedba1a9f4a66984448eca1e Konstantin Belousov 2026-07-18 16:29:10

Contrib code

-- no commits in this category this week --

Reverted commits

Revert "chflags: Add a new UF_DONTCACHE flag"
This reverts commit 74654ba3b1b3bcf6ba8870a54310accbb6adbf0b.

Apparently it breaks cross building from Linux for some
reason.  I'll admit I didn't even know we supported cross
building from Linux.
88711f144170df4e8a4f3359c9e6089dad836951 Rick Macklem 2026-07-13 02:59:26
Commit & revert pair: pkg: Add -j and -r options
pkg: Add -j and -r options

This allows pkg(7) to be used to bootstrap a jail or chroot, and to
recognize the -j and -r options and pass them through to pkg(8) if
already bootstrapped.

Note that this does not address the issue of repository keys.  If using
a signed package repository, you will still need to copy /usr/share/keys
into the target environment before or after bootstrapping, or pkg will
be unable to verify package signatures.

MFC after:      1 week
Reviewed by:    imp, bapt
Differential Revision:  https://reviews.freebsd.org/D58165
d94e034d504682be56fc2e9d20ac2c0fe15b70ec Dag-Erling Smørgrav 2026-07-13 15:32:41

Revert "pkg: Add -j and -r options"

This reverts commit d94e034d504682be56fc2e9d20ac2c0fe15b70ec at the
request of des@, as it seems to have broken the pass-through case.
9dfaf1cb37f8ac89cf6dbfd1d6905c8d03722391 Kyle Evans 2026-07-13 22:08:58
Commit & revert pair: rk_gpio: defer level-IRQ EOI until source line is driven low
rk_gpio: defer level-IRQ EOI until source line is driven low

The previous PIC bring-up (ccda002ca10) added pic_disable_intr,
pic_enable_intr, pic_pre_ithread, and pic_post_ithread, but omitted
pic_post_filter.  Per the PIC contract pic_post_filter is non-optional;
a follow-up enforcement pass is planned that will panic() if any of the
three (pic_pre_ithread, pic_post_ithread, pic_post_filter) is missing.

This patch also fixes the EOI ordering for level-triggered IRQs (raised
by mhorne in the v1 review).  Writing PORTA_EOI before intr_isrc_dispatch
is correct for edge pins, but wrong for level pins: the source device
has not yet deasserted the line, so the latch immediately re-arms and
the controller storms.

  - rk_gpio_intr: EOI edge pins per-pin before dispatch (matches the
    pre-patch behavior for the common case); for level pins defer EOI
    to the post-dispatch path.  Stray (no consumer) level pins still
    get EOI'd here because no consumer will run to clear the source.
  - rk_pic_post_filter: new method, EOI level pins after the filter
    has read+cleared the source device's IRQ register.
  - rk_pic_post_ithread: EOI level pins after the ithread has driven
    the source low, before unmasking, so the chip latch is clean when
    we re-enable delivery.

Shape mirrors tegra_gpio(4) (sys/arm/nvidia/tegra_gpio.c).  No new
sysctls, no scaffolding.

Smoke-tested on RockPro64 (RK3399) with fusb302 INT_N (level-low GPIO
IRQ): IRQ rate steady at ~28/s under USB-C activity vs the 210 kHz
storm the original missing-mask bug produced.

Signed-off-by:  Kyle Crenshaw <B1nc0d3x@gmail.com>
Reviewed by:    mhorne
Fixes:  https://cgit.freebsd.org/src/commit/?id=ccda002ca10f ("rk_gpio: implement PIC masking methods and mask unhandled IRQs")
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2245
8ffb400bfd64102ac2a49639ccbbfffbe0c6f127 Kyle Crenshaw 2026-05-29 22:22:39

Revert "rk_gpio: defer level-IRQ EOI until source line is driven low"

There is a more correct / preferable scheme for handling of EOI.

Requested-by:   mmel

This reverts commit 8ffb400bfd64102ac2a49639ccbbfffbe0c6f127.
1aeb9d782ea15f4f70fe104beac6eea1d27c5d92 Mitchell Horne 2026-07-14 15:02:53

Unclassified commits

Not classified automatically, and waiting for manual attention.

-- no commits in this category this week --

Technical notes

Dates:

Automatic grouping:

Automatic categories:

Source code:


Generated with commits-periodical 0.20 at 2026-08-04 17:42:39+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-07-13 (debug) (contains info about the classification)