This is a display of mostly-automatically-classified git commits from 2026-09-14 to 2026-09-20.
Table of contents and commits per category:
| (4) | Highlighted commits (these are copies, not in stats) | |
| 5 | 1.5% | Userland programs |
| 11 | 3.4% | Documentation |
| 158 | 48.5% | Hardware support |
| 20 | 6.1% | Networking |
| 17 | 5.2% | System administration |
| 5 | 1.5% | Libraries |
| 2 | 0.6% | Filesystems |
| 61 | 18.7% | Kernel |
| 8 | 2.5% | Build system |
| 4 | 1.2% | Internal organizational stuff |
| 1 | 0.3% | Testing |
| 3 | 0.9% | Style, typos, and comments |
| 28 | 8.6% | Contrib code |
| 3 | 0.9% | Reverted commits |
| 0 | 0.0% | Unclassified commits |
| 326 | 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.
MFC After: 1 week Approved by: dteske Reviewed by: dteske Differential Revision: https://reviews.freebsd.org/D59658
The size of multiple embedded structs have changed and may lead to problems (pci_error_handlers in pci_driver, dev_pm_info in struct device). Allow these changes to be detected by bumping __FreeBSD_version. MFC after: 3 days
mfi_drive_name() built the "Exx:Syy" drive location string using struct mfi_pd_info's encl_index field, the enclosure's firmware- internal position index. Broadcom's own storcli/MegaCli tooling instead leads with the enclosure's Device ID (EID) in its primary drive listing; encl_index only shows up as "Position" in a detailed per-enclosure view. Both numbers are raw, unmodified firmware values already fetched into struct mfi_pd_info/mfi_pd_address, but only encl_index was ever displayed or accepted as input, leading to confusion when cross-referencing drive locations against storcli output. Switch mfi_drive_name() and mfi_lookup_drive() to use encl_device_id instead, aligning FreeBSD's enclosure numbering with Broadcom's own utilities. Since mrsasutil(8) is the same binary as mfiutil(8) under a different name, this applies to both mfi(4) and mrsas(4) alike. This is a user-visible behavior change: the numeric value of "xx" in "Exx:Syy" now differs from before for any enclosure whose EID and position index don't match, affecting anyone scripting against the previous numbering. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294353 Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D59654
Use the Hyper-V reset/MAC exchange for 82576 and I350 VFs instead of the native posted mailbox protocol, which the Windows PF does not service. Read the host assigned address through configuration bytes 0x201 through 0x206 only during reset, and use it to identify the matching synthetic hn(4) interface. The operations are local to the VF frontend. Poll hardware link status rather than retaining a native mailbox link handshake. Leave MAC, multicast, promiscuous-mode, and VLAN membership policy with the host. Disable guest VLAN registration and native receive limit requests, and limit the VF to an MTU of 1500 bytes. Preserve accumulated statistics across host resets without counting a counter clear as a wrap. Reject inaccessible register samples and rebase after a reset indication or a disabled transmit queue, including when the PF blocks the queue for malicious driver detection. Document single queue support and host assigned access VLANs. Guest VLAN trunks are not supported: tagged transmissions with the Windows I350 PF driver 14.1.5.0 can disable VF queues even on a trunk-configured port, and the limitation was also reproduced with Windows VF drivers. Such trunks must use the synthetic path with SR-IOV disabled for that virtual adapter. Tested on Windows Server 2025 Hyper-V with both 82576 and I350 PFs. Relnotes: yes Sponsored by: BBOX.io
Commits about commands found in man section 1 (other than networking).
Reviewed by: fuz, dteske Approved by: fuz (mentor), dteske (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59666
The new ptrace(2) features allow to change truss(1) to systematically operate on the process descriptors instead of pids. Allocate the global kqueue that tracks all noted children by pdopenpid()-ing them and adding to the kqueue with EVFILT_PROCDESC/NOTE_PDSIGCHLD. The activated knote triggers the pdwait() call to return the child tracing info. This replaces the waitid(P_ALL) call in the non-capsicumized truss(1) eventloop. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58094
Reviewed by: fuz, dteske Approved by: fuz (mentor), dteske (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59754
Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59773
Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59774
Man pages, release notes, etc.
- sysutils/ataidle is no more: it was superseded by camcontrol(8). - Sort the models table alphabetically. - Use the SPDX License ID instead of the longhand licensing tort in the manpage header. - Note that the driver has been heavily modified in 15.1 and later to support additional platforms and functionality. - Trim down SYNOPSIS. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D59470
Netgraph document descriptions are all over the place, wordsmith them into a standard format of "%s netgraph node", trying to describe them better to enhance accessiblity of apropos results. Event: EuroBSDcon 2026 MFC after: 3 days Reviewed by: dteske, glebius Discussed with: des, dteske, glebius Differential Revision: https://reviews.freebsd.org/D59643
Document the full struct mlx5dv_context (cqe_comp_caps, sw_parsing_caps) and the mlx5dv_context_comp_mask enum in mlx5dv_query_device.3, and note that these caps are only valid when the matching comp_mask bit is asked for on input and returned on output. Sponsored by: NVidia networking MFC after: 1 month
MFC after: no Reviewed by: obiwac Differential Revision: https://reviews.freebsd.org/D59738
While here, improve HARDWARE, fix sysctl markup, and a grammatical typo. MFC after: 3 days
MFC after: 3 days
The documented VLAN and MAC filter limits are reversed. Match the defaults in the driver schema: 64 VLAN filters and 16 non-primary MAC filters per VF. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59027
Reviewed by: ziaee, kfv Differential Revision: https://reviews.freebsd.org/D59747
Reviewed by: ziaee, kfv Differential Revision: https://reviews.freebsd.org/D59746
Reviewed by: bcr MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D57515
Hardware drivers and architecture-specific code.
this fixes, 2 failed v4l2-compliances tests
selwakeup() only wakes select/poll waiters; it does not notify the kqueue knote registered on the device, so EVFILT_READ never fired when a frame became available.
mmu_radix_extract() walks the page tables without holding the pmap lock, unlike its hash MMU counterpart moea64_extract(). A concurrent unmap can free and recycle the page table page being walked, so the read returns whatever now occupies that memory and the caller gets a physical address that never existed. That is how mmu_radix_sync_icache() came to hand a bogus address to __syncicache() and panic the machine. Commit 1574ca1955f5 worked around it by taking the pmap lock in mmu_radix_sync_icache(), but the machine independent callers of pmap_extract() - vm_sync_icache(), proc_rwmem() and the vslock() paths - remain exposed to the same failure. Rename the existing body to mmu_radix_extract_locked(), which asserts the lock, and make mmu_radix_extract() a thin wrapper that acquires it. mmu_radix_sync_icache() already holds the pmap lock, so it calls the locked variant directly and neither recurses nor reacquires the lock once per page. Suggested by: alc MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59320 Reviewed by: markj, jhibbits
tpmcrb_transmit() read CRB_CTRL_STS before requesting locality 0. An AMD Pluton fTPM (like FrameWork Desktop) using the plain CRB start method reads the control area as all-ones until locality is assigned, so bit 0 looks like a stuck tpmSts and every command failed with EIO. With RANDOM_ENABLE_TPM the harvester retries every 10 seconds, so this printed "Device has Error bit set" forever. Reviewed by: kbowling Approved by: kbowling MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D59661
thunderbolt: Support writing to router config space Reviewed by: adrian, ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49452
thunderbolt: Factor out router_prepare_cmd() Common code between router_prepare_read() & router_prepare_write(). Eventually will be used by other commands (e.g. hotplugging) aswell. Reviewed by: ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59668
thunderbolt: Change len from int to size_t in router_prepare_{read,write}()
Suggested by: ngie
Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59668
thunderbolt: Account for CRC in router config write message size Fixes: https://cgit.freebsd.org/src/commit/?id=9c6e9bfb3474 ("thunderbolt: Support writing to router config space") Sponsored by: The FreeBSD Foundation
Always offer the VIRTIO_NET_F_GUEST_CSUM feature to the host, and not only if RXCSUM is enabled on vtnet. Instead of using RXCSUM to control whether this feature will be negotiated with the host, just use it to control whether the VIRTIO_NET_HDR_F_DATA_VALID flag on an incoming packet is processed (i.e., translated to the corresponding mbuf flag only if RXCSUM is enabled on the vtnet interface). This has two benefits: 1. Enabling/disabling RXCSUM on vtnet does not require feature renegotiation. 2. The host is always allowed to send locally generated TCP or UDP packets to the guest without computing a full checksum (by setting the VIRTIO_NET_HDR_F_NEEDS_CSUM flag) and not only if the guest has enabled RXCSUM on vtnet. Since locally generated packets do not require a checksum, this saves otherwise unnecessarily wasted computing power. If a user of a FreeBSD guest really does not want to negotiate the VIRTIO_NET_F_GUEST_CSUM feature with the host, it still can disable the loader tunable hw.vtnet.csum_disable. Reviewed by: kfv, tuexen MFC after: 1 week MFC to: stable/15 Differential Revision: https://reviews.freebsd.org/D59052
ufshci: tell the controller how long the EHS is The transfer request descriptor has a field for the total Extra Header Segment length. The driver left it at zero. A request that carried an EHS went out as the bare command UPIU, and the device answered a request it had only seen part of. Fill the field from the request UPIU header, which already carries the same length. Every other path sets it to zero, so nothing else changes. An EHS is the first thing that makes a request vary in size, so assert that the request and the response still fit in the command descriptor. Reviewed by: imp (mentor) Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D59557
ufshci: add a control device node The driver only exposed a CAM SIM. Userland had no way to reach the device for anything that is not a SCSI command, so reading a descriptor or an attribute was impossible. Add /dev/ufshci%d as a root only node and the ioctl ABI header for it. The node answers no ioctl yet. The header pulls in ufshci.h, which declares bool only under _KERNEL, so include stdbool.h for userland the way nvme.h already does. Reviewed by: imp (mentor) Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D59558
ufshci: add a passthrough ioctl This ioctl is for a port of ufs-utils: https://github.com/SanDisk-Open-Source/ufs-utils The driver only exposed a CAM SIM. Reading a descriptor, an attribute or a flag needs a query request, and a UniPro attribute needs a DME command. The driver built both only for its own setup, so userland could reach neither. Add two ioctls on the control node. UFSHCI_PASSTHROUGH_CMD sends a UPIU the caller built, sizes the request from its transaction code, and copies the response UPIU back. UFSHCI_PASSTHROUGH_UIC carries the four attribute commands and refuses the rest, which can drop the link or power the device off. It keeps the raw argument2 so the caller can read the result code the device reported, not just a failure. Validate the input and bound it by what the controller can map. The descriptor has no request length, so the controller reads it from the UPIU header, and a header that declares more than was copied in would reach past the descriptor. The ioctl layer copies output back only on a zero return. So a command that reached the device is a success even when it was refused. The caller reads the reason from the response header, and an answerless failure comes back as EIO. Clear the response before use so no stale bytes read as a device answer. Reviewed by: imp (mentor) Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D59559
ufshci: build the ioctl file into the kernel The passthrough ioctl went into the module build only. A kernel with device ufshci then failed to link, because ufshci_ctrlr.c calls ufshci_ioctl_construct() and ufshci_ioctl_destruct() and neither was compiled in. Add the file to sys/conf/files. Fixes: https://cgit.freebsd.org/src/commit/?id=28fefc441e3b ("ufshci: add a control device node") Sponsored by: Samsung Electronics
VF readiness can precede its first initialization. In particular, iflib populates if_hwassist during init, so copying it while the VF is still down can leave hn advertising checksum and TSO capabilities with no hardware-assist flags. The stack then uses software segmentation until a capability ioctl happens to refresh the copied state. Synchronize enabled capabilities and hardware-assist flags after the VF up ioctl succeeds, before switching the datapath and enabling transparent VF transmit. Use the existing helper in the common initialization path, covering both normal bring-up and delayed VF initialization. MFC after: 2 weeks Sponsored by: BBOX.io
The PCI_BUS_RELATIONS2 case lacks a break after queuing the reported devices. It consequently processes the same packet as PCI_EJECT, interpreting device_count as the slot number. If that value matches an existing child, the callback schedules an unintended device eject. End the relations case after processing the device list, matching the original PCI_BUS_RELATIONS handling. Fixes: https://cgit.freebsd.org/src/commit/?id=ea11861e434a ("arm64: Hyper-V: vPCI: Enabling v-PCI in FreeBSD in ARM64 Hyper-V") MFC after: 2 weeks Sponsored by: BBOX.io
Handle the host's VF association notifications instead of ignoring them. Require an allocated association before switching to the MAC-matched VF, and track notification generations so a withdrawal during initialization cannot enable an obsolete handoff. Defer association and address-event work to the VF taskqueue; the receive channel must remain available to deliver switch completions. Request and wait for the empty VMBus completion for SET_DATAPATH, checking submission and channel-revocation failures. Enable transparent VF transmit and select its link status only after the switch completes. Use the existing transaction lifetime and revocation handling, without a timeout that could leave a late completion referencing a freed request. Restore synthetic capabilities, TSO limits and hardware-assist flags on fallback, targeting hn rather than the departing VF. Block transparent transmit during handoff and after association withdrawal. Separate the attach delay from saved-setting readiness, permit delayed association to trigger initialization, and require a fresh handoff after NVS reattach. Stop and detach still close local VF access if returning to the synthetic path fails; such failures are logged, not reported as a successful switch. MFC after: 2 weeks Sponsored by: BBOX.io
Hold hn_vf_lock across the VF identity/state check and link publication. Otherwise an event can observe an enabled VF, pause during fallback, then overwrite the freshly reported synthetic carrier with stale VF state. Ignore events while switching or after the association generation changes. The link notification only queues further work, so the callback does not need the sleepable hn lock. Document that association serial numbers are currently diagnostic: hn_ismyvf() matches the VF by MAC, while notifications gate availability. MFC after: 2 weeks Sponsored by: BBOX.io
Hyper-V does not expose the normal Intel PF/VF mailbox. Import the Hyper-V operation overrides from DPDK and complete its reset callback with the configuration-space mechanism submitted by Microsoft. Route ixv operations through the operation table, use mailbox API 1.0, and limit this environment to one queue pair. Claim the 82599, X540, X550, X550EM-X, and X550EM-A Hyper-V device IDs listed by DPDK. Select the same path for the E610 Hyper-V subdevice identity defined there. For E610/Linkville, read the emulated VFLINKS-format status from PCI configuration space at offset 0x209. Older families retain the MMIO VFLINKS path. Treat receive-mode changes as host-owned no-ops and do not retry VLAN operations that Hyper-V permanently rejects. Limit the Hyper-V 82599 MTU to 1504 because its VF does not implement the X540 RLPML field. Use mailbox reset indications only to refresh cached Hyper-V link state. Hyper-V does not provide the mailbox handshake required to treat that indication as a request for an iflib reinitialization. Tested on 82599 and E610 (with a followup commit) with Windows Server 2025 Hyper-V. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=232472, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239849 Obtained from: DPDK (shared code) Sponsored by: BBOX.io Co-authored-by: Wei Hu <weh@microsoft.com>
Current Windows PF drivers do not emulate the E610 link-status query at PCI configuration offset 0x209. The installed Intel ixw 1.8.54.0 driver returns zero even with the physical port connected, leaving the VF at no carrier after an otherwise successful hn handoff. When the query returns zero, use VFLINKS for carrier only. Its speed field is not the negotiated E610 line rate: the tested 1 Gb/s port reports the default 10 Gb/s encoding. Publish an unknown speed instead, including in the verbose link-up diagnostic, and document this fallback. Keep nonzero PCI results authoritative and reject all-ones reads. Other Hyper-V families and the native E610 mailbox path are unchanged. A zero result cannot distinguish an unsupported query from a down link; in either case this fallback relies on the legacy carrier indication. The connected and disconnected ports reported VFLINKS.UP set and clear, respectively, while both returned zero from the PCI query. MFC after: 2 weeks Sponsored by: BBOX.io
Discover the Hyper-V queue grant through PCI configuration space for X550, X552, X553, and E610 VFs. The X550 family exposes a byte at 0x207; 0x208 is a separate DCB flag. E610 exposes a little-endian queue count word at those offsets. Accept grants of one, two, or four and use at most two symmetric queue sets, subject to the existing MSI-X resource limit. Keep one queue for invalid grants and for 82599/X540 Hyper-V VFs. The family gates and queue limits are snooped from Windows Intel VF bus traffic. Update the shared code queue max so stop disables every usable queue. Also program the receive length limit on every usable RX queue instead of only queue zero and retain the 82599 exception for that register field. MFC after: 2 weeks Sponsored by: BBOX.io
Some devices only apply a new sample rate once it has been read back, and produce no sound at all otherwise. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294803 Reported by: tatsuki_makino@hotmail.com Tested by: tatsuki_makino@hotmail.com MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D59616
parse_mw_buf() copies option names from privileged sysctl input into eight-byte stack buffers. Unbounded %s conversions permit option tokens longer than seven bytes to write past those buffers before the parser validates them. Limit each conversion to seven characters, leaving space for the terminating NUL. Signed-off-by: Yudi Yang <yudi.yang@rice.edu> Fixes: https://cgit.freebsd.org/src/commit/?id=96f556f5044a ("NTB Tool: Test driver for NTB hardware drivers.") Reviewed by: markj MFC after: 1 week
Calling vector_state_store_savectx() overwrites ra with the address of the following ret instruction. The ret consequently branches to itself and prevents kernel dumps from progressing past dump_savectx(). Tail-call vector_state_store_savectx() so that it returns directly to the original savectx() caller. Reviewed by: br, jrtc27 Approved by: jrtc27 Fixes: https://cgit.freebsd.org/src/commit/?id=d7a393095cfd ("riscv: Vector Extension (RVV) support.") Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59689
The larger CQE exports the RSS header to userspace. Note that this changes the ABI between the driver and library, so the ABI version is bumped. A new user->kernel create_cq request message is defined to disallow a CQE size mismatch between iw_cxgbe and libcxgb4. Sponsored by: Chelsio Communications Co-authored-by: Steve Wise <swise@opengridcomputing.com>
Sponsored by: Chelsio Communications
Sponsored by: Chelsio Communications
This work request permits combining RDMA WRITE and SEND_INV commands into a single work request. Sponsored by: Chelsio Communications
To optimize NVME-oF READ IOPs, use a specialized work request that combines a RDMA WRITE and SEND_INV chain into a single request. Sponsored by: Chelsio Communications Co-authored-by: Potnuri Bharat Teja <bharat@chelsio.com>
- Only insert drain CQEs if a work queue is flushed - Preserve the request opcode of the original request when flushing a request. Use bit 10 of the CQE header word to indicate the CQE is a special drain completion, and save the original WR opcode in the cqe header opcode field. - If a work request chain was posted and needed to be flushed, only the first request in the chain was completed with FLUSHED status. The rest were never completed. - When a CQ is shared by multiple QPs, c4iw_flush_hw_cq() needs to acquire the corresponding QP lock before moving the CQEs into its corresponding SW queue and accessing the SQ contents for completing a WR. - Once a user QP has been flushed, it cannot be flushed again. Sponsored by: Chelsio Communications Co-authored-by: Steve Wise <swise@opengridcomputing.com>
Allocate wait objects dynamically and add a refcount instead of allocating them on the current thread's stack. This permits c4iw_wait_for_reply() to safely fail with an error and mark the device as dead if a reply is not received after C4IW_WR_TO seconds. Once a device is marked dead, future requests fail immediately. Sponsored by: Chelsio Communications
pio_copy() is suppose to be used for write-combining work requests. However, for some architectures like powerpc and arm64, write[ql]() include an explicit memory barrier which will flush the WC buffer and render this path useless. To prevent that use the relaxed variant. Sponsored by: Chelsio Communications
Obtained from: Linux commit f215a3d2448ae77253f0b93dcc37114779f51778
Obtained from: Linux commit 52e124c27e7bfb78980189bdfec049594d7612be Obtained from: Linux commit 2f43129127e62b25f56ff82a37c40b42c0e6f883 Obtained from: Linux commit 7a268a93973c07f93e952d96c2faa88df8ed38d8 Sponsored by: Chelsio Communications Co-authored-by: Potnuri Bharat Teja <bharat@chelsio.com>
Obtained from: Linux commit e00b64f7c54c4cbd88143bbd43e7c3d61a090e5c Obtained from: Linux commit 89944450547334aa6655e0cd4aec8df1897a205a
Obtained from: Linux commit 5f818d676ac455bbc812ffaaf5bf780be5465114
Add await in destroy_qp() so that all references to qp are dereferenced and qp is freed in destroy_qp() itself. This ensures freeing of all QPs before invocation of dealloc_ucontext(), which prevents loss of in use qpids stored in the ucontext. Obtained from: Linux commit f70baa7ee3d1b5a9e66ac7549e31641a656f23c1 Sponsored by: Chelsio Communications
Part of the original Linux commit was already applied during a prior OFED update in commit b633e08c705fe43180567eae26923d6f6f98c8d9, but this portion of the changes to the Linux iw_cxgb4 driver were not included. Obtained from: Linux commit a52c8e2469c30cf7ac453d624aed9c168b23d1af
Obtained from: Linux commit 4c44d4634b5c90993fccca9f155347221df6f877
Obtained from: Linux commit 3840c5b78803b2b6cc1ff820100a74a092c40cbb
These include changes to use newer APIs, cosmetic changes to reduce diffs between the two drivers, and other minor fixes. Sponsored by: Chelsio Communications Co-authored-by: Arjun V <arjun@chelsio.com> Co-authored-by: Krishnamraju Eraparaju <krishna2@chelsio.com> Co-authored-by: Vishal Kulkarni <vishal@chelsio.com>
While here, fix incorrect frees in error paths in c4iw_alloc_context(). Sponsored by: Chelsio Communications
Add an amd64-only, Intel-only diagnostic driver that reads ME Host Firmware Status registers from PCI configuration space without mapping the messaging BAR. Select the HFS register count per device generation, decode sparse HFS1 state, mode, and error fields, and expose raw and summarized status via sysctl. Register an ISA-side hfstsfd probe for supported RCBA/FD2 generations so firmware-hidden HECI functions can be diagnosed. Reviewed by: kbowling, adrian Differential Revision: https://reviews.freebsd.org/D58863
Replace direct IFF_DRV_RUNNING reads in igbv, ixgbe, ixv, iavf, ixl, ice, bnxt Ethernet, aq, enic and the axgbe PCI frontend with iflib_is_running(). Keep each existing mailbox-ready, fault-state, link-state and administrative-up condition: framework admission is not a substitute for device specific readiness. This covers interrupt admission, operational link publication, VF mailbox and VLAN replay, and live-configuration decisions. Remove ifnet temporaries used only to read the driver flags. Replace the em and igc debug dumps' RUNNING/OACTIVE text with one framework admission snapshot. OACTIVE does not mean that the interface or hardware is inactive. Label the result as software admission rather than link state or proof that DMA has stopped, and retain the queue head/tail dumps and separate RS diagnostics. Keep the filter register and requested interface flags in the axgbe PCI promiscuous-mode trace, but remove its unrelated legacy driver flags. Use the parent Ethernet PF context for the bnxt RDMA running check, retaining the link-state check and the existing IB_PORT_ACTIVE policy. Both current RDMA construction paths use the PF netdev, and Ethernet detach synchronously removes the RDMA auxiliary child before iflib frees that context. Declare the direct iflib module dependency. This does not transfer ownership of RDMA queues to iflib. Leave the independent, non-iflib axgbe ARM frontend unchanged. Reviewed by: iflib (gallatin) MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59601
After a link speed change updates TSO capabilities, request a restart when iflib is running or the interface is administratively up. Leave an administratively down, stopped interface to apply the change at its next initialization. Do not infer initialization from IFF_DRV_OACTIVE, which also remains set after stop and failed initialization. Use iflib_is_running() for software admission and IFF_UP for intent; iflib retains responsibility for quiescing any partially initialized queues before restarting. This also permits a restart request for an administratively up interface before its first initialization attempt. Reviewed by: iflib (gallatin) MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59599
A typo in the sysctl for RPI0 PWM channel 2 was causing it to write to the wrong register, leaving it misconfigured if used. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298301 MFC after: 3 days (problem reported on 14.4) Reviewed by: adrian Reported by: Attila Kover <attila.kover@guardian.co.uk> Differential Revision: https://reviews.freebsd.org/D59644
The ACPI quirk on Framework Laptop 12 firmware was previously clocked at ~620 ms for a Notify 0x80 replayed on power-button press to wake. However, when KMS is not loaded, that very same notification comes in past the 1s we previously allowed. Use the already-defined ACPI_MINIMUM_AWAKETIME (5) seconds as our new boundary so that we can successfully come out of S3 on this hardware. Introduce new tunable hw.acpi.button_replay_window Reviewed by: obiwac, olce Differential Revision: https://reviews.freebsd.org/D59583
[PATCH 04/31] FreeBSD OFED support for DPDK MLX5 PMD a) Expose raw packet capabilities in the core layer to enable a device to report it. Two existing capabilities, scatter FCS and IP CSUM were added to this field for a better user experience by exposing the raw packet caps from one location. This field will serve also for future capabilities for raw packet QP. A new capability was introduced - cvlan stripping, which is the device's ability to remove cvlan tag from an incoming packet and report it in the matching work completion. b) Check device's capabilities and report which raw packet capabilities are supported. c) Allow creating a WQ with cvlan stripping considering device's capabilities. The default value was fixed to disable vlan stripping till was asked explicitly. In addition, allow modification of a WQ to turn on/off this property. d) Enable creating a RAW Ethernet QP with cvlan stripping offload when it's supported by the hardware. e) Add support for creation of a WQ with scatter FCS capability, if this capability is supported by the hardware. Differential revision: https://reviews.freebsd.org/D32178 MFC after: 1 month
Fix is based on upstream Linux commit 2978975ce7f1 ("RDMA/mlx5: Process
create QP flags in one place").
Add IB_QP_CREATE_SCATTER_FCS and IB_QP_CREATE_CVLAN_STRIPPING to the
create_kernel_qp() allowlist, so a kernel RAW_PACKET QP using these flags
is no longer rejected with -EINVAL even though create_qp_common() supports
them. The flags arrived in 358e42ea66e2 and e4cc4fa7cca9, neither of
which updated this mask; upstream only fixed that later, as part of a much
larger refactor that is not worth importing, so the minimal equivalent is
done here.
Sponsored by: NVidia networking
MFC after: 1 month
[PATCH 05/31] FreeBSD OFED support for DPDK MLX5 PMD FreeBSD doesn’t allow userspace to send ioctl call for configuring allmulti mode. Added ALLMULTI flag in mlx5en. In MLX5 PMD, allmulti mode will be enabled/disabled in DPDK only if allmulti is supported by the mlx5en. it won't be changed on network interface side. Differential revision: https://reviews.freebsd.org/D32179 MFC after: 1 month
Import Linux upstream commit 572f46bf947c ("IB/mlx5: Refactor CQE
compression response").
Report the CQE compression capabilities only when the device supports
compression, instead of always advertising supported_format = HASH|CSUM
next to a max_num of 0.
Sponsored by: NVidia networking
MFC after: 1 month
[PATCH 07/31] FreeBSD OFED support for DPDK MLX5 PMD A drop rule is described by an action drop and no destination. If a user specified IB_FLOW_SPEC_ACTION_DROP then set the action to MLX5_FLOW_CONTEXT_ACTION_DROP and clear the destination. Differential revision: https://reviews.freebsd.org/D32181 MFC after: 1 month
Fix is based on upstream Linux commit a22ed86cff36 ("IB/mlx5: Add drop
flow steering rule support").
Initialise is_drop to false so a non-DROP flow cannot inherit stack
garbage, and pass no destination to mlx5_add_flow_rules() for drop rules
instead of one with num_dest = 1, which the flow steering core
dereferences. Both were lost in the original backport.
Derive the destination count from dst as well, so the dont-trap path,
which calls create_flow_rule() with a NULL destination, no longer asks the
core to walk a destination array that is not there.
Sponsored by: NVidia networking
MFC after: 1 month
[PATCH 08/31] FreeBSD OFED support for DPDK MLX5 PMD a) Refactor the netdev notifier registration into a small helper function. This is a pre-step towards having mlx5 IB device over an Ethernet port which doesn't support RoCE. Also, renamed the de-registration helper and the new helper as netdev notifier and not roce, to make it clear this is not only used with roce. b) Rename RoCE related helpers to reflect being Eth ones This is a pre-step towards having mlx5 IB device also over Eth ports where RoCE is not supported. We change the roce enable/disable and roce_lag init/fini function names to have _eth instead of _roce. c) Support RAW Ethernet when RoCE is disabled On some environments, such as certain SRIOV VF configurations, RoCE is not supported for mlx5 Ethernet ports. Currently, the driver will not open IB device on that port. This is problematic, since we do want user-space RAW Ethernet (RAW_PACKET QPs) functionality to remain in place. For that end, enhance the relevant driver flows such that we do create a device instance in that case. Differential revision: https://reviews.freebsd.org/D32182 MFC after: 1 month
Hold a reference on the netdev recorded in dev->roce.netdev and drop it when the entry is replaced or torn down, and register the netdev notifier before the initial interface scan. Otherwise the stored pointer can dangle, and an interface appearing during the scan can be missed. Sponsored by: NVidia networking MFC after: 1 month
PATCH 09/31] FreeBSD OFED support for DPDK MLX5 PMD HyperV is not enabling ROCE by default causing the OFED to not create few SYSCTL variables that publish kernel interface name. Due to this MLX5 PMD is not able to read kernel interface name to get MAC address. Added new sysctl variable in MLX5_EN driver to map the device name to the interface name. Differential revision: https://reviews.freebsd.org/D32183 MFC after: 1 month
Mark the new "ifname" sysctl MPSAFE and use strlcpy() so the interface name it returns is always NUL-terminated. Sponsored by: NVidia networking MFC after: 1 month
[PATCH 10/31] FreeBSD OFED support for DPDK MLX5 PMD Adding UIO driver that exposes the synthetic network device resources to userspace for application such as DPDK can drive it. Added rescind CB capability to the VMBUS driver. Whenever the hypervisor wants to close the device channel, VMBUS on receiving this msg, calls the CB of the device driver (hv_uio in our case). Differential revision: https://reviews.freebsd.org/D32184 MFC after: 1 month
[PATCH 12/31] FreeBSD OFED support for DPDK MLX5 PMD a) When enabling many VFs, the total amount of DMA mappings increase significantly. This causes DMA allocations to take a lot of time since they are serialized in the kernel. As a result the driver enters into fatal condition due to timeout and the system hangs. To recover from this we disable MR cache for VFs. This also resolves Rx-Error MLX5 PMD issue. PFs will still have a full cache and VFs cache can be manipulated as usual after driver load. b) The fast_registration length is used to convey length for memory registrations through UMR which can be of any size up to 2^64. Change the length type to be u64. Differential revision: https://reviews.freebsd.org/D32186 MFC after: 1 month
Import Linux upstream commits 37da2a03c036 ("RDMA/mlx5: Use proper spec
flow label type") and 0f750966dca8 ("IB/mlx5: Add inner spec and IPv6
validation in user's flow attribute list").
The first widens set_flow_label()'s mask and value to u32, so the 20-bit
IPv6 flow label is no longer truncated to 8 bits. The second validates
the ethertype of inner flow specs as well as outer ones, and adds the IPv6
ethertype checking this tree was missing.
Sponsored by: NVidia networking
MFC after: 1 month
Report sw_parsing_caps using the same condition that enables software parsing on the SQ (both eth_net_offloads and swp), so what we advertise matches what the driver actually does. Sponsored by: NVidia networking MFC after: 1 month
Import Linux upstream commit ccc870879027 ("IB/mlx5: Allow creation of a
multi-packet RQ").
Only the create_rq() part was missing: the striding RQ parameters we
validate and store on the WQ never reached the firmware. Program
two_byte_shift_en, single_stride_log_num_of_bytes and
single_wqe_log_num_of_strides, with the two log values encoded relative to
their MLX5_MIN_* bases so the 3-bit firmware fields do not truncate them.
Upstream renamed these WQ context fields later on, so the names used here
are the ones this tree's mlx5_ifc.h still carries.
Sponsored by: NVidia networking
MFC after: 1 month
Drop the unused MLX5_IB_QP_TUNNEL_OFFLOAD flag. Tunnel offload is driven by qp->tunnel_offload_en, so the enum bit was dead and misleading. Also advertise MLX5_RX_HASH_INNER in query_device()'s rss_caps.rx_hash_fields_mask, so user space can discover inner RSS. Sponsored by: NVidia networking MFC after: 1 month
[PATCH 29/31] FreeBSD OFED support for DPDK MLX5 PMD a) Add ib_uverbs_flow_spec_gre to define the rule to match GRE encapsulation protocol. The spec includes the generic specs header, type, size and reserved fields while the filter itself is defined as ib_uverbs_flow_gre_filter and includes: - Checksum present bit, key present bit and version bits in a single 16bit field. - Protocol type field - Indicates the ether protocol type of the encapsulated payload. - Key field - present if key bit is set and contains an application specific key value. b) IB/uverbs: Expose MPLS flow spec to user-kernel ABI header Add ib_uverbs_flow_spec_mpls to define the rule to match MPLS protocol. The spec includes the generic specs header, type, size and reserved fields while the filter itself is defined as ib_uverbs_flow_mpls_filter and includes a single 32bit field named 'label' which consists of: Bits 0:19 - The MPLS label. Bits 20:22 - Traffic class field. Bit 23 - Bottom of stack bit. Bits 24:31 - Time to live (TTL) field. c) IB/mlx5: Add support for GRE flow specification This patch introduces support for the GRE flow spec and allowing the creation of rules based on the protocol and key fields that are part of GRE protocol header. d) IB/mlx5: Expose MPLS related tunneling offloads This patch reports the device's capbilities to offload encapsulated MPLS tunnel protocols to user-space: - Capability to offload MPLS over GRE. - Capability to offload MPLS over UDP. Differential revision: https://reviews.freebsd.org/D32204 MFC after: 1 month
Import Linux upstream commit a93b632c4531 ("IB/mlx5: Fix GRE flow
specification").
Honour the user-supplied GRE protocol mask instead of hard-coding 0xffff,
so wildcard and partial masks work.
Also give flow_spec_data[] 8-byte alignment, so this userspace copy of
struct ib_uverbs_flow_spec_hdr matches the kernel UAPI on 32-bit builds.
The kernel header has always used __aligned_u64 here and only our copy
diverged, so there is no upstream commit for that half. The attribute is
spelled out instead of introducing an __aligned_u64 macro, which
<infiniband/types.h> does not provide and which libbnxtre already defines
for itself.
Sponsored by: NVidia networking
MFC after: 1 month
acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume If amdsmu(4) is not loaded when entering suspend-to-idle and on an AMD CPU, emit a warning. FreeBSD currently only supports S0ix on AMD CPUs through the SMU. When Intel support is completed, we should check the equivalent for Intel (intelpmc). Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59672
acpi: Don't compile CPU_VENDOR_{AMD,HYGON} cases on non-x86_64
Fixes build on aarch64.
Fixes: https://cgit.freebsd.org/src/commit/?id=5f68acc931a4 ("acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume")
Sponsored by: The FreeBSD Foundation
acpi: Fix unused variable error Fixes: https://cgit.freebsd.org/src/commit/?id=9b4caca81de2 ("acpi: Don't compile CPU_VENDOR_{AMD,HYGON} cases on non-x86_64") Sponsored by: The FreeBSD Foundation
acpi: Don't check suspend-to-idle if suspend failed If we e.g. failed to suspend a device and suspend bounced because of that, then we're not expected to have entered a deep sleep state in the first place. In this situation, don't overload the user with irrelevant information. Reviewed by: olce Fixes: https://cgit.freebsd.org/src/commit/?id=5f68acc931a4 ("acpi: Warn if no amdsmu(4) loaded after suspend-to-idle resume") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59731
Sponsored by: The FreeBSD Foundation
Use the Hyper-V reset/MAC exchange for 82576 and I350 VFs instead of the native posted mailbox protocol, which the Windows PF does not service. Read the host assigned address through configuration bytes 0x201 through 0x206 only during reset, and use it to identify the matching synthetic hn(4) interface. The operations are local to the VF frontend. Poll hardware link status rather than retaining a native mailbox link handshake. Leave MAC, multicast, promiscuous-mode, and VLAN membership policy with the host. Disable guest VLAN registration and native receive limit requests, and limit the VF to an MTU of 1500 bytes. Preserve accumulated statistics across host resets without counting a counter clear as a wrap. Reject inaccessible register samples and rebase after a reset indication or a disabled transmit queue, including when the PF blocks the queue for malicious driver detection. Document single queue support and host assigned access VLANs. Guest VLAN trunks are not supported: tagged transmissions with the Windows I350 PF driver 14.1.5.0 can disable VF queues even on a trunk-configured port, and the limitation was also reproduced with Windows VF drivers. Such trunks must use the synthetic path with SR-IOV disabled for that virtual adapter. Tested on Windows Server 2025 Hyper-V with both 82576 and I350 PFs. Relnotes: yes Sponsored by: BBOX.io
If a TLS request transmits all but a part of the GMAC at the end of a TLS record, the work request asks the crypto engine to return the calculated GMAC to the driver so it can be sent in a simple TCP packet when the rest of the TLS record is transmitted in the future. However, the offset of the returned GHASH offset was calculated incorrectly in this case causing the driver to not recognize the cached GMAC and instead use a more wasteful work request in the future that encrypted the entire TLS record discarding all but the needed bytes of the trailer. Note that this does not effect correctness, just efficiency. Reviewed by: np Fixes: https://cgit.freebsd.org/src/commit/?id=9e269eafebfc ("cxgbe: Use partial GCM mode for partial TLS records on T7") Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D59711
The Windows PF can disable a VF transmit queue while continuing to report carrier up. Link polling alone then leaves the VF operationally up even though it cannot transmit. The reproduced VLAN failure shows this state with PF driver 14.1.5.0 and an MDD indication in the host trace. Check queue zero from the admin path only while the Hyper-V VF is running with sanitized queues and a completed host handshake. Report operational link down and invalidate the statistics baseline when the queue is disabled. Request recovery through the normal iflib stop/init path only when a fresh, accessible STATUS read reports carrier up. Rate limit requests if the host continues to hold the queue disabled, and leave recovery pending while carrier is down. Document the recovery behavior and clarify why the Hyper-V reset retains the VF-local software reset before its host reset/MAC exchange. Sponsored by: BBOX.io
The Intel shared code can wait for firmware resources while holding its OS abstraction locks. FreeBSD mapped these locks to mutexes, which cannot be held across a voluntary sleep. Concurrent PF rebuilds therefore trigger WITNESS when RSS profile updates contend for the firmware change lock. Map the shared-code lock abstraction to exclusive sx locks. This also covers tunnel and flow-profile operations which can reach the same firmware wait while serialized. Validated with WITNESS on a dual port Intel E835. Sixteen CORE resets rebuilt both PFs without lock warnings, reset failures, or watchdogs. Ten interface down/up cycles and twenty promiscuous-filter cycles also completed cleanly. Reviewed by: erj MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59339
VLANs configured on the synthetic interface do not otherwise reach the accelerating VF's VLAN callbacks. Those callbacks can be needed for hardware filter membership or for interpreting stripped VLAN tags, even though no vlan interface is attached directly to the VF. Subscribe to VLAN events only in transparent mode and schedule the existing VF task. Snapshot the synthetic interface's VLAN topology under network epoch, then leave epoch before invoking the VF callbacks, which may sleep. Do not acquire hn_lock or configure the VF from a VLAN event handler; the worker applies membership outside the VLAN configuration lock. Keep an applied-VID bitmap under hn_lock and relay only changes. Replay VLANs configured before VF arrival, reconcile changes while acceleration is active, and preserve membership across temporary datapath switches. This relays guest intent; it does not configure host access VLAN policy or overcome PF restrictions on tagged traffic. Block initialization while either interface is detaching. Deregister VLAN handlers before draining work, remove registrations when hn leaves a live VF, and discard the applied bitmap when the VF itself departs. MFC after: 2 weeks Sponsored by: BBOX.io
The transparent VF capability handler ignored the requested change and only copied the VF's enabled capabilities. Forward SIOCSIFCAP to the VF and return its result. Preserve VF capabilities which hn does not expose. Limit advertised capabilities to those supported by the transparent packet path and VLAN relay. Do not inherit VF services such as send tags or the extended capability ioctl when hn has no corresponding methods. At handoff, adopt the VF's enabled offloads without reconfiguring it. Mark the datapath as switching while the VF applies a capability change, since its ioctl may reinitialize the device. If the association is still ready and unchanged afterwards, synchronize hn with the actual VF state even on error and restrict checksum assistance to the forwarded offloads. Republish link state suppressed during the transition when the VF is still ready. Refresh VLAN child capabilities after adoption and when restoring the synthetic path. Run the VF capability ioctl without hn_lock to avoid reversing the VLAN configuration lock order. Hold an ifnet reference, serialize capability changes and VF initialization, and make detach wait with hn_lock released. Revalidate the VF association before publishing the result. Defer VLAN-child capability notifications to the existing VF taskqueue so they also run without hn_lock, and drain that work before ifnet teardown. MFC after: 2 weeks Sponsored by: BBOX.io
Use the key and lookup table lengths returned by GET_VF_RESOURCES when configuring RSS through virtchnl, as DPDK does. The Windows E835 PF advertises a 40-byte key and rejects our fixed 52-byte CONFIG_RSS_KEY request, leaving receive traffic on queue zero. Validate the negotiated lengths before constructing AdminQ messages and publish the lookup table size to iflib. Preserve register-mode RSS selection and its fixed hardware sizes. Use aligned, zero initialized key storage so an RSS kernel's 40-byte key does not leave an uninitialized tail when the PF requests 52 bytes. Validation: normal and RSS enabled iavf module builds passed. On an E835 VF under Hyper-V Server 2025, repeated IPv4 and IPv6 receive tests used all three configured guest RX queues in both transparent hn and non-transparent lagg modes. The RSS key rejection disappeared, IPv4 transmit tests passed, and no TX watchdog fired. Each traffic case used three runs of 16 streams. Obtained from: DPDK (negotiated RSS sizing) MFC after: 2 weeks Sponsored by: BBOX.io
ice_msix_admin() runs as an interrupt filter inside a critical section. ice_rdma_notify_pe_intr() acquires the global RDMA sx and invokes the client event handler, both of which require sleepable thread context. A PE or HMC critical error could therefore panic under WITNESS or sleep from interrupt context. Accumulate OICR causes atomically in the interrupt filter and mark them pending in the driver state. Deliver the notification from the iflib admin task before processing reset events. This preserves the existing ordering, lets an iRDMA-requested reset run in the same admin pass, and coalesces causes from multiple interrupts. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59340
ice marked every transmitted packet RS and recorded every last descriptor in its report-status queue. Hardware therefore wrote descriptor status for every packet, and the driver traversed every packet while reclaiming completed descriptors. iflib marks selected packets with IPI_TX_INTR as completion checkpoints. It forces a checkpoint as deferred work or ring pressure grows. Retain EOP on every packet, but set RS and record the descriptor only at those checkpoints. DPDK uses the same sparse-RS design and defaults tx_rs_thresh to 32. Let iflib choose the adaptive interval for FreeBSD. This reduces PCIe and memory traffic while preserving bounded descriptor reclamation. Validated on an E810-XXV in an A-B-A test with five matched four-stream, TSO-disabled transmit runs per phase. Median throughput was 9.413, 9.413, and 9.414 Gbps. Median whole-system CPU was 21.54%, 17.75%, and 21.62%, respectively. The candidate used less system CPU than both exact-baseline phases in every pair. Interrupt rate was unchanged, no transmit watchdog fired, and normal TSO traffic remained line-rate. DTrace confirmed that only iflib-selected packet-final descriptors carried RS after the change. The effect should be more profound at 200Gbps but my DUT is network limited. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58910
The transmit stop loop cleaned the receive completion ring, and the receive stop loop cleaned the transmit completion ring. Use enic_cq_wq() for transmit queues and enic_cq_rq() for receive queues, matching the queue indices used by the remaining ring bookkeeping. MFC after: 2 weeks Sponsored by: BBOX.io
Do not publish a running interface after vnic_dev_enable_wait() fails. Run the existing stop cleanup for the queues configured before the enable request, then report initialization failure to iflib. Mark those queues as needing cleanup before submitting the enable request so the stopped-state shortcut cannot skip the unwind. MFC after: 2 weeks Sponsored by: BBOX.io
Serialize cached DMA coalescing policy with initialization and schedule its application through the admin task. The old running check preceded if_init() acquiring the context lock, so an intervening down operation could be followed by an unconditional initialization. Use the deferred if-up request so restart permission is checked when the task runs. Changes made while stopped or suspended remain cached for the next initialization. Do not schedule a reset for an unchanged value. MFC after: 2 weeks Sponsored by: BBOX.io
Cache a validated flow control setting without touching hardware when iflib has closed admission. The queues may still be live pending a watchdog stop, or the device may already be stopped or suspended. RX initialization and link setup replay the cached flow control policy. For live updates, decide once under the context lock whether to touch hardware, then mask MDD around SRRCTL writes regardless of a concurrent watchdog closing admission. The context lock excludes actual stop and reinitialization while these writes are in progress. MFC after: 2 weeks Sponsored by: BBOX.io
Raw VSI statistics belong to the firmware-assigned counter index and are reset when firmware recreates the VSI. Reusing a baseline across either event makes a counter decrease look like a full width rollover. Reset the PF and main VSI baselines when rebuilding hardware resources. Start a new baseline when firmware assigns a different PF counter index and whenever it allocates a VF VSI. Ordinary interface reinits which retain the hardware resources continue to retain their statistics. This follows the lifecycle used by ice without placing an unconditional statistics reset in ixl_initialize_vsi(), which also runs during ordinary iflib initialization. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59337
Check the result of ixgbe_init_hw() before configuring queues. Report failure through iflib_init_failed() instead of publishing a working datapath after shared-code initialization failed. MFC after: 2 weeks Sponsored by: BBOX.io
Check hardware initialization instead of discarding its result, and preserve the original initialization error across cleanup. Report a failed init to iflib rather than publishing a running datapath. Return normalized FreeBSD errors from attach_post. Reuse the existing native reset cleanup on failure. MFC after: 2 weeks Sponsored by: BBOX.io
Check the receive DMA and frame transfer setup results that were previously discarded. Return EINVAL for invalid ring/writeback addresses rather than reporting success, and stop initialization through iflib_init_failed() when a ring could not be configured. Use the transmit queue count for transmit initialization and the supplied channel index for DMA operations. The driver currently allocates one queue in each direction, so those index/count corrections are latent. MFC after: 2 weeks Sponsored by: BBOX.io
Test the producer and consumer indices after waiting for transmit completion. The post-decrement loop leaves timeout at -1 on exhaustion, so testing timeout == 0 missed the actual timeout and could report one when the final poll completed successfully. Leave the hardware shutdown sequence unchanged. This only corrects the diagnostic; runtime FLR recovery and command-buffer lifetime handling remain separate work. MFC after: 2 weeks Sponsored by: BBOX.io
ice_if_init marks DRIVER_INITIALIZED only after all queue and filter operations succeed, so ice_if_stop intentionally does nothing after an initialization failure. Each failure path must therefore unwind any hardware queues it may have configured before iflib releases their DMA mappings. Tx setup enables firmware scheduler queues one at a time, and Rx enable similarly processes queues incrementally. Route failures from both operations through cleanup paths for both the PF and mirror VSIs. The cleanup helpers tolerate queues which were not configured, so they also cover failures on the first queue. This leaves failed initialization stopped as required by the iflib_init_failed contract. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59331
PF and device resets discard all hardware VSI state. ice_rebuild() only recreated the main PF VSI before replaying configuration for every VSI. As a result, replay used stale VF VSI handles. Firmware rejected it with AQ_RC_EACCES and the failure aborted the entire PF rebuild. Re-add each VF VSI before replaying its configuration, and do not publish VFACTIVE until both operations succeed. Clear the initialized state so that the VF must negotiate again. If a VF rebuild fails, leave it inactive and continue so that one guest cannot prevent the PF or sibling VFs from recovering. Mark it initialized only after the resource response is submitted successfully, so the state follows completion of the mailbox handshake. Make that failed state authoritative in the mailbox path. While the firmware VSI is invalid, permit only VERSION and RESET_VF and reject operations which require VSI state. A VFR may complete the hardware reset, but cannot make the PF-owned VSI valid or publish the VF active. Preserve accumulated VF statistics while establishing a new raw hardware sample after reconstruction. This keeps the cumulative totals returned to iavf monotonic across PF resets. Return after rejecting a GET_STATS request for the wrong VSI so that it cannot receive a second success reply. Before a locally initiated reset, notify initialized VFs with RESET_IMPENDING while the mailbox control queue is still alive. Ignore individual send failures so one VF cannot prevent notification of its siblings or the reset itself. Send the event from the common reset preparation path and before directly triggering CORE and GLOBAL resets. Preserve the inactive state across later VF resets. The zero-queue Disable LAN Tx AQ remains mandatory to complete every VFR, but do not clear VFSWR or publish VFACTIVE while the PF-owned VSI remains invalid. Linux ice uses the same separation: generic rebuild excludes VF VSIs, the VF reset path rebuilds them separately, and reset preparation notifies initialized VFs before tearing down the control queues. Validated on an E810-XXV with one and eight host-attached iavf VFs. Repeated PF and CORE resets recovered every VF under traffic without watchdog, MDD, or persistent data-path errors. An additional one-VF test kept traffic active across PF and CORE resets; carrier and traffic recovered automatically and both PF and VF watchdog counters stayed at zero. Two four-queue VFs passed through to a Linux 7.0 iavf guest also recovered carrier and traffic automatically after PF and CORE resets. Simultaneous traffic on both VFs resumed without intervention and the PF watchdog counter remained zero. DPDK 25.11 testpmd, using vfio no-IOMMU and two queues per VF, sustained about 4.55 Mpps per VF before reset. It received reset events for both VFs after PF and CORE resets. The documented ethdev stop, reset, reconfigure, and start sequence restored traffic after each reset. Physical bus mastering remained enabled and the PF watchdog counter remained zero. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58905
The VF mailbox handler unconditionally submitted queue-disable commands, including when a VF repeated a request or negotiated after a PF reset had already destroyed its queues. Firmware can reject stale Tx queue metadata, causing a NACK and unnecessary VF recovery. Track queue configuration and enable state across virtchnl operations, and clear it at VF and PF reset. Apply only hardware transitions that are not already complete while preserving progress after a partial failure. Validate queue configurations before mutating hardware so the state maps remain trustworthy. FreeBSD configures Tx hardware in CONFIG_VSI_QUEUES rather than ENABLE_QUEUES, so track Tx configuration separately from Rx configuration and enable state. Linux ice similarly tracks per-VF Tx and Rx queue state and skips redundant transitions. On an E810-XXV, the prior code emitted AQ_RC_EINVAL while configuring a fresh four-queue VF because it disabled never-configured Tx queues. With this change, two VFs completed 20 stop/start cycles each, and recovered across PF and CORE resets with no watchdog, MDD, or AQ errors. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58909
The ENABLE_QUEUES handler has already validated the queue selection before attempting to enable Rx hardware. A timeout or unexpected queue state is an operation failure, not an invalid virtchnl parameter. Return VIRTCHNL_STATUS_ERR_ADMIN_QUEUE_ERROR for these failures, matching the disable path. Keep ERR_PARAM for invalid requests and attempts to enable unconfigured queues. Preserve the recorded state of queues which were enabled before a later queue failed. MFC after: 2 weeks Sponsored by: BBOX.io
pagezero() was a plain store loop (bzero), which under the kernel build flags (-mno-vsx -msoft-float) compiles to byte stores. dcbz establishes a zeroed cache line directly in the cache without a read-for-ownership fetch from memory, roughly halving the memory transactions of page zeroing. Measured on POWER9 (Raptor Blackbird, DD2.3, bare metal), zeroing a cold 256 MB buffer with 128-byte scalar loops: byte stores (current libkern memset) 8.6 GB/s doubleword (std) stores 26.8 GB/s dcbz 34.6 GB/s dcbz raises an alignment interrupt on caching-inhibited mappings, and the kernel does not emulate it, so mmu_radix_zero_page() falls back to bzero() for any page whose memattr is not the write-back default. The internal pagezero() callers only touch freshly allocated page-table pages, which are always write-back. Note: dcbz helps only zeroing, where there is no source to read. For page copying it is a pessimization (it adds a redundant zeroing pass on top of the mandatory source read), so mmu_radix_copy_page() is left as a plain bcopy(). Differential Revision: https://reviews.freebsd.org/D59507 Reviewed by: jhibbits
ice_iov_uninit() freed each VF interrupt-map array without returning the reserved indices to the device interrupt resource manager. Repeated VF create and destroy cycles therefore exhausted the PF interrupt map even though no VFs remained. Return the interrupt allocation before freeing its map. Also split software-only VSI release from hardware teardown so failures before ice_initialize_vsi() do not issue invalid RSS, scheduler, and Free VSI commands for an object firmware has never seen. Keep a VF disabled until all of its resources and hardware state have been created successfully. Clear the enabled state before teardown and after any failed add so asynchronous mailbox processing cannot use a partial or freed VSI. Consume VFLR status for inactive VF slots without trying to reset a nonexistent VSI. Track whether firmware currently owns each VSI and clear that ownership after resets. Teardown can then skip AdminQ commands for VSIs which were not rebuilt. Remove every VSI switch filter before firmware teardown, matching Linux and preventing filter-list leaks across create and destroy cycles. This also applies to the PF VSI detach path. Validated on an E810-XXV with two consecutive create and destroy cycles of 128 four-queue VFs. A 16-queue VF could then be created. Two oversized configurations each failed, cleaned back to zero VFs without invalid firmware teardown commands, and were each followed by a successful 16-queue VF creation. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58908
VF drivers replay their VLAN filters after a reset and may retry a request whose reply was lost. The PF tracked only a count and sent every requested ID back to the switch. After PF reset replay had already restored the filters, duplicate VID 0 failed with ICE_ERR_ALREADY_EXISTS and NACKed the entire VF batch. Track exact VLAN membership for each VF. Compact requests to unique IDs whose membership changes, enforce the configured limit against those IDs, and update membership after each hardware operation so partial failures cannot undercount filters. Treat already-present adds and already-absent deletes as successful reconciliation and suppress their misleading low-level error dump. Validated on an E810-XXV with a host-attached iavf VF. A three-filter limit was filled with VIDs 0, 1, and 4094. PF and CORE resets replayed all three without a duplicate warning or ADD_VLAN NACK, and DTrace confirmed a three-VID replay reached the PF. A fourth unique VID was rejected without changing the count; deleting an absent VID was a no-op; deleting and replacing a present VID updated the count exactly. A 128 four-queue VF create/destroy cycle also completed cleanly, and a newly recreated VF started with an empty membership map. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58909
Intel LPSS I2C controllers enumerated through ACPI rather than PCI never attach on Haswell and Broadwell, so every device behind those buses is lost. On a Dell XPS 13 9343 that hides the I2C HID touchpad and leaves only the PS/2 fallback, which the firmware does not restore after S3. Three causes, all on the ACPI path: Firmware may leave an LPSS function in D3, where its registers read as all-ones and set_controller() fails with "controller error during attach-1". Run _PS0 before mapping them. The PCI path does not need this, which is why the gap went unnoticed. INT33C2, INT33C3, INT3432 and INT3433 are Lynx Point-LP and Wildcat Point-LP, which ig4_pci.c already classifies as IG4_HASWELL; the ACPI path called everything but APMC0D0F an Atom SoC. The functional clock stays gated until bit 0 of IG4_REG_CLK_PARMS is set. Until then the controller accepts writes into the TX FIFO, never drives the bus, raises no interrupts, and every transfer ends in IIC_ETIMEOUT. Linux ungates the same bit in acpi_lpss.c. Doing it in ig4iic_set_config() covers resume as well as attach. With all three in place the touchpad attaches as iichid0/hmt1 with multi-touch and survives suspend and resume. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298558 Tested by: Please (XPS 13 9343, Broadwell-U, 15.1-RELEASE-p3) Reviewed by: wulf MFC after: 1 week
Add pci_get_id() and pci_alloc_msi() device methods for aarch64 platforms. Reviewed by: markj (earlier version), andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D59169
Add ACPI support to the GICv5 IRS, ITS and IWB drivers. Device parameters are derived from the MADT and IORT tables. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D59171
CNTPCT_EL0 needs to be read after an ISB in order to ensure a consistent value irrespective of speculative execution. Make existing reads of CNTPCT_EL0 use a new dedicated accessor macro that expands to the correct instruction sequence. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2423
Fix incorrect opcode on CCSIDR_EL1. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Pull Request: https://github.com/freebsd/freebsd-src/pull/2433
Previously, we would be returning AE_OK from acpi_EnterSleepState(). Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59735
ice: Validate VF virtchnl configuration Virtchnl requests originate in guest-controlled VFs. The existing PF implementation checked message shape but allowed several hardware-facing values through without complete semantic validation. Require the exact RSS key and LUT sizes advertised to the VF, validate every LUT entry, and pass only the validated LUT length to firmware. A short LUT previously caused the AdminQ command to read beyond the received request. Validate queue ring bases, descriptor counts, receive buffer units, maximum frame sizes, and per-VSI consistency before disabling or changing any queue. This also prevents the 32-bit receive ring length from being truncated through a 16-bit validation helper. Advertise the PF frame-size limit in VF resources. Leaving max_mtu zero causes Linux iavf to request a 16382-byte frame, beyond the 9728-byte limit enforced by this driver. Some Linux iavf releases use the advertised maximum as max_pkt_size even when their receive buffers cover fewer bytes within the E810 five-buffer hardware limit. Accept this advisory mismatch for compatibility. ice_setup_rx_ctx() retains the mandatory hardware clamp of RXMAX to five data buffers, as Linux ice does. DPDK sizes its request to the same limit. Preflight the complete interrupt map before changing queue state. Reject invalid ITR indices, traffic on vector zero, duplicate vectors, and queues assigned to multiple vectors. This prevents hostile input from reaching an MPASS or leaving a partially updated mapping. The limits follow the ICE queue context units and the validation policy used by the Intel ICE and FreeBSD ixl PF drivers. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59020
ice: Add malformed virtchnl injection points Extend the optional ice(4) failure injection facility with semantic corruption points for queue configuration, RSS keys and tables, and interrupt mappings. Each point mutates an otherwise valid request after the common virtchnl length check. This exercises the PF semantic validators with a real VF while preserving the normal wire format and mailbox path. The queue point selects unaligned Tx or Rx bases, an unaligned or unrepresentable receive buffer, an invalid frame size, duplicate queue IDs, or a bad VSI. The RSS points select short advertised data or an out-of-range LUT entry. The interrupt point selects an invalid ITR, traffic on vector zero, duplicate vectors, or a bad VSI. The points remain absent unless the kernel is built with options DRIVER_FAILPOINTS and retain the existing PF and VF selectors. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59021
ice: Enforce VF MAC anti-spoof policy The SR-IOV schema enables MAC anti-spoofing by default, but the driver never programs the VSI security section. A VF can therefore transmit with an arbitrary source address despite the configured policy. Program ICE_AQ_VSI_SEC_FLAG_ENA_MAC_ANTI_SPOOF when the VF VSI is created, and replay the policy when the VSI is rebuilt after a PF or device reset. Fail VF creation or rebuild when firmware cannot install the security policy so an unprotected VF is never published as active. Validated on E810 hardware with host-attached and Linux passthrough VFs. Traffic using the assigned source MAC passed while otherwise identical forged-source frames were dropped. After a PF reset, assigned traffic resumed and zero of ten forged frames reached the peer. An injected MAC anti-spoof update failure left the VF inactive. Destroying and recreating the SR-IOV configuration restored the policy and traffic. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59022
ice: Fail closed when VF reset does not complete ice_reset_vf() logs failures to drain PCIe transactions, issue the mandatory zero-queue command, or observe VFR completion, but still publishes VFACTIVE. A VF can resume against reset state which the PF knows is incomplete. Return an error from the reset operation and retain a reset-failed flag when any mandatory stage fails. Reject ordinary virtchnl requests while the failure persists. Publish VFACTIVE only after every stage succeeds. A later VFLR or PF rebuild can recover the VF and clear the failure. Remove tracked queue leaves before clearing their software state. The reset-only AdminQ command drains hardware queues but does not update the shared scheduler database; losing that bookkeeping can strand queue resources across VF teardown and recreation. After a successful VF reset, discard software switch filter state whose hardware rules were reset and clear guest-owned MAC and VLAN tracking. Restore PF-owned anti-spoof policy, the broadcast filter, and the assigned MAC before publishing VFACTIVE. The guest can then replay its own filter state without stale software entries suppressing the firmware requests. Tested on an E810-XXV with a host-attached iavf. Repeated VFLRs rebuilt the base filters with new firmware rule IDs and restored traffic. Forced reset-stage and policy-replay failures remained inactive until recovery, and a PF reset rebuilt the VF and restored live traffic automatically. This follows the conservative reset policy used by ixl(4). MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59023
Apply upstream changes b9eaf18722221 init_timer() -> setup_timer(), and 86cb30ec07cdc7 setup_timer() -> timer_setup() to get us out of Linux version 4.15 (and earlier) KPIs. Also apply 41cb08555c416 from_timer -> timer_container_of. MFC after: 3 days Reviewed by: jhb, emaste Differential Revision: https://reviews.freebsd.org/D59677
Apply Linux change 55c0fcc3de460 "Convert timers to use timer_setup()" to get us out of Linux version 4.15 (and earlier) KPIs. Also apply 41cb08555c416 from_timer -> timer_container_of. MFC after: 3 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D59679
The Linux driver switched away from using this timer in e22979d96a55d. Locally adjust the code to use timer_setup/from_timer in order to get us out of Linux version 4.15 (and earlier) KPIs. Also, right away, apply 41cb08555c416 from_timer -> timer_container_of. MFC after: 3 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D59680
The init_timer() was there from day one in (dc7e38ac4da50). It was never needed as the setup_timer() below already did more than just that part of the job. This is part of trying to clear up the Linux pre-4.15 timer KPI from LinuxKPI. MFC after: 3 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D59681
ice: Quiesce VFs before device reset Reset preparation notifies cooperative VFs, then immediately releases queue maps and firmware topology. A VF which ignores the notification can continue DMA while the PF tears down the resources which describe it. Assert VFSWR for each configured VF before teardown. Run the mandatory firmware drain serially, disable active receive queues, verify that PCIe transactions have drained, and leave the VF held until its VSI rebuild succeeds. Block ordinary mailbox requests as soon as quiesce begins so a hostile VF cannot re-enable queues in the warning interval. Also clear VFLR status only after VFRD and perform the final Transaction Pending check before publishing VFACTIVE. This follows the VF reset flow in section 4.1.3.3.3 of the Intel E810 Datasheet. Serializing VFs stays below the documented limit of four concurrent VM/VF reset flows. Validated on an E810-XXV with active host VFs and a Linux passthrough VF. Two active VFs recovered together after a PF reset and eight after a CORE reset; every VF returned initialized and traffic resumed. A 128-VF configured passthrough topology also survived a PF reset. With the bhyve process paused while ingress targeted an active Linux VF, the PF completed quiesce, topology teardown, and VSI rebuild without guest mailbox cooperation. The VF remained configured but uninitialized until the guest resumed, then re-handshook and restored traffic. The companion failure-injection commit forced each mandatory drain stage to fail. Every affected VF remained inactive with bus mastering disabled and recovered after SR-IOV recreation. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59024
ice: Add VF reset and policy failure injection Extend the optional ICE failure-injection facility with points for the MAC anti-spoof firmware update and each mandatory VF reset stage. The reset points report a failed Tx drain command, VFR timeout, receive queue disable, or final PCIe transaction drain after the corresponding hardware operation. This permits fail-closed state and recovery tests without deliberately leaving live DMA during teardown. The points remain absent unless the kernel is built with options DRIVER_FAILPOINTS and retain the existing PF and VF selectors. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59025
ice: Make VF MAC filter requests idempotent VF drivers replay their address filters after reset and may retry a request whose reply was lost. The PF tracked only a count and incremented it after an idempotent hardware add, so duplicate replays eventually exhausted the quota. It then rejected an entire address batch, including the administrator-assigned address. Track exact non-primary MAC filter membership within each VF quota. Validate a complete batch before changing hardware, charge only unique absent addresses, and update ownership after each successful operation. Preserve an administrator-assigned address when the VF is not permitted to change it. Validated on an E810-XXV with a host-attached iavf VF. The configured filter quota was filled, then the complete set was replayed across VFR and PF reset without a duplicate warning or ADD_ETH_ADDR NACK. Deleting an absent address was a no-op. With allow-set-mac disabled, the guest could not remove its administrator-assigned filter, while multicast filter additions continued to succeed. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59026
ice: Isolate VFs after malicious-driver detection Consume the per-function MDD latches to attribute transmit and receive events to the offending VF. Treat the global debug registers only as the last-cause diagnostic, add the missing Tx data-protection cause, and select the E830 TCLAN register addresses when required. Block every virtchnl request from an offending VF, reset it, and leave its queues and interrupt mappings unconfigured. Most MDD classes stop a queue, but Tx data protection only drops the offending packet; the reset makes the reported blocked state an actual DMA fence for every class. Complete VFR without restoring resources so a later physical FLR can create a new reset edge and recover the function. Complete VFR before restoring queue and interrupt mappings. E810 does not retain mapping writes while VFSWR remains asserted; retaining the original hardware order prevents an immediate post-attach VFR from leaving queue-map enable clear. E810 also sets a parent PF_MDET latch for an event attributed by a VP_MDET latch to one of its VFs. Do not reinitialize the PF for those event classes. This prevents a hostile VF from flapping PF and sibling traffic while retaining recovery for an unattributed PF queue event. Provide an opt-in auto-reset policy for operators who prefer availability to persistent isolation. Clear reset induced anti-spoof latches before releasing a rebuilt VF. This follows the MDD attribution and reset semantics in section 9.2.2.2.1 of the Intel E810 Datasheet. The per-VF register coverage and E830 TCLAN selection match the Intel ICE driver, while the default fail-closed policy follows ixl(4). Validated on E810 with four four-queue FreeBSD iavf VFs. An invalid tail write blocked only the offender, incremented its Tx MDD counter, caused no PF reinitialization, and left a sibling at 50/50 successful pings. Physical FLR restored the offender and a PF reset rebuilt it without a spurious anti-spoof block. With auto-reset enabled, the offender resumed after the reset while its sibling completed 60/60 pings; all queue-map enable bits remained set after the second VFR. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59028
ice: Protect the PF mailbox from flooding VFs Wire the shared code mailbox-overflow detector into the VF lifecycle and virtchnl dispatcher. E830 controllers use their per-VF hardware in-flight-message watermark. On older controllers, attribute a congested mailbox snapshot to its sender, reset it with its queues disabled, and discard its subsequent requests. Advance snapshot accounting even for discarded requests. A physical VFLR, PF reset, or IOV recreation releases the VF. A blocked VF can still submit mailbox messages after reset, so discarding requests does not stop it from replenishing the shared queue. Process at most one initially full mailbox immediately. If producers keep it nonempty, mask only the mailbox interrupt cause and let the periodic admin timer schedule bounded drain work. Keep the shared admin vector enabled so that OICR and other control-queue events can still be serviced. Re-enable the mailbox cause after draining and recheck the queue head for arrivals while the cause was masked. Retry failed reads through the same deferred path instead of treating them as an empty queue. Document both protection models and add failure-injection points for the isolation and scheduling paths. E810-XXV tests with two host-attached iavf VFs injected overflow on VF 0, disabling only that VF while VF 1 completed 60 of 60 pings. A physical VFLR and a PF reset each released VF 0; IOV recreation also reset its cumulative count. Forced persistent mailbox-pending state produced 20 admin and control-queue passes in five seconds, remained timer-paced, and did not interrupt sibling traffic. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59029
ice: Report SR-IOV VF status Report the VF MAC, allocated transmit and receive queues, exact trunk VLAN-filter count and capacity, negotiated virtchnl API, configured MAC, VLAN, spoof-check, and promiscuous-mode policy, automatic link-state policy, PF traffic permission, and fault containment through iflib. Expose mirror configuration and active hardware rules, precise malicious-driver isolation and counters, software mailbox-overflow isolation and counters, VF-owned MAC-filter count and limit, and reset diagnostics through a versioned driver.ice extension. Distinguish a failed VF reset from a required VSI rebuild, which may still be pending rather than failed. Keep the namespace schema local to the driver so future extensions need no changes to common network headers or the formatter. Invalidate cached VF handshakes during preparation for an externally initiated device reset, before releasing the context lock to wait for hardware. Mark the VFs as requiring rebuild even if an early PF rebuild failure prevents reaching their VSIs. Software-initiated resets retain their advance notification before invalidating the handshake. The iflib context lock protects VF state and VSI lifetime while constructing the snapshot. The query uses only cached state and does not issue AdminQ commands or read device registers. Validation on E810 with host-attached iavf VFs used ifconfig -v and direct Netlink queries to check handshake, queue, VLAN, policy, MDD, and mailbox state across VF and PF resets. Reviewed by: Pawel Sobczyk <pawel.sobczyk@intel.com>, ziaee Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58739
Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59741
Print out diagnostic information after resuming from suspend-to-idle if we failed to enter S0i3, i.e. the IP blocks that were blocking entry to S0i3. Don't give detailed IP block info for other SMUs than for Phoenix, as I have not had a chance to test these yet and the SMU seems to be very quirky. Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59673
Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59674
The VC worker ignores the pending count returned by iavf_process_adminq. If a pass exhausts its message budget, replies can remain in the receive ring without another interrupt to schedule the worker. During init, the iflib admin task cannot provide a backstop because init holds the context lock while waiting for ENABLE_QUEUES to complete. Reschedule the VC worker after a successful pass with messages remaining. Keep the per-pass budget and do not retry AdminQ errors. Stop self-rescheduling once detach clears INITIALIZED; the existing polling and reset-recovery gates continue to exclude asynchronous processing. Validation: reproduced the timeout on a three queue E835 VF under Hyper-V. Temporary tracing showed a successful ENABLE_QUEUES reply already in the guest receive ring after a three-message pass left two messages pending. With the fix and no tracing, a GENERIC kernel with WITNESS and INVARIANTS passed three batches of 30 down/up and MTU 1500/9000 cycles without enable/disable timeouts. MFC after: 2 weeks Sponsored by: BBOX.io
A VF can finish initialization or reset recovery after hn's handoff-time RSS query returned ENXIO. In that case hn suppresses synthetic receive hash metadata, but previously left it disabled even after the VF could answer the queries again. Queue an RSS refresh on a VF link-up notification, using the existing VF worker in both transparent and non-transparent modes. Revalidate the association, active VF path, administrative state, and carrier under hn_lock before querying and reconfiguring synthetic RSS. Coalesce the requests with an atomic flag and retain a request while capability forwarding temporarily excludes the worker. Keep the existing query validity checks and unsupported-query fallback unchanged. This is a one-shot refresh, not a readiness poll. Recovery without a link-up notification, or a query that still fails during the refresh, does not trigger another retry by itself. A later link-up or normal handoff can query again. Consuming the request while the VF path is inactive is intentional: the next handoff queries RSS unconditionally. Continue to reprogram RSS after a successful query even when the cached key and types match. They are updated before host reconfiguration and do not prove that the previous programming succeeded. The event callback only records and schedules work; RSS queries and host reconfiguration remain in sleepable context. No packet-path changes or new timer are needed. With an E835 iavf VF, reproduced an ENABLE_QUEUES timeout and an ENXIO RSS query in both transparent and non-transparent modes. In each mode hn restored mbuf_hash after VF recovery, without another interface reconfiguration. MFC after: 2 weeks Sponsored by: BBOX.io
The SEC QMan interface stores context in context_a and context_b, so add them to the frame queue creation.
The QorIQ Security Engine (SEC) generally fits into the Data Path Acceleration Architecture, accelerating cryptographic operations. Currently this driver does not use the QMan interface, instead relying on the job rings, as Linux also does, to reduce complexity until needed for network protocol acceleration, like IPSec and OpenVPN. Initial testing via `openssl speed -engine devcrpto -evp aes-128-cbc` yields a ~200x throughput improvement, from 105MB/s to more than 20GB/s for 16k block sizes. Differential Revision: https://reviews.freebsd.org/D59581
With the DPAA Security Engine (SEC) KERN_TLS should provide some enhancement over userland software TLS. Also, add IPSEC_SUPPORT, so that ipsec can be loaded if needed.
For Krackan Point, CPU-model-specific matching would not work because amdsmu_match() browses amdsmu_products[] in order and returns the first match, and the Krackan Point's 'struct amdsmu_product' object variant with a 'model' field of 0, indicating that any model matches, is listed before the variant with model 0x70 in amdsmu_products[]. In practice, this means that reporting of IP blocks for Krackan Point model 0x70 only was broken. Specifically, not all the existing blocks were reported and most statistics were not attributed to the right blocks. Fix this by making amdsmu_match() parse amdsmu_products[] in reverse, so CPU-model-generic entries can continue to appear first and new specific ones can be added after them, which is the expected chronological order of additions. While here, since the CPU model is between 0 and 255, change the type used for CPU models to an 'int' and use the special value -1 to skip model match, as there exist CPUs reporting 0 as the model (even if, to our knowledge, only old CPUs seem to be doing that). While here, fix alignement and whitespace in amdsmu_products[]'s initializers. Reviewed by: obiwac Fixes: https://cgit.freebsd.org/src/commit/?id=9c77fb6aaa36 ("amdsmu: Add Krackan Point support") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59788
When a graphical application (X.Org display server, Wayland compositor) calls KDSETMODE to set the active VT back to KD_TEXT, vt(4) does not reset the CRTC to point to its framebuffer, leaving the last image of the graphical application visible instead of the text console until the next VT switch. Add a call to vd_postswitch to reset the CRTC, set VDF_INVALID to force a redraw and schedule the flush timer, like vt(4) does in vt_window_switch(). Sponsored by: Defenso Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr> Reviewed by: vexeduxr Pull request: https://github.com/freebsd/freebsd-src/pull/2308
sound: Standardize mixer_init() call order Device drivers call mixer_init() in a non-standard order - some before pcm_init(), and some after pcm_register(). However, both approaches are potentially risky, and logically weak, since pcm_register() is supposed to be the function that finalizes sound(4) attach. Standardize the call ordering by moving all mixer_init() calls after pcm_init(). This is also necessary for a follow-up patch, which expects pcm_init() to have run first and initialized the PCM lock. Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59069
sound: Simplify how snd_mixer is fetched and how the cdev is created The primary snd_mixer was reached by accessing the mixer cdev's si_drv1. This is tedious and ugly, so store the mixer in snddev_info->mixer and access it directly. Additionally, create the cdev in a new mixer_make_dev() function (in similar fashion to dsp_make_dev()) in pcm_register(), when everything is initialized, instead of risking potential races because mixer_init() (called before pcm_register()) used to create the cdev. Also add some NULL checks in pcm_register(), to avoid creating a mixer cdev when the driver (e.g., fdt/audio_soc.c) does not create a mixer in the first place, and similarly in pcm_unregister(). Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59070
sound: Embed mixer cdev in snd_mixer The mixer cdev belongs to the mixer, not to the PCM device, so move it from snddev_info->mixer_dev into a new snd_mixer->cdev field. snd_mixer itself is now included in snddev_info. Also add a MIXER_REGISTERED() macro similar to PCM_REGISTERED(). Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59071
sound: Defer macio codec volume writes to a task tumbler(4), snapper(4) and onyx(4) write the volume over I2C, and iicbus_transfer() sleeps. This is why mixer_set() drops the mixer lock around MIXER_SET() for non-MPSAFE drivers, relying on Giant to keep them serialized. Store the volume in the softc and let a task do the I2C write with no lock held, so that the mixer method does not sleep at all. The lock dropping for non-MPSAFE drivers will be removed in a follow-up patch. Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59073
sound: Use snddev_info->lock in place of snd_mixer->lock snd_mixer and snddev_info have a 1:1 relationship. Now that snd_mixer is embedded into snddev_info, it makes even more sense for both to share the PCM lock. The only exceptions to this are MIXER_TYPE_SECONDARY mixers, which still retain a private lock (snd_mixer->priv_lock), because they are attached to the device driver, and not snddev_info. Only snd_emu10kx(4) uses a secondary mixer. A side-effect of this is that the MIXER_SET_LOCK()/MIXER_SET_UNLOCK() mess goes away. These macros were used in the mixer_set*() functions to drop the mixer lock if the driver is Giant-locked and the function can sleep inside MIXER_SET*() methods, and to avoid an LOR before locking PCM to guard channel list traversal. Since mixers now use the PCM lock, drop the channel lock in chn_syncstate() before calling mix_get(), to avoid an LOR. These lines were actually already commented out for years. Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59074
sound: Retire mixer_hwvol locked variants
Prior to 9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as
mixer_lock"), there was a need for mixer_hwvol_mute_locked() and
mixer_hwvol_step_locked(), because the unlocked variants would acquire
the lock, but uaudio_hid_rx_callback() would also hold the lock, so this
was a measure to avoid recursion on snd_mixer->lock. Now that
snd_uaudio(4) has a private mixer lock, the locked variants are not only
unnecessary, but wrong, because we now lock the private lock and not the
snd_mixer one, which is what mixer_hwvol_mute_locked() and
mixer_hwvol_step_locked() expect. Retire the locked variants and call
the regular functions instead.
The unlocked variants take the mixer lock, which is now the PCM lock,
and reach uaudio_mixer_ctl_set(), which takes mixer_lock. Calling them
straight from uaudio_hid_rx_callback() would therefore take mixer_lock
and the PCM lock in the opposite order to the mixer ioctl path, so
record what the HID report asked for and perform the volume change at
the end of the callback, with mixer_lock dropped. The USB stack allows a
callback to drop its transfer mutex (see usbdi.9).
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D59075
sound: Do not set a recording source in mixer_uninit() We currently set the recording source to SOUND_MIXER_MIC during mixer deletion. Apart from the fact that this control might not be present on all devices, it is unnecessary to do that, plus we already set all the volumes to 0 in the mixer_set() call above. Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59076
sound: Reuse mixer_delete() in mixer_uninit() Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59077
sound: Improve some mixer return values and their handling Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59078
sound: Remove unncessary locking in sysctl_hw_snd_hwvol_mixer() The locking around strlcpy() was because of m->hwvol_mixer, but this is just an int, so we don't need to lock in this case. Instead lock only when m->hwvol_mixer is written. While here, add parentheses around the returns. Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59109
sound: Lock around mixer_set*() in mixer_init() for consistency Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D59110
Treat unsupported RSS queries and RSS_FUNC_NONE as normal reasons to suppress synthetic receive hash metadata. Keep diagnostics for other errors and invalid configurations. Also suppress hash metadata when reconfiguring synthetic RSS fails, since the VF and synthetic settings cannot then be assumed to agree. Correct the hash-query diagnostic name. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59691
Use rss_getkey() for PF and VF RSS programming even when options RSS is not configured. The common key is available independently of RSS queue placement and is also used by software hashing. Generating a private key on each initialization defeats that agreement and changes receive hashes across resets. Leave hash-field selection and indirection-table placement unchanged. 82599 and X540 VFs retain their PF-owned RSS configuration. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59789
Provide the iflib RSS query methods for X550 and newer VFs, whose RSS key and hash types are programmed by the VF. Cache those values and answer queries under the context lock, without register reads or mailbox transactions. Invalidate the snapshot at init, stop, and when an admin check requests recovery after losing the PF mailbox or detecting reset. Reject queries while the snapshot or mailbox is unavailable. Program the common RSS key and cache the values written to the registers. The key remains stable across resets, including live MTU and capability changes for which hn(4) can retain its copy without another VF handoff. Serialize the key in register byte order and report the six supported IPv4/IPv6 TCP/UDP hash selections from the programmed MRQC, rather than claiming that every globally requested hash type is enabled. A single receive queue still performs Toeplitz hashing. Older VFs retain EOPNOTSUPP because their PF-owned RSS settings are not available here. This allows hn(4) to synchronize synthetic RSS with the actual VF settings instead of suppressing otherwise usable receive hash metadata. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59692
Use rss_getkey() when programming the RSS key through virtchnl regardless of options RSS, matching the register-programming path. The common key is available independently of RSS queue placement; the driver-specific default otherwise makes the chosen key depend on the PF's configuration interface. Remove the unused default-key helper and its declarations. Preserve the negotiated key length, zero padding, hash selections, and indirection-table policy. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59790
Zero the complete 52-byte RSS key buffer before fetching the common 40-byte key. Both the X722 AdminQ path and the register path consume all 52 bytes; the trailing extended-key bytes must not come from uninitialized stack storage. This matches the zero padding already used by iavf and ice. Remove the unused driver-default key helper and its declaration. Keep the standard key, hash selections, and indirection policy unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59791
Use rss_getkey() in the older em multi-queue RSS path, which is reached by 82574 with two receive queues. This replaces a private key generated on each initialization and matches the common-key policy already used by the igb path. Decode each register word with le32dec() and remove the private assembly macro, avoiding signed integer shifts while preserving the register byte order. Leave the redirection table and hash fields unchanged. This does not change single-queue em devices or PF-owned igb VF RSS settings. Reviewed by: erj, gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59792
Fetch the common RSS key independently of options RSS instead of generating a private key in non-RSS kernels. Keep the existing software-RSS or round-robin indirection policy and hardware key serialization unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59793
Fetch the common key in the PCI iflib frontend regardless of options RSS and make the key API declaration available in both configurations. Retain the existing hash-field selection and queue-placement branches. The independent ARM frontend is unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59794
Use the common RSS key instead of generating private random words.
Reverse the bytes before passing the key to the shared code, which copies
the supplied bytes directly into the firmware request. The searcher
consumes this array in reverse order; a raw copy of the common key would
not produce matching Toeplitz hashes.
The hardware ordering is documented by Linux commit
d682d2bdc30650a5c7ce9908ab83ab674b658744 ("bnx2x: byte swap rss_key to
comply to Toeplitz specs"). Keep the conversion in the FreeBSD caller
rather than changing the shared-code interface.
Preserve the config_hash gate, including the PMF-only key programming
on 57710/57711, and leave hash types and indirection policy unchanged.
Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59796
Fill the RSS configuration request with the common 40-byte key instead of fresh random bytes. Preserve the mailbox representation, hash selection, and indirection table. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59797
Replace the private fixed key with rss_getkey(). Copy the common byte stream directly into the RSS queue-pair context and use the same helper for SIOCGIFRSSKEY, so hardware programming and hn's query agree. Change the helper to fill caller-owned storage instead of returning a pointer to a static key. Check the fixed hardware and ioctl buffer sizes at compile time. Leave RSS masks and queue steering unchanged. MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59798
Use rss_getkey() for each port's initial key instead of a lazily generated driver-global random key. Remove the obsolete helper and its unsynchronized initialization flag. Make the common-key declaration available without options RSS. The port still retains the key used for hardware programming and the existing SIOCGIFRSSKEY response. Leave hash types and queue placement unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59799
Replace the embedded default key with rss_getkey(). Decode each group of four key bytes as a big-endian word; the shared code then serializes those host-order words as little-endian firmware fields. This preserves the existing hardware representation for the common default and allows a configured common key to take effect. Keep the existing multi-queue gate, RSS hash selections, and indirection policy unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59800
Replace the embedded key with rss_getkey(), retaining the firmware's reversed 64-bit word-pair order and low-word-first layout within each pair. The common default produces the same mailbox key as the existing constants, while configured common keys no longer get ignored. Leave the RSS enable flags, hash types, and indirection policy unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59801
Replace the embedded default with rss_getkey(). Preserve the ICB's little-endian representation of each big-endian key word, then copy the initial 16 bytes of the serialized IPv6 key into the IPv4 key. This retains the old default-key bytes and allows a configured common key to take effect. Leave RSS flags and queue mapping unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59802
Replace the embedded key with rss_getkey(). Retain the reversed 64-bit word-pair order and low-word-first layout used by the existing firmware request, matching the qlxgbe conversion. The common default produces the same five firmware words as the old constants. Leave hash selections, RSS enablement, and the indirection mask unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59803
Fetch the common Toeplitz key instead of filling it with random bytes during receive-forwarding setup. Check the key size at compile time and retain the existing host-to-network conversion for each hardware word. Leave forwarding, hash selection, and queue mapping unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59804
Replace the random register words with rss_getkey() and decode each four-byte chunk with le32dec() before writing the port's key registers. Keep the RSS capability check and existing queue-count and indirection table programming unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59805
Replace the repeated hardware-reset key with rss_getkey(). Decode each
eight-byte chunk with be64dec() into the register-word array before
programming the five key registers.
This matches the key serialization in DPDK's nicvf_rss_set_key(), added
by commit 7694fab264ac666d62a4cae04f2979991ce64259
("net/thunderx/base: add RSS and RETA configuration"). A raw copy into
the word array on little-endian hosts would reverse bytes within each
register relative to that convention.
Preserve the CPI-algorithm gate, enabled hash fields, and round-robin
indirection table.
Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59806
Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH for qlnxe and qlnxev using the cached vport RSS configuration. This lets hn(4) synchronize its synthetic RSS configuration with the VF without assuming that every driver programs all of the common RSS hash selections. Serialize the queries with the device lock and reject them while the interface is not running. Convert the firmware request's key words back into network byte order and translate the six representable IPv4/IPv6 TCP/UDP hash selections. Report no hashing when RSS is disabled, including the driver's single-queue configuration. For VFs, require a successful RSS extension response from every hardware function. The overall vport-update reply can succeed while its RSS TLV is missing or rejected; recording that result prevents reporting an unconfirmed configuration. Invalidate the confirmation before each RSS request. Leave existing vport-update return semantics, queue setup, and the receive datapath unchanged. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59810
Use rss_getkey() for the initial VNIC key instead of generating a per-attachment private key. Preserve the writable rss_key sysctl, its override lifetime, the hardware DMA representation, and all hash and indirection settings. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59795
Reviewed by: vexeduxr, Quentin Thébault <quentin.thebault@defenso.fr> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59814
Network-related commands, library, and kernel.
Implement buf_ring/drbr deferred transmit in iflib. This is intended to allow the new simpler code path to replace mp_ring. This patch makes the simple_tx outperform mp_ring by a wide margin when CPU is the bottleneck (eg, cannot fill the NIC). See graphs at: https://people.freebsd.org/~gallatin/mpring_vs_simple_tx Note that the buf ring is used for contention, not capacity. Eg, it is used as a place for contending threads to put packets without waiting for a mutex. It is not designed to act as a software ring on top of the hardware descriptors provided by the underlying NIC driver. "stranded packets" are exceedingly rare due to the fact that if there is enough load to use the buf_ring, there will probably be more load coming that can be a drainer. Not scheduling a gtask to drain is intentional, and we really on the timer as a fallback. One thing I noticed while developing this patch is that a simple mutex with no deferral generally outperformed both mp_ring and drbr at high levels of contention for the same queue. This is inherent in a bounded MPSC queue where multiple producers are contending on claiming ring entries. So I came up with the idea of bounding the number of producers such that the deferral ring would devolve to a mutex when contention was high. Identifying the crossover point in a general way was hard. On different machines, the point between a mutex and a deferral ring was very different and also depended on the placement of the producers. I eventually realized that on the large AMD EPYC servers that I was testing on, the crossover point generally coincided with the work spilling into another CCX. So I developed an approach where we limit the number of producers by limiting simultanious producers to the same L3 AND by bounding the number of simultanious producers. This limit can be adjusted via the sysctl net.iflib.max_producers. The number of packets drained from the deferral ring is limited by net.iflib.simple_drain_quota. The intent is to process just enough packets in the gtaskq context so as to make space to allow threads to make progress. The task also uses a trylock so as to avoid blocking, waiting for a thread to drain. This change also enables ALTQ support for simple tx. Reviewed by: kbowling Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D58901
Use the context-locked datapath state for netmap initialization results, resume completion and administrative work eligibility. Keep stopped and failed interfaces eligible for link and mailbox recovery without using IFF_DRV_OACTIVE as an implicit indication that initialization has been attempted. Evaluate media and deferred admin eligibility under the context lock rather than from an earlier IFF_DRV_ flag snapshot. Always pass through iflib_stop() before an IOV-init callback which changes the PF queue layout, as the IOV-uninit counterpart already does. Neither administrative down nor a cleared IFF_DRV_RUNNING proves that queue DMA is stopped. The private lifecycle state decides whether the hardware stop is necessary; IFF_UP only decides whether to initialize again afterward. Reviewed by: iflib (gallatin) MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59597
Publish an atomic software run state snapshot through iflib_is_running(). Use it for iflib traffic admission, queue tasks, timers, debugnet and live-configuration checks instead of reading the unsynchronized ifnet driver flags. Keep admission closed after failed initialization and close it when a watchdog requests deferred recovery. Retain the context-locked datapath state for DMA ownership: a closed admission gate does not establish that the hardware is stopped. Open the gate after receive buffer setup and before interrupt enable, at the existing RUNNING publication point. Serialize the writers with the state mutex and continue publishing RUNNING/OACTIVE for network stack consumers. The accessor takes no lock and is usable from filters, but is only a snapshot, not a context reference or a queue-user drain. Recheck multicast and VFLR admission under the context lock. Replace the OACTIVE drain check with the same private admission gate, retaining the separate per-queue descriptor backpressure policy. Rename its debug counter to txq_drain_stopped. Document the accessor and its synchronization limits. This does not remove legacy flag reads elsewhere in the network stack or change the existing queue-drain and device-stop contracts. External drivers will still see the IFF_DRV_ publications but should migrate to this API. Reviewed by: iflib (gallatin) MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59598
Initialization publishes RUNNING and enables interrupts before clearing the simple-TX producer barrier. A transmitter admitted in that window still sees IFLIB_TXQ_QUIESCING and drops its packet with ENETDOWN. A TX completion task can likewise return without draining deferred packets. Clear the barrier on every TX queue after driver initialization and RX buffer setup succeed, before publishing admission. Keep failed init paths closed and retain the existing stop, interrupt and timer ordering. This changes only initialization; no work is added to the packet path. Reviewed by: iflib (gallatin) Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59690
We have a problem in UMA where creating new zones requires a traversal
of all existing zones (in order to find a unique name for the vm.uma
sysctl subtree). This means that per-VNET UMA zones can be expensive to
create if one creates many VNET jails in a row. This itself is a
problem, but I don't see a quick solution.
Ideally we would avoid creating per-VNET zones in the first place
(except when the desire to impose per-VNET limits necessitates this),
and it turns out that the TCP fastopen and SACK code create several of
these for no apparent reason.
So: make fastopen and SACK zones global. Move some fastopen structure
definitions into tcp_fastopen.c, as they don't need to be public.
Reported by: bapt ("creating many VNET jails in a row is slow")
Reviewed by: tuexen, glebius
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D59708
Until now, simple tx has used its own queue selector, and has ignored isc_txq_select and isc_txq_select_v2 (not this only seems to matter for ice(4) with dcb enabled). This change makes simple-tx use isc_txq_select* when present. The implementation is defined to be efficient, with a transmit routine chosen up-front that hard-codes the queue selection and calls an always-inlined body. This avoids a useless test per packet in the hotpath, and also may avoid speculation into header parsing. Note that this was designed for readability and efficiency in the common case (interface up, not ALTQ). That's why we do queue selection without duplicating nic-running and altq checks, leaving them to the common implmentation. Sponsored by: Netflix Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D59712
net.iflib.prefer_mpring can be used to control whether or not all iflib driver instances default to mp_ring or simple_tx. This is intended to be temporary, to allow easy testing (now) of simple_tx, and to allow an easy fallback to the legacy path (later) once the default is switched to simple_tx
Changing the VID of an existing VLAN interface rehashes the interface and announces the new VID, but does not unregister the old VID. Parent drivers and VLAN event consumers can consequently retain stale filter membership. After successfully inserting the new VID, emit vlan_unconfig for the old VID before the existing vlan_config notification. Do not unregister anything if insertion fails and the old VID is restored. MFC after: 2 weeks Sponsored by: BBOX.io
When we receive an ICMP redirect, rib_add_redirect() is used to apply
the redirect to all FIBs. This has been the case since support for
multiple FIBs was added. However, it seems rather dubious: the new
gateway might not be routable from all FIBs, and the validation done for
v4 redirects in icmp_verify_redirect_gateway() is only applied to the
FIB from which the redirect originated.
Modify the handler to apply the redirect only in the originating FIB.
Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by: pouria, zlei, glebius, melifaro
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59567
fib_algo indexes its idx->nhop array by the nexthop index with assumption of its uniqueness. Which is true except for IPv4 over IPv6 nexthops. Give each index space its own segment within the same array and offset the index by the segment base. Segments are created on demand and sized independently, so the rib's own family keeps base 0 and tables without cross-family nexthops index exactly as before. Reviewed by: melifaro Discussed with: markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D59552
Not to struct pfioc_table.
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
tcp: collect and report more statistics on the TCP host cache Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D59451
tcp: turn on TCP hostcache for socket buffer sizes The code has been there since introduction of the TCP hostcache in 97d8d152c28bb in 2003, but was turned off. Reviewed by: tuexen, cc Differential Revision: https://reviews.freebsd.org/D59452
tcp: use sparse initializer for host cache metrics Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D59453
Dispatch SIOCGIFRSSKEY and SIOCGIFRSSHASH through typed get_rss_key and get_rss_hash methods under the context lock. Drivers can report their programmed key and hash selections. The default methods return EOPNOTSUPP. The common RSS key does not describe which hash selections a particular device actually programs. hn(4) needs the effective VF configuration when synchronizing RSS between its synthetic and VF receive paths. Reviewed by: iflib (gallatin) MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59691
Rest of multicast related kernel structures live in in6?_var.h and this piece of ip6?_var.h was anyway requiring in6?_var.h to be included before. Differential Revision: https://reviews.freebsd.org/D55963
Differential Revision: https://reviews.freebsd.org/D59140
ipfw: refactor macros around m_pullup() In the prologue, where we check if the argument is a memory or an mbuf chain, do not set 'struct ip *ip' pointer. However, set the 'struct ether_header *eh' pointer there and set Etherner header length in 'ehlen'. Side effect of this refactor is that now Layer 2 hooks may send mbufs with ETHERTYPE_VLAN frames. However, current network stack doesn't do that. Write a new PULLUP() macro that would take type of the argument to determine how much to pull. Unlike PULLUP_TO() this macro can take typed pointer. This will allow to get rid of 'void *ulp' and bunch of casting macros in the next change. Use local bool variable to see if we need to unlock upon jump to pullup_failed. Embed pointer update into the branch of the macro, where pointers indeed need an update. Use new PULLUP() macro to pullup initial 'struct ip *ip' and 'struct ip6_hdr *ip6'. This removes max_protohdr sized pullup, that previously tried to pull more than an unmapped mbuf could yield, fixing a bug covered by the testcase sys/netpfil/ipfw/unmapped. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D59426
ipfw: use typed pointers to access network protocols headers where possible The 'void *ulp' is still in action, but where possible prefer a typed pointer. Get rid of associated pre-processor macros. Differential Revision: https://reviews.freebsd.org/D59435
ipfw: cleanup !FreeBSD and !_KERNEL code These are leftovers from last import from Luigi Rizzo in 2013, that were never compiled checked since and lots of changes have had happened since and more changes to come. Let's not pretend ipfw is buildable on something else than FreeBSD nor it can be compiled for userland. Reviewed by: lytboris_gmail.com Differential Revision: https://reviews.freebsd.org/D59427
Stuff in man section 8 (other than networking).
Sponsored by: The FreeBSD Foundation MFC after: 3 days
Incorrect ELF might have PT_NOTE slightly larger than the needed to contain all notes, and the PT_NOTE size could be larger than one page. Then rtld mmaps just the notes bytes to parse. After the last note, we iterate past the mapped region trying to read the Elf_Note header. This was found in wild. Require full elf note to fit into the [start_note, end_note) region to continue the parsing. Check it in stages, first verifying the Elf_Note header structure fits, to be able to read the name and data length. After that, check the whole note against limit. Reported and tested by: makc Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59635
The bounds check rejected any access ending exactly at the end of the register block, so a four byte write at offset 0xffc was refused, returning EINVAL and killing the VM. MFC after: 1 week PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291063 Fixes: https://cgit.freebsd.org/src/commit/?id=75909086a45d ("bhyve: allow read/write to full CRB buffer") Sponsored by: Defenso Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr> Reviewed-by: aokblast, kevans, markj Pull-Request: https://github.com/freebsd/freebsd-src/pull/2362
Reviewed by: fuz, dteske Approved by: fuz (mentor), dteske (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59667
Found with: Claude Code Sonnet 5 MFC after: 2 weeks
mfi_drive_name() built the "Exx:Syy" drive location string using struct mfi_pd_info's encl_index field, the enclosure's firmware- internal position index. Broadcom's own storcli/MegaCli tooling instead leads with the enclosure's Device ID (EID) in its primary drive listing; encl_index only shows up as "Position" in a detailed per-enclosure view. Both numbers are raw, unmodified firmware values already fetched into struct mfi_pd_info/mfi_pd_address, but only encl_index was ever displayed or accepted as input, leading to confusion when cross-referencing drive locations against storcli output. Switch mfi_drive_name() and mfi_lookup_drive() to use encl_device_id instead, aligning FreeBSD's enclosure numbering with Broadcom's own utilities. Since mrsasutil(8) is the same binary as mfiutil(8) under a different name, this applies to both mfi(4) and mrsas(4) alike. This is a user-visible behavior change: the numeric value of "xx" in "Exx:Syy" now differs from before for any enclosure whose EID and position index don't match, affecting anyone scripting against the previous numbering. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294353 Reviewed by: imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D59654
Avoid printing timer addresses, so as to not divulge information about the address space layout. In ip.c, print the actual SPI instead of a pointer to the SPI in the header buffer. When debug logging is enabled, don't leak pointers when logging function arguments or return values. Reported by: Reo Shiseki MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
All communication between hastd nodes and internally between hastd and its worker children passes through the same pair of send / receive functions. The receive function uses recv(2) with the MSG_WAITALL flag, which in theory means we should never get a short read. However, when handing off a socket to a worker child, we also pass a variable-length string identifying the type of socket we're passing, and reading this string relies on a short read. This used to work because the arrival of the descriptor would interrupt the recv(2) call, but this bug was fixed when the AF_UNIX code was rewritten a while ago and hastd has been broken ever since. Fixing the length of the protocol name to four characters including the terminating null solves the short-read bug by never requiring a short read (nothing else in hastd requires one). Note that this issue appears to have been reported independently first by Alessandro Sagratini in PR 234576 and then by Martin Vidovic in D57511. I ended up going in a different direction than Martin's patch, but his analysis was invaluable, hence the double credit below. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234576 Reported by: Martin Vidovic <xtronom@gmail.com> MFC after: 1 week Event: EuroBSDcon DevSummit 2026 Reviewed by: xtronom_gmail.com, kevans, glebius, gjb Differential Revision: https://reviews.freebsd.org/D59521
Complete the native configuration trinity: sysctl(8) for live kernel state, sysrc(8) for rc.conf(5), and sysconf(8) for the remaining base configuration -- loader.conf(5), sysctl.conf(5), and the make.conf(5) family -- atop libbsdconf(3). libbsdconf resurrects figpar as a unified reader/writer. Callbacks own semantics; statements may span multiple lines via backslash continuation; non-seekable input is spooled; writes are atomic (mkstemp, fsync, rename) with mode/owner preservation. Format descriptors name each target, its files, and quoting rules without private parsers. Multi-file targets follow boot sourcing order; loader chases loader_conf_files as the boot loader does. sysconf(8) is the operator-facing tool: name / name=value on a required target, sysrc-style list edits, make append and list-strike where they belong, jail/altroot, and a capsicum sandbox for read-only use. Sysctl writes validate against the running kernel first -- unknown and read-only OIDs, CTLFLAG_TUN (pointing at the loader target), and CTLTYPE range checks -- so a typo or overflow does not land in sysctl.conf. Make and src treat WITH_/WITHOUT_ as presence knobs (as bsd.mkopt.mk / src.conf(5) do) and warn on the WITH_*=no form that does not disable the option, so a bad assignment is caught before an /usr/src build surfaces it. The rc target passes through to sysrc(8). Defaults querying (-d/-D/-A) mirrors sysrc for dumps and descriptions on targets that have a defaults file; named reads already see defaults, and -A only widens dump scope. Manuals are split pkg(8)-style (bsdconf/put/format; sysconf plus per-target pages). ATF coverage exercises the frontend. Co-authored-by: Faraz Vahedi <kfv@FreeBSD.org> Reviewed by: fuz, kfv Differential Revision: https://reviews.freebsd.org/D58066
- zero out a buffer for the incoming icmp message that we are about to parse - for ICMP_MASKREPLY and ICMP_TSTAMPREPLY responses check their length and warn and reject them if they are truncated Without these checks a part of stack allocated struct icmp icp could be printed out which seems low severity since we already dropped root privileges by the time icp is allocated. Reviewed by: glebius MFC after: 1 month Found with: Claude Code Sonnet 5 Differential Revision: https://reviews.freebsd.org/D59555
When we see a difference between the payload we sent and what we received, we dump both but we were not prepared for the case when the received payload is less than we sent. In this case we were trying to dump more than needed. Funny enough, 23 years ago I already fixed a similar issue here but didn't pay attention to this small dumping loop. Test written by jlduran. Reviewed by: jlduran MFC after: 1 month Found with: Claude Code Sonnet 5 Differential Revision: https://reviews.freebsd.org/D59556 Differential Revision: https://reviews.freebsd.org/D59582
Change added in 90a7728cd8905cd26b90d06f7873df8bad43ae9a contained a lot of bugs: - If all network interfaces correctly respond to DHCP, then pwait was waiting forever. - If there was more than 1 interface, then "cat /tmp/ephemeraldhcp.*.pid" joined pid numbers into one long string. - "for iface in $left; do kill -15 $left; done" is not using $iface. Tested by: adam.mizerski@ovhcloud.com Sponsored by: OVHcloud Pull Request: https://github.com/freebsd/freebsd-src/pull/2436
Monitor mode will currently unconditionally restart the guest if it reboots, which can be incovenient in certain situations (e.g., resetting the guest after a panic). Address this by introducing a way to prevent automatic guest restarts in monitor mode. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D59123
Currently, when bhyveload(8) fails to boot the guest, it drops into the loader prompt waiting for user input. This behaviour is inconvenient when using bhyveload(8) from scripts. Make it exit when it receives EOF from console input. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286289 Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59226
Reviewed by: fuz Approved by: fuz (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59777
Extend bhyvectl(8) to support querying VM pid using the `--get-vm-pid` flag. This is useful in monitor mode when the VM pid differs from the main bhyve(8) process run by the user. Knowing the VM pid is necessary, for example, to query process resource usage or trigger ACPI shutdown with SIGTERM. Of course, it could be obtained by matching the monitor process children by the process title, but it's a little more complex and fragile than it could be. Implement that by adding the "get_vm_pid" IPC command, and using it to implement `bhyvectl --get-vm-pid`, which prints the VM PID. When the VM PID is not known, ESRCH is returned. Reviewed by: bnovkov (previous iteration without man changes) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59108
Add support for dumping the Microsoft Data Management (MSDM) table, which contains the Windows product key embedded in firmware by the OEM. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D59662
This was missed when bringing the kexec framework in. Fixes: https://cgit.freebsd.org/src/commit/?id=e02c57ff37e ("kern: Introduce kexec system feature (MI)") Reviewed by: kib Sponsored by: Hewlett Packard Enterprise LP Differential Revision: https://reviews.freebsd.org/D59696
sysconf(8) --version now prints the library version alongside its own so each can move on its own clock. Assigning a bitmask to bool already converts zero/nonzero; drop the redundant != 0 (fuz). Reviewed by: fuz, kfv Differential Revision: https://reviews.freebsd.org/D59720
Reviewed by: fuz Differential Revision: https://reviews.freebsd.org/D59745
db/hash: Harden hash(3) database code The hash(3) database code does not validate the on-disk database header, leaving it open to several OOB read and write vulnerabilities. This change adds basic header validation and array bounds checking to parts of the hash(3) code that can be manipulated by messing with the database header. Reviewed by: kevans Sponsored by: Klara, Inc. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D58822
libc/db: Correct a typo in the the hash tampering test Fixes the gcc build. Fixes: https://cgit.freebsd.org/src/commit/?id=7f5f07b139a5
Notable upstream pull request merges:
#18808 6d4ff3b4f Pool split leaks DTL spacemap objects
#18844 0833cfd64 Decline Direct I/O reads on a file handle after a benign
verify failure
#18853 39764eb06 Fix double free when cloning a block with a pending free
#18901 51fe1fb84 dmu_send: a meta-dnode range does not start where an
object does
#18903 904d4327f dmu_objset_open_impl: unregister prop callbacks on error
#18906 e45640415 zdb: add detailed diagnostics for MOS leaks and spacemap
refs
#18909 1b7143557 Keep a grown vdev from adopting an older pool's labels
#18912 -multiple Defer destruction of a snapshot that a mount is holding
open
#18921 33ae06bb6 ZIO: Batch vdev children completions
#18940 7853c27eb ZIO: Batch lightweight ZIOs
#18967 -multiple Speed up pool rewind and allow it to tolerate minor damage
#18968 b0fff48dc arc: harness buf_hdr's anon state invariant checks
#18969 b0da5c4ce dsl_crypt: validate every key change-key will rewrap
#18974 b19fa7c97 log_spacemap: make zfs_log_sm_blksz tunable
#18982 c878ee452 zstream: track and limit memory use
#18991 a1261384a zstream: self-tuning queues
#18992 fd639b075 zcp: support bookmarks in zfs.sync.destroy
#18993 0498c554d vdev_disk_open: fix ENOENT retry & cleanup error handling
#19003 5280a08f6 Write uberblocks only to vdevs used by the txg
#19008 c47591d5d arc: apply arc_min tunables set before arc_init() has run
#19016 cd578e518 dnode: fix heap-use-after-free in dnode_rele_and_unlock()
#19017 b824f3116 zstd: declare __asan_*_memory_region() for user space
builds
#19029 6860d1c2f DDT: Use proper size when calling kmem_free on
ddt_prune_entry_t
#19041 aa26ca67b Do not complete a device removal that hit IO errors
#19042 8e5bb1d4b Wait for the initialize and trim threads to exit
#19051 ba524e0d7 zpool: things get messy with 0 columns
#19053 69ef525a4 dsl_deadlist_space_range: use correct tree when summing
up space
#19059 0ee8ea01b FreeBSD: use sys/abi_compat.h for time32_t
#19062 e08bc2973 Skip interior dnode slots when receiving DRR_FREEOBJECTS
#19066 92a3904af Wait for the txg that finished a scan to sync
#19071 db07a5e0a dbuf: account dirty data for embedded writes
#19072 1a8e51491 Fix self-deadlock when cloning a range within the same
file
#19075 75bd31c28 L2ARC: do not feed a device while its rebuild is pending
#19083 56e8d234b Stop the TRIM and initialize threads when a vdev goes
offline
#19090 ab994acdd dmu: remove dmu_prealloc()
#19092 61fbdf1a2 zfs: spa_sync_upgrades() should only take lock when needed
Obtained from: OpenZFS
OpenZFS commit: 02b5baf13cbfdf9abd33b939a082b448951d9174
Without this patch, nd_xprt is only set for NFSv4.1/4.2. The nfsrdma.ko needs it to be set for all versions of NFS, so this one line patch does that. No semantics change for non-RDMA NFS service. MFC after: 3 months Fixes: https://cgit.freebsd.org/src/commit/?id=7144a1d58c5c ("nfsd: Add glue for the nfsrdma.ko module")
Kernel stuff (other than networking, filesystems, and drivers).
Yet again. I was trying to make the svc_vc_backchannel() operations do double duty and be used by the clnt_rdma.c code as well. It got too messy, so this reverts svc_vc.c back to its pre-glue form and adds the small changes needed to support a separate set of svc_rdma_backchannel_xxx() functions. This commit should not affect non-RDMA behaviour. MFC after: 3 months Fixes: https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
This fixes the build for kernels with INVARIANT_SUPPORT but without INVARIANTS. Fixes: https://cgit.freebsd.org/src/commit/?id=2e376cca379b ("rangelock: Reimplement _rangelock_cookie_assert()")
LinuxKPI: rcu: add optional condition to list_for_each_entry_rcu() list_for_each_entry_rcu() can take an optional condition. Add the macro argument so code remains compiling but do not do anything with it just yet. Leave comments as list_for_each_entry_rcu() likely should have a different implementation. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D59292
LinuxKPI: add #include of rculist.h to ethtool.h for Linux conformance Add #include rculist.h to ethtool.h to fullfill expectations of Linux drivers without having to modify them. MFC after: 3 days Reviewed by: dumbbell, emaste Differential Revision: https://reviews.freebsd.org/D58874
LinuxKPI: add typedef for clockid_t Needed by a wireless driver (not really using it) to compile. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58877
LinuxKPI: pci: add pci_select_bars() and pci_msix_vec_count() For pci_select_bars() we use the LinuxKPI internal information, while for pci_select_bars() we fall back to the native PCI stack. Needed by a wifi driver. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58878
LinuxKPI: fix argument type to lkpi_pci_msi_desc_alloc() lkpi_pci_msi_desc_alloc() takes an unsigned int, not an int. While here make sure the prototype is visibile in interrupt.h as well before use to avoid -Wimplicit-function-declaration errors. Discovered while working on a wireless driver. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58879
LinuxKPI: implement dma_{alloc,free}_{noncoherent,attrs}
We use one to implement the other given direction stays unused.
This is needed by an upcoming wifi driver.
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58880
LinuxKPI: add PCI_IRQ_AFFINITY #define Add the #define for PCI_IRQ_AFFINITY and leave a pr_debug note in pci_alloc_irq_vectors() that it is unimplemented. The flag is needed by an upcoming WiFi driver. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58881
LinuxKPI: pci: add reset_{prepare,done} to pci_error_handlers
Needed by an upcoming wireless driver.
MFC after: 3 days
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58882
LinuxKPI: add can_wakeup option and accessor functions We can implement device_set_wakeup_capable() in the !CONFIG_PM_SLEEP case; we do not have the infrastructure in place for the CONFIG_PM_SLEEP case so leave a pr_debug TODO. Needed by an upcoming wireless driver. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D58883
Add the missing locking to another two MO driver downcalls, as drivers always expect it (e.g. rtw89 by assertion). Add the lock and might_sleep assertions to the respective lkpi_80211_mo_* downcalls. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298417 Reviewed by: bz MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D59608
The size of multiple embedded structs have changed and may lead to problems (pci_error_handlers in pci_driver, dev_pm_info in struct device). Allow these changes to be detected by bumping __FreeBSD_version. MFC after: 3 days
There are two parts that go together: * `X86_MATCH_VFM()` to declare a matching pattern * `x86_match_cpu()` to check if the current CPU matches one of the patterns in an array. The i915 DRM driver started to use this in Linux 6.14. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57700
The generic if_qflush() only clears if_snd. Calling it directly for a transparent VF bypasses the driver's callback and its private software transmit queues. Add if_getqflushfn(), matching the existing callback accessors, and invoke the registered callback while hn_vf_lock protects the VF pointer. Flush an attached VF whenever transparent mode owns it, not only while the VF datapath is enabled. Disabling transmit during handoff does not discard packets already queued to the VF. This also covers the inactive interval after fallback. Non-transparent VFs remain independently owned and are not flushed by hn. Synthetic queue flushing is unchanged. MFC after: 2 weeks Sponsored by: BBOX.io
This fixes the build on other architectures where `struct x86_cpu_id` is unavailable. Sponsored by: The FreeBSD Foundation
Add the extended control interface Values match the reference ABI; the new struct layouts are pinned with static assertions. Reported by: thierry Reviewed by: adrian, thierry Differential Revision: https://reviews.freebsd.org/D59496
This is what FreeBSD now does for memdup_user and memdup_array_user (which is wrong for memdup, but correct for vmemdup). The amdgpu DRM driver started this in Linux ~6.12.86+ Reviewed by: wulf MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D57444
[PATCH 06/31] FreeBSD OFED support for DPDK MLX5 PMD CQE compressing reduces PCI overhead by coalescing and compressing multiple CQEs into a single merged CQE. Successful compressing improves message rate especially for small packet traffic. CQE compressing is supported for all 64B CQE formats (with certain limitations) generated by RQ/Responder or by SQ/Requestor. IB/mlx5: Report mlx5 CQE compression capabilities when querying device The capabilities include: - Max number of compressed and aggregated CQEs in a single session, while zero means unsupported. - For Responder, there are two formats of mini CQE: mini CQE with Rx hash and mini CQE with checksum. They're mutual exclusive. Differential revision: https://reviews.freebsd.org/D32180 MFC after: 1 month
[PATCH 11/31] FreeBSD OFED support for DPDK MLX5 PMD The MLX5 core driver recognizes a VF device as a PF device in FreeBSD VM, because mlx5_core_pci_table was not having VF flag MLX5_PCI_DEV_IS_VF. Added MLX5_PCI_DEV_IS_VF flag in mlx5_core_pci_table. Updated PCI_VDEVICE macro in LinuxKPI for class and class_mask, same as linux. Differential revision: https://reviews.freebsd.org/D32185 MFC after: 1 month
Use designated initializers for .class and .class_mask in PCI_VDEVICE(), and set .driver_data explicitly on the VF entries, rather than relying on positional initializers. Sponsored by: NVidia networking MFC after: 1 month
PATCH 13/31] FreeBSD OFED support for DPDK MLX5 PMD The capabilities whether hardware support multi packet WQE or not is exposed to user space through query_device by uhw. Differential revision: https://reviews.freebsd.org/D32187 MFC after: 1 month
[PATCH 14/31] FreeBSD OFED support for DPDK MLX5 PMD a) Add support to receive specific Vxlan packet in ConnectX-4. b) Add support to match packet fields which are tunneled, i.e. support matching the header of the inner packet which is the result of or bit operation of the original header and the IB_FLOW_SPEC_INNER type. The combination of IB_FLOW_SPEC_INNER | IB_FLOW_SPEC_VXLAN_TUNNEL is not needed to be checked, because the IB core has this check already. Dfiferential revision: https://reviews.freebsd.org/D32188 MFC after: 1 month
[PATCH 15/31] FreeBSD OFED support for DPDK MLX5 PMD Enable mlx5 based hardware to report packet pacing capabilities from kernel to user space. Packet pacing allows to limit the rate to any number between the maximum and minimum, based on user settings. The capabilities are exposed to user space through query_device by uhw. The following capabilities are reported: - The maximum and minimum rate limit in kbps supported by packet pacing. - Bitmap showing which QP types are supported by packet pacing operation. Differential revision: https://reviews.freebsd.org/D32189 MFC after: 1 month
[PATCH 17/31] FreeBSD OFED support for DPDK MLX5 PMD Software parsing (SWP) is a feature that can be used to instruct the device to stop using its internal parser and to parse packets on the transmit path according to offsets set for each packets. Through this feature, the device allows the handling of checksum and LSO by the hardware according to the location of IP and TCP/UDP headers. Enable SW parsing on Raw Ethernet send queue by default if firmware supports it and report these capabilities to user space. Differential revision: https://reviews.freebsd.org/D32191 MFC after: 1 month
[PATCH 21/31] FreeBSD OFED support for DPDK MLX5 PMD a) This patch reports the device's striding RQ capabilities to the user-space: - min/max_single_stride_log_num_of_bytes: Log of min/max number of bytes in a single stride. - min/max_single_wqe_log_num_of_strides: Log of min/max number of strides in a single WQE. - supported_qpts: A bit mask to know which QP types support multi- packet RQ, for now only Raw Packet QPs. b) Allow creation of a multi-packet receive queue. In order to create a multi-packet RQ, the following fields in the mlx5_ib_rwq should be set: - log_num_strides: Log of number of strides per WQE - single_stride_log_num_of_bytes: Log of a single stride size - two_byte_shift_en: When enabled, hardware pads 2 bytes of zeros before writing the message to memory (e.g. for the IP alignment). Differential revision: https://reviews.freebsd.org/D32195 MFC after: 1 month
[PATCH 22/31] FreeBSD OFED support for DPDK MLX5 PMD a) The device can support receive Stateless Offloads for the inner packet's fields only when the packet is processed by TIR which is enabled to support tunneling. Otherwise, the device treats the packet as an ordinary non-tunneling packet and receive offloads can be done only for the outer packet's field. In order to enable receive Stateless Offloading support for incoming tunneling traffic the TIR should be created with tunneled_offload_en. Tunneling offloads is supported only be raw ethernet QP. This patch includes: - New QP creation flag for tunneling offloads. - Reports device capabilities. b) IB/mlx5: Add support for RSS on the inner packet Some user space application would like to do RSS on the inner packet fields instead on the outer. When MLX5_RX_HASH_INNER is set with one or more of the other hash fields, then the RSS will be done using the inner packet. Differential revision: https://reviews.freebsd.org/D32196 MFC after: 1 month
Import Linux upstream commit 4e2b53a5cb5a ("IB/mlx5: Report inner RSS
capability").
Define MLX5_RX_HASH_INNER as (1UL << 31). Shifting 1 into the sign bit of
a plain int is undefined behaviour, and user space compiles this header
too. The main.c half of that commit is already carried by the preceding
fixup.
Sponsored by: NVidia networking
MFC after: 1 month
[PATCH 25/31] FreeBSD OFED support for DPDK MLX5 PMD Struct mlx5_ib_striding_rq_caps was not aligned to 64 bit as it should have been. Add a 32 bit reserved field. Differential revision: https://reviews.freebsd.org/D32200 MFC after: 1 month
The security.mac.bsdextended.rules.<N> node handler takes N as `index = name[0]` (a signed int) and only checks `index >= MAC_BSDEXTENDED_MAXRULES`. A negative index is caught on the read branch, but the write-only add and delete branches proceed to `rules[index]` unconditionally. Reject `index < 0` alongside the existing upper-bound check. Submitted by calif.io for the OpenAI Patch The Planet program Signed-off-by: Andrew Griffiths <andrew@calif.io> Reviewed by: markj MFC after: 2 weeks
The kern.proc.kstack handler allocates its output and stack buffers before deliberately checking p_candebug again under the process lock. If trace-control state changes between authorization checks, the failure path balances the process and exec state but leaks both buffers. Submitted by calif.io for the OpenAI Patch The Planet program Signed-off-by: Andrew Griffiths <andrew@calif.io> Fixes: https://cgit.freebsd.org/src/commit/?id=8b5abd9027b8 ("kern_proc.c: disallow execve around sysctl kern.proc.kstacks") Reviewed by: markj MFC after: 1 week
Requred by drm-kmod v6.12.103 Obtained from: OpenBSD Reviewed by: bz, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59733
Required by drm-kmod v6.12.105 Reviewed by: bz, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D59734
Add compile-time optional, non-sleeping fail points around every VF creation resource boundary, before VF VSI reconstruction, and in the GET_STATS validation path. Provide an ICE-wide wrapper and device selector so other driver subsystems can add scoped points without duplicating the failpoint plumbing. Keep the current SR-IOV points and VF selector in an iov child namespace. Compile the facility only with options DRIVER_FAILPOINTS. This shared option avoids a separate kernel option for every driver that provides test-only injection hooks. Ordinary kernels contain no ICE failpoint objects or sysctl nodes. Require an exact PF device name and optionally a VF index before any point can fire. This prevents a stale test setting from affecting another PF. The hooks exposed two reset-lifetime defects while validating the existing SR-IOV review series. A PF reset could discard a firmware VSI before teardown, and a rebuilt sibling could leave stale switch-filter state after IOV destroy. Tested on an E810-XXV with INVARIANTS and WITNESS. All twelve creation checkpoints rolled back and permitted immediate resource reuse. Forced reconstruction and malformed GET_STATS failures also preserved sibling operation and reply cardinality. Reviewed by: gallatin, nprice, ziaee MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58940
This warning triggers in a few places in contributed code, and would therefore be annoying to fix. Use -Wno-error= to at least show the warnings so there is some incentive to submit them upstream. MFC after: 3 days
Now that semi-native drivers in main are clean of using any pre-4.15 Linux timer KPI, remove the macros from LinuxKPI as well. Supported versions of drm-kmod and the oldest nvidia port seem fine based on my checks. If anything else surfaces we can deal with the fallout; the changes to the newer KPI were mechanical in Linux and can be applied easily. This change can be detected by #if !defined(init_timer) at compile time so no need for a __FreeBSD_version bump. MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D59688
Required by drm-kmod 6.12.101. Reviewed by: bz, dumbbell Differential Revision: https://reviews.freebsd.org/D59732
Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59739
This is intended to be used on resuming to check that everything that happened during suspend was expected. It is not meant to check for errors we should hard-fail from, rather it should be used as an opportunity for drivers such as amdsmu(4) to check e.g. whether the previous suspend-to-idle actually entered a deep sleep state (S0i3). Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59740
sched_4bsd: remove kern.sched.4bsd.followon kern.sched.4bsd.followon was enabled only for KSE. It was never compiled since ad1e7d285ab1 and KSE was removed years ago. Now it's time to remove this tunable. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59394
sched_4bsd: remove dumping from maybe_preempt() 'dumping' is true only when kernel is dumping after crash (see minidumpsys()) so KERNEL_PANICKED() will catch this. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59395
sched_4bsd: add static assertion for nice weight When NICE_WEIGHT * (PRIO_MAX - PRIO_MIN) exceeds the timeshare range, two CPU-bound threads with different nice values can have the same priority as their nice values are clamped to the timeshare range limit. Add static assertion on NICE_WEIGHT to ensure that there is always enough room for nice values in the both end of the timeshare priority range. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59396
sched_4bsd: update function name in comment
In b43179fbe815 ("Create a new scheduler api..."), schedclock() was
renamed to sched_clock() but the function name in the comment remained
still. Update the comment to reflect up-to-date name for schedclock().
Reviewed by: olce
Approved by: olce (mentor)
Fixes: https://cgit.freebsd.org/src/commit/?id=b43179fbe815 ("Create a new scheduler api...")
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59397
sched_4bsd: remove obsolete comment In old Unix, the whole process address space including scheduler-related data was paged out to disk. We now allocate thread-related data with UMA on wired memory which never page out. Thus this comment is now obsolete. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59398
Commit 62fa74d95a16 ("Add support for the new cpu...") removed all uses
of KTR_ULE, leaving the macro unused.
Reviewed by: olce
Approved by: olce (mentor)
Fixes: https://cgit.freebsd.org/src/commit/?id=62fa74d95a16 ("Add support for the new cpu...")
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59399
Fix three problems with kern.sched.{4bsd,ule}.slice:
* Guarantee minimum slice is 1.
* Recalculate hogticks on sysctl write.
* For ULE, recalculate sched_slice_min on sysctl write.
Reviewed by: olce
Approved by: olce (mentor)
MFC after: 2 weeks
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59401
sched_4bsd: fix comment in maybe_preempt() The comment says the new thread's priority is not a realtime priority while the code states pri > PRI_MAX_ITHD which is interrupt priorities not realtime. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59402
sched_4bsd: move comment to correct location Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59403
sched_4bsd: remove obsolete comment 'awake' checks if a thread, not a process, is awake. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59404
sched_4bsd: fix vague comment The comment "was incremented in schedcpu()" doesn't give enough background for decrementing ts_slptime by 1 (thus ignoring decay_cpu() for 1 ts_slptime). More accurately, ts_slptime is decremented by 1 because decay_cpu() has already executed once in schedcpu() when ts_slptime was 1. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59406
In ULE ts_slice stores the number of ticks of slice passed not remaining. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59407
sched_slice_min should always to be greater than zero. When modifying sched_slice through sysctl, if the new value is less than SCHED_SLICE_MIN_DIVISOR, sched_slice_min is computed to zero. Add imax(1, ...) to prevent this. tdq_slice() should not return a value less than sched_slice_min since that will cause integer underflow of ts2->ts_slice in sched_ule_fork_thread. SCHED_SLICE_MIN_DIVISOR is currently set to 6 so when load is 5 and sched_slice is 4, the two if conditions in tdq_slice() will pass and the function will return zero. Thus use imax() so tdq_slice returns sched_slice_min at minimum. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59408
Suggested by: olce Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59471
sched_schedcpu() is called only during SYSINIT to start kthread that calls schedcpu() every second in 4BSD, but its name implies it's doing what 4BSD's schedcpu() does. Rename this function to sched_sysinit() to mark that schedulers can use it for its own SYSINIT routine. Note that their SYSINIT routine does not necessarily need to be similar to 4BSD's decay in schedcpu(). The scheduler.9 man page is planned to be rewritten from scratch, so no change to it for now. Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59437
To be used in _Generic() KPIs that accept different lock types. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D59455
This is type agnostic locked callout initializer. The callout_init_mtx() and etc remain for compatibility. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D59456
And enable locking assertions for INVARIANTS kernel. Reviewed by: gallatin, kib, markj Differential Revision: https://reviews.freebsd.org/D59457
If a buffer ring experiences drops, then system is definitely starving in CPU resources. Having an extra cache miss on a racy shared variable increment doesn't help. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D59495
Without this patch, the code failed to acquire the error return for clnt_bck_rdma_send() and could use "error" uninitialized. No semantics change for non-RDMA NFS service. MFC after: 3 months Fixes: https://cgit.freebsd.org/src/commit/?id=7144a1d58c5c ("nfsd: Add glue for the nfsrdma.ko module")
Add a maxsegs field to rpcrdma_xprt, which is used to set the number of segments allowed for a chunk based on device attributes. This commit should not affect non-RDMA behaviour. MFC after: 3 months Fixes: https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
When compiling the kernel with gcc 14, errors similar to the following
are emitted:
sys/dev/cxgbe/iw_cxgbe/ev.c: In function 'c4iw_ev_handler':
sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
132 | flags == 0; \
sys/dev/cxgbe/iw_cxgbe/ev.c:274:17: note: in expansion of macro 'xa_unlock_irqrestore'
274 | xa_unlock_irqrestore(&dev->cqs, flag);
| ^~~~~~~~~~~~~~~~~~~~
sys/compat/linuxkpi/common/include/linux/xarray.h:132:23: error: statement with no effect [-Werror=unused-value]
132 | flags == 0; \
sys/dev/cxgbe/iw_cxgbe/ev.c:283:17: note: in expansion of macro 'xa_unlock_irqrestore'
283 | xa_unlock_irqrestore(&dev->cqs, flag);
| ^~~~~~~~~~~~~~~~~~~~
It looks like the intent of the "flags == 0" statement was to make the
'flags' macro argument not unused, but it still results in a warning.
Use the construct "(void)flags" instead.
Reviewed by: bz
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D59787
This new manpage describes what the apple_bce driver services, how the driver is configured, and what Apple models the driver claims to support. Reviewed by: seuros Differential Revision: https://reviews.freebsd.org/D59467
sysrc: make independant from bsdconfig(8) MFC After: 1 week Approved by: dteske Reviewed by: dteske Differential Revision: https://reviews.freebsd.org/D59658
Remove source_rc_confs, inlined from defaults/rc.conf Inlining source_rc_confs broke sysrc_test:A_flag While here, switch to SPDX, bump version/copyrights, fixup comments. Prevent common function override when bsdconfig includes new sysrc.subr that contains inlined commons. Fix non-unique duplicate header variable incorrectly shared between bsdconfig's sysrc.subr include and new sysrc.subr include. Harden RC_DEFAULTS parameter expansion from DoS-via-glob (SC2223). Move pgm to the correct location to not override bsdconfig's pgm. Drop _SYSRC_JAILED=1 that is no-longer needed. Drop i18n from jail_depend now that messages are inlined to subr. Reported by: siva Fixes: https://cgit.freebsd.org/src/commit/?id=eaeb5f29bc6f sysrc: make independant from bsdconfig(8)
The passthrough ioctl has a userland ABI header, but nothing installed it. A program that wanted to use the ioctl had to copy the headers out of the source tree by hand. Install ufshci.h and ufshci_ioctl.h under /usr/include/dev/ufshci, the way nvme installs nvme.h. The ioctl header pulls in ufshci.h, so both go. Add the directory to the include mtree so installworld creates it. Reviewed by: imp (mentor) Sponsored by: Samsung Electronics Differential Revision: https://reviews.freebsd.org/D59560
For consistency, create a symbolic link from enic.4 to also if_enic.4 Reviewed by: ziaee, #manpages Differential Revision: https://reviews.freebsd.org/D59755 MFC after: 3 days
This warning triggers in a few places in contributed code, and would therefore be annoying to fix. Use -Wno-error= to at least show the warnings so there is some incentive to submit them upstream. MFC after: 3 days
Using a backtick inside a backtick-expansion isn't a good idea; switch instead to using $( ... ). Fixes: https://cgit.freebsd.org/src/commit/?id=a9710349513f ("EC2: Add desktop flavour") Sponsored by: Amazon
We don't have any packages to install by default when the instance first boots, so (as with the "small" flavour) don't enable the firstboot_pkgs script. If someone wants to launch a desktop with packages autoinstalled at first boot, they can enable the script at the same time as they provide the list of packages. Sponsored by: Amazon
Sponsored by: Chelsio Communications
Move back to the current committers section and record fuz and jrm as mentors. Approved by: portmgr Reviewed by: fuz (mentor), jrm (co-mentor) Differential Revision: https://reviews.freebsd.org/D59500
Approved by: adrian (mentor) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D59860 Signed-off-by: Nick Price <nprice@FreeBSD.org>
Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D59861
Split accepted ABIs test into separate case and conditionally xfail it on archs that don't have linux(4) support. This fixes a CI test failure[0]. [0] https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16706/testReport/usr.bin.truss/truss_test/unknown_syscall/ Reviewed by: dteske MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59594
These could go in other categories, but it's more clear if they're here instead.
Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59400
Reviewed by: olce Approved by: olce (mentor) MFC after: 2 weeks Sponsored by: FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59409
MFC after: 3 days
The VF-up script repeatedly deletes the first IPv4 address from hn until ifconfig fails. Netlink-based ifconfig returns success when no address remains, so the script can loop forever and block subsequent devd work. Use ipv4_down() from the already-sourced network.subr to enumerate the addresses and delete each explicitly. This also handles multiple addresses without relying on the exit status of an empty deletion. The behavior depends on ifconfig, not the VF hardware, so no device-specific fallback is needed. Fixes: https://cgit.freebsd.org/src/commit/?id=c68595695679 ("hyperv: Add VF bringup scripts and devd rules.") MFC after: 2 weeks Sponsored by: BBOX.io
The default VF-up script moves IPv4 configuration from the synthetic interface to a failover lagg, but leaves IPv6 unconfigured on the lagg. Adding the synthetic interface as a member can remove its IPv6 addresses, so deleting the remaining member addresses is not sufficient. Stop accepting router advertisements on the synthetic interface before adding it to the lagg. Leave its link-local address and IPv6 enable state in place for lagg's address, prefix and default-router cleanup, then disable IPv6 and explicitly remove any remaining addresses. This also covers members without a link-local address or with IPv6 already disabled. Replay the synthetic interface's IPv6 rc.conf configuration on the lagg, including aliases, prefix-derived addresses and legacy configuration names. Remap the variables in a subshell and reuse network.subr's IPv6 helpers. For SLAAC, solicit fresh router advertisements rather than copying learned addresses as permanent ones. Configure IPv6 independently of the IPv4 DHCP/static choice, and leave existing laggs alone on repeated invocation. Custom DHCPv6 clients and interface-scoped static routes still require the per-interface setup hook. Fixes: https://cgit.freebsd.org/src/commit/?id=c68595695679 ("hyperv: Add VF bringup scripts and devd rules.") MFC after: 2 weeks Sponsored by: BBOX.io
Sponsored by: Chelsio Communications
This change allows libcxgb4 to post send/recv drain work requests after a QP is flushed and schedules a CQE on the software CQ for the application to note the drain's completion. Sponsored by: Chelsio Communications
Remove it because it is not needed. If we're flushing the qp, it is because we've had a fatal error, so just set the user qp state to ERR and continue on. Sponsored by: Chelsio Communications
[PATCH 02/31] FreeBSD OFED support for DPDK MLX5 PMD Extend mlx5dv_get_qp() to return UAR mapping info. This can allow a process to share its doorbell access with secondary process by re-mmap the UAR address on the device and make it accessible as a user space address. Differential revision: https://reviews.freebsd.org/D32176 MFC after: 1 month
Import rdma-core upstream commit d2389b34ccc5 ("mlx5: Add missing include
file in mlx5dv.h").
Including <sys/types.h> keeps mlx5dv.h self-contained: off_t, used by the
new uar_mmap_offset field, is now always defined. The man page gains the
uar_mmap_offset line upstream documents in 5dd3ead7b5f5.
Sponsored by: NVidia networking
MFC after: 1 month
PATCH 16/31] FreeBSD OFED support for DPDK MLX5 PMD a) verbs: Annotate ibv_wc helpers with endian This follows the scheme as used in the wc by introducing a ibv_wc_read_invalidated_rkey to access the host endian invalidated_rkey value with proper annotations. This is just an inline wrapper to allow sparse to work sensibly, not really a good reason to add another driver entry point. b) verbs: Annotate ibv_send_wr with endian This follows the scheme as used in the wc by introducing a transparent union in ibv_send_wr to indicate the invalidate_rkey is in host endian. c) mlx5: Add sparse annotations. Differential revision: https://reviews.freebsd.org/D32190 MFC after: 1 month
Fix is based on upstream rdma-core commit 14a0fc824f16 ("rdma-core/irdma:
Implement device supported verb APIs").
Use ib_wr->invalidate_rkey instead of ib_wr->imm_data for
IBV_WR_SEND_WITH_INV and IBV_WR_LOCAL_INV. The two share a union, but
imm_data is __be32 while the rkey to invalidate is host order, so with the
new endian annotations this path reads the wrong member. Upstream irdma
has always used invalidate_rkey here.
Sponsored by: NVidia networking
MFC after: 1 month
[PATCH 18/31] FreeBSD OFED support for DPDK MLX5 PMD Provide two implementations of mlx5dv_init_obj, one that has the historical behaviour that has existed until now of returning the void **uar and a new version that returns the 'void *' version renamed to cq_uar. Differential revision: https://reviews.freebsd.org/D32192 MFC after: 1 month
Actually provide the two ABI versions this commit describes: export mlx5dv_init_obj@@MLX5_1.2 with the current behaviour and a compat mlx5dv_init_obj@MLX5_1.0 that restores the historical 'void **' value, and list the symbol under both versions in libmlx5.map. Binaries linked against the old version keep resolving. Sponsored by: NVidia networking MFC after: 1 month
[PATCH 19/31] FreeBSD OFED support for DPDK MLX5 PMD Add a new DV API mlx5dv_set_context_attr() to enable setting an external memory allocator. This API will allow the application to use specific decisions about the memory allocation of HW resources (e.g. DV objects). Some examples are managing numa pinning per object, managing a hugepages resource pool, shared memory regions. Also extend mlx5dv_get_qp() to return UAR mapping info. This can allow a process to share its doorbell access with secondary process by re-mmap the UAR address on the device and make it accessible as a user space address. Differential revision: https://reviews.freebsd.org/D32193 MFC after: 1 month
Match a doorbell to its page with a range check instead of a page-boundary mask, so mlx5_free_db() also works for external allocations that are not page aligned and no longer leaks the doorbell page. Sponsored by: NVidia networking MFC after: 1 month
PATCH 20/31] FreeBSD OFED support for DPDK MLX5 PMD a) Use flag MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED to indicate hardware supports multi packet WQE and it's enabled in SQ context. Flag MLX5DV_CONTEXT_FLAGS_MPW is deprecated, shall not be used in new applications. b) Report if enhanced multi packet send WQE is supported through mlx5 direct verbs. Differential revision: https://reviews.freebsd.org/D32194 MFC after: 1 month
Interpret the kernel's raw multi_pkt_send_wqe value (0, 1 or 3) instead of masking it against a bitmask the kernel never emits, which silently disabled MPW. Sponsored by: NVidia networking MFC after: 1 month
[PATCH 23/31] FreeBSD OFED support for DPDK MLX5 PMD a) Expose tag matching capabilities and show them in ibv_devinfo. b) verbs: Introduce tag matching SRQ Introducing tag matching SRQ (TM-SRQ), which retains basic semantic of regular SRQ, reports completions to own CQ, and has additional tag based message receiving mechanism. Detailed description for the TM-SRQ usage was added into Documentation/tag_matching.md c) mlx5: Add support to tag matching SRQ type Create command QP for a tag-matching SRQ. Command QP used for inserting/removing entries from the tag matching list. This command QP is hidden from the users in the mlx5_srq structure. New verb ibv_post_srq_ops() will be added in next patch to use it. Differential revision: https://reviews.freebsd.org/D32198 MFC after: 1 month
Reject TM-SRQ creation when tm_cap.max_ops is 0, so the internal command QP's send queue is not sized to zero work-queue entries. Sponsored by: NVidia networking MFC after: 1 month
[PATCH 24/31] FreeBSD OFED support for DPDK MLX5 PMD Software parsing (SWP) is a feature that can be used to instruct the device to stop using its internal parser and to parse packets on the transmit path according to offsets set for each packet. Through this feature, the device allows the handling of checksum and LSO by the hardware according to the location of IP and TCP/UDP headers. Report various SW parsing capabilities and supported QP types through mlx5 direct verbs interface. Differential revision: https://reviews.freebsd.org/D32199 MFC after: 1 month
[PATCH 26/31] FreeBSD OFED support for DPDK MLX5 PMD A Multi-Packet RQ is a receive queue where multiple packets are written to the same WQE. Each message starts in the beginning of a stride. The total size of the scatter elements of each WQE is determined upon RQ creation and all the posted WQEs should meet the determined size. A Multi-Packet RQ reduces the number of needed post-recv operations thus increasing performance. It reduces memory footprint by allowing each packet to consume a different number of strides instead of the whole WR. Differential revision: https://reviews.freebsd.org/D32201 MFC after: 1 month
[PATCH 27/31] FreeBSD OFED support for DPDK MLX5 PMD
a) Add needed definitions to allow creation of a Multi-Packet RQ
using the mlx5 direct verbs interface.
In order to create a Multi-Packet RQ, one needs to provide a
mlx5dv_wq_init_attr containing the following information in its
striding_rq_attrs struct:
- single_stride_log_num_of_bytes: log of size of each stride
- single_wqe_log_num_of_strides: log of number of strides per WQE
- two_byte_shift_en: When enabled, hardware pads 2 bytes of zeros
before writing the message to memory (e.g. for IP alignment).
b) Add a helper function to verify 64 bit comp mask
The common check for a mask is as follows:
if (comp_mask & ~COMP_MASK_SUPPORTED_VALUES)
return EINVAL;
This can cause an issue when using 64 bit mask if the supported variable
is signed 32 bit: It will be bitwise inverted and then zeroed to 64
bits. Hence, wrong bits in the mask that exceed 32 bits will not raise
an error but would be ignored.
To fix this, a helper function is added in driver.h to be used by providers
code and fix wrong mask checks where the above was found to be applicable.
Differential revision: https://reviews.freebsd.org/D32202
MFC after: 1 month
[PATCH 28/31] FreeBSD OFED support for DPDK MLX5 PMD a) In order to enable offloading such as checksum and LRO for incoming tunneling traffic, the QP should be created with tunnel offloads flag - MLX5DV_QP_CREATE_TUNNEL_OFFLOAD. b) Reports capability of which tunneling type supports the tunneling offloads. c) verbs: Add support in RSS of the inner packet Some user space application would like to do RSS on the inner packet fields instead of the outer. When user will set the IBV_RX_HASH_INNER bit with one of the other hash fields, then the RSS will be on the inner packet. Differential revision: https://reviews.freebsd.org/D32203 MFC after: 1 month
Fix is based on upstream rdma-core commit ee54f9d5348f ("mlx5: Add
loopback flags to QP creation").
Validate create_flags against a supported-flags mask instead of rejecting
anything that is not MLX5DV_QP_CREATE_TUNNEL_OFFLOADS. A create_flags of
0 is now accepted, unknown bits are rejected, and the vendor flag is OR-ed
in rather than assigned. The loopback flags that commit also adds do not
exist in this tree, so only the validation is taken.
Sponsored by: NVidia networking
MFC after: 1 month
[PATCH 30/31] FreeBSD OFED support for DPDK MLX5 PMD a) Allow verbs applications packet steering of GRE tunneled traffic. Adding GRE flow specification based on RFC 2890. GRE consists of flags, protocol and key fields. IPv4 protocol 47 (IPPROTO_GRE) can be used when GRE packets are encapsulated in IPv4. b) verbs: Add MPLS flow specification filter Add MPLS flow specification based on RFC 3032. MPLS spec defined with label field which includes the label value and additional parameters such as: BoS, TC and TTL. MPLS allows stacking multiple labels in sequence. In addition, the MPLS header can be encapsulated on top of different layers, e.g.: ETH, IP (rfc4023), UDP (rfc7510), GRE (rfc4023). Therefore, when using the flow creation verb, the application should organize the spec filters list in the command in an ordered manner, such that reflects the actual protocol stack of the packet, to determine the exact position of the MPLS headers in the protocol stack. c) mlx5: Report MPLS tunnel offload capabilities through mlx5 direct verbs This patch exposes the mlx5 device's capability to offload MPLS based tunnel protocols via DV API. The possible protocols are: - Control word + MPLS over GRE. - Control word + MPLS over UDP. Differential revision: https://reviews.freebsd.org/D32205 MFC after: 1 month
Import rdma-core upstream commit ff01da2c5ac2 ("verbs: Fix typo in copying
IBV_FLOW_SPEC_UDP/TCP 'val'").
The TCP/UDP filter value was copied using the size of the IPv4 filter,
overrunning the destination subobject.
Also accept inner MPLS flow specs, matching 6d6f29721eea ("verbs: Allow
creation of inner MPLS flow spec"). Upstream deliberately has no inner
case for GRE - it is a tunnel header, matched only in the outer stack - so
that part of the review comment is not applied.
Sponsored by: NVidia networking
MFC after: 1 month
Release notes at
https://community.nlnetlabs.nl/t/unbound-1-26-1-released
Merge commit '120aa088f4807126af42a652a07c5090e7294fcf'
Security: CVE-2026-77860
Security: CVE-2026-77955
Security: CVE-2026-78227
Security: CVE-2026-80225
Security: CVE-2026-81634
Security: CVE-2026-81642
Security: CVE-2026-82717
Security: CVE-2026-82720
Security: CVE-2026-85501
Fix -Wformat diagnostic after #190965 (#193704)
Fixes libunwind compiler diagnostic when building with clang after
034d4dcad6396d1241e8262e69871b8d61da7e4f:
```
In file included from libunwind/src/libunwind.cpp:31:
In file included from libunwind/src/UnwindCursor.hpp:52:
libunwind/src/CompactUnwinder.hpp:339:46: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
338 | "function starting at 0x%llX",
| ~~~~
| %lX
339 | compactEncoding, functionStart);
| ^~~~~~~~~~~~~
libunwind/src/config.h:215:63: note: expanded from macro '_LIBUNWIND_DEBUG_LOG'
215 | #define _LIBUNWIND_DEBUG_LOG(msg, ...) _LIBUNWIND_LOG(msg, __VA_ARGS__)
| ~~~ ^~~~~~~~~~~
libunwind/src/config.h:181:45: note: expanded from macro '_LIBUNWIND_LOG'
181 | fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__); \
| ~~~ ^~~~~~~~~~~
In file included from libunwind/src/libunwind.cpp:31:
In file included from libunwind/src/UnwindCursor.hpp:52:
libunwind/src/CompactUnwinder.hpp:458:39: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
457 | "function starting at 0x%llX",
| ~~~~
| %lX
458 | encoding, functionStart);
| ^~~~~~~~~~~~~
libunwind/src/config.h:215:63: note: expanded from macro '_LIBUNWIND_DEBUG_LOG'
215 | #define _LIBUNWIND_DEBUG_LOG(msg, ...) _LIBUNWIND_LOG(msg, __VA_ARGS__)
| ~~~ ^~~~~~~~~~~
libunwind/src/config.h:181:45: note: expanded from macro '_LIBUNWIND_LOG'
181 | fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__); \
| ~~~ ^~~~~~~~~~~
```
This avoids a -Werror failure with clang >= 23.
MFC after: 3 days
MFC after: 1 week
This reverts commit fc0a5ae094308609927e9c355928d08923278325. This changed the sysctl node path and broke IB user space tools (ibv_*). PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298485 Reported by: Ariel Ehrenberg (aehrenberg nvidia.com)
virtual_oss(8): Fix cuse.ko check virtual_oss(8) checks if cuse(3) is loaded. However, kldload(2) ends up calling kern_kldload that checks permissions first. It is only later on in linker_load_module that -EEXIST is returned if the module is already loaded. That means that users that can't load modules, always get a -EPERM error first even if cuse.ko is already loaded and ready to use. Change it to check if the kernel module is already loaded and try load it if it isn't. In addition move the program's arguments parsing early on because otherwise, a user can't even access the program's help if cuse.ko is not loaded and the user doesn't have permissions to do it. Approved by: obiwac@ Differential Revision: https://reviews.freebsd.org/D59621
Revert "virtual_oss(8): Fix cuse.ko check" parse_options() was moved above cuse_init(), which makes every single regular virtual_oss invocation which uses cuse_dev_create() fail. This reverts commit f014795ec3bd5efb88dfc249599e9665dc10a59e.
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.21 at 2026-10-05 16:54:58+00:00.
This work is supported by Tarsnap Backup Inc.
Alternate version: 2026-09-14 (debug) (contains info about the classification)