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 |
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.
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
Commits about commands found in man section 1 (other than networking).
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
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
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
This allows to use output of '/usr/bin/time -ao foo' as direct input to ministat(1). While here make diagnostic message more verbose.
Man pages, release notes, etc.
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58123
Document the global fetchTimeout variable, now that it works reliably. MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57910
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58247
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
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58292
Hardware drivers and architecture-specific code.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Migrated fwcam to use per-unit-directory child device Differential Revision: https://reviews.freebsd.org/D58202 Reviewed by: adrian
Migrated fwisound to use per-unit-directory child device Differential Revision: https://reviews.freebsd.org/D58203 Reviewed by: adrian
Migrated fwdv to use per-unit-directory child device Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58204
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Network-related commands, library, and kernel.
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")
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
Per sys/conf/files this unit is not compiled for a NOIP kernel.
Reported by: Alexander Sideropoulos <Alexander.Sideropoulos@netapp.com> MFC after: 1 week
This is exactly the same as the second part of IPv4's change 136c5e17b61a1/D49153.
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
- 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
Stuff in man section 8 (other than networking).
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
Somehow, I wound up with space indents rather than tab indents, so fix this. Sponsored by: Netflix
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
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
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
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")
These calls return an error value, they do not set errno. Check their
return values.
Sponsored by: Rubicon Communications, LLC ("Netgate")
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
- 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
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
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
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
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
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
Make fetch_ref() an inline and provide a fetch_deref(). MFC after: 1 week Reviewed by: op Differential Revision: https://reviews.freebsd.org/D57944
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
Reviewed by: zlei, vmaffione Obtained from: https://github.com/luigirizzo/netmap/commit/b52a2bcae35e56548acfb0849b248a1e4b0c0c3b MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58150
Reviewed by: zlei, vmaffione Obtained from: https://github.com/luigirizzo/netmap/commit/7d9177ed9a121e66bf4eaa0acb5d574e408297da MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58151
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
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)
Kernel stuff (other than networking, filesystems, and drivers).
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")
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
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
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
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
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
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
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
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
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
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
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
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
Reviewed by: kib Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D58055
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
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")
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)
Remove dependency on sys/proc.h. Reviewed by: imp Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D58235
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
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
Sponsored by: The FreeBSD Foundation MFC after: 1 week
Sponsored by: The FreeBSD Foundation MFC after: 1 week
Sponsored by: The FreeBSD Foundation MFC after: 1 week
Sponsored by: The FreeBSD Foundation MFC after: 1 week
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58247
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
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
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
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
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
LinuxKPI: skbuff: implement napi_build_skb() Implement napi_build_skb() around linuxkpi_build_skb(). Sponsored by: The FreeBSD Foundation MFC after: 3 days
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
LinuxKPI: skbuff: add support for frags in linuxkpi_skb_copy() Sponsored by: The FreeBSD Foundation MFC after: 3 days
LinuxKPI: skbuff: add reference counting to the skb Sponsored by: The FreeBSD Foundation MFC after: 3 days
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
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
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
arm64: Fix the build Fixes: https://cgit.freebsd.org/src/commit/?id=a7e483ee146a ("vm_phys: Add a sysctl to dump registered fictitious memory ranges")
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")
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58334
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58292
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
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
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
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
Since the devd rules use sysrc, bsdconfig should be installed. MFC after: 3 days
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
Sponsored by: Netflix
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
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
These could go in other categories, but it's more clear if they're here instead.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
-- no commits in this category this week --
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.
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
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.
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
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.
Not classified automatically, and waiting for manual attention.
-- no commits in this category this week --
Dates:
cgit.freebsd.org/src. Git accurately records the
order of commits, but not their dates.Automatic grouping:
This reverts commit \\b([0-9a-fA-F]{40})\\b
and the hash was found in this week's commits.
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)