vmxnet3: Propagate device-enable failure to iflib
Do not let iflib publish a running interface when the virtual device
rejected its enable command. Mark initialization failed and leave the
interface stopped.
MFC after: 2 weeks
Sponsored by: BBOX.io
iflibdd(9): Clarify resume during suspend rollback
The resume callback also runs when suspend fails, without an intervening
PCI power-state transition or configuration-space restore. Document
that drivers must not assume either has occurred.
MFC after: 2 weeks
Sponsored by: BBOX.io
ixgbe: Pause firmware recovery polling in low power
The firmware recovery callout continues polling controller registers
after a power transition. An inaccessible E610 GL_MNG_FWSM register
reads as all ones in D3, which looks like firmware recovery mode and
queues an iflib reset while the device is suspended. A later D0 poll
then reports recovery complete and queues another reset.
Pause and drain the callout before terminal stop policy is applied,
prevent an in-flight callback from rearming it, and restart polling
only after resume has cleared the wake state. Track callout
initialization so partial attach cleanup does not drain an uninitialized
callout.
The false transition was reproduced on a dual-port E610 with direct D3
and system S3. Validate the guard with wake-disabled and wake-armed D3,
three repeated D3 cycles per port, and an S3 magic-packet wake. Both
ports returned to D0 without a false recovery transition.
[2 lines not shown]
iflib: Reject media changes during suspend
iflib gates its built-in administrative and media-status callbacks once
a power transition starts, but iflib_media_change() could still invoke a
driver while the device was suspending or suspended. Several drivers
perform PHY or firmware I/O directly from this callback.
Return EBUSY before invoking IFDI_MEDIA_CHANGE() unless the device is
active. ifmedia then restores the prior selection, avoiding both
suspended hardware access and an unvalidated configuration that would
need to be replayed during resume.
Validated with device suspend on 82579LM, I210, and I225-IT
controllers. Media-selection requests returned EBUSY on every
suspended device. Resume restored the linked management interfaces at
1 Gbps with working traffic and no watchdogs; unconfigured interfaces
retained their prior admin and link state.
Reviewed by: iflib (gallatin)
[3 lines not shown]
iflib: Own queue quiescence during power transitions
Perform a terminal datapath stop before suspend and shutdown
callbacks, then drain the private configuration taskqueue before
entering low power. Track power state independently of queue
ownership and prevent built-in admin, IOV, LED, and media-status
callbacks from accessing a suspended device.
Restore driver-specific state while the datapath remains stopped.
Initialize it exactly once on resume when the interface is
administratively up, and keep an administratively-down interface
stopped. Roll back the driver when suspend or child suspension fails.
Add ifdi_power_prepare() for policy which must be established before
the terminal stop. Use it to snapshot ixgbe(4) wake policy and preserve
X550EM PHY ordering, and remove the duplicate stop from aq(4).
Reviewed by: iflib (gallatin)
MFC after: 2 weeks
[2 lines not shown]
iflib: Track queue datapath lifecycle
Track whether iflib queue mappings may still be accessed by the
device. Keep the state private to iflib and conservative: an unknown
or failed device must pass through IFDI_STOP() before mappings are
reused or released, while a device known to be stopped need not
receive another hardware stop.
Enter the starting state before IFDI_INIT(), publish running only
after receive buffers and framework state are ready, and stop hardware
if receive-buffer setup fails after driver initialization.
Do not initialize an administratively-down interface merely because
its MTU, capabilities, VLAN configuration, or media changed. Preserve
successful retries for an administratively-up interface whose previous
initialization failed.
This state describes ownership of iflib datapath mappings only. It
deliberately makes no claim about firmware queues, administrative DMA,
[6 lines not shown]
lib/msun: use the same algorithm for sw fmaf(3) as for fma(3)
This fixes rounding at the last bit for subnormals.
PR: 298260
Reviewed by: kib
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59579
if_bridge: pull up only the headers bridge_pfil() inspects
bridge_pfil() pulled up min(m_pkthdr.len, max_protohdr) bytes. When the
mapped head is shorter than that and followed by an unmapped (M_EXTPG)
mbuf -- a sendfile(2) or KTLS segment from a member advertising
IFCAP_MEXTPG -- m_pullup() ran into it and dereferenced a NULL mtod(),
panicking the kernel.
Pull up the Ethernet header first, and the SNAP/LLC header only for an
802.3 frame. This is similar to pf and ip_output().
m_pullup() and m_copyup() asserted only the first mbuf; assert inside both
copy loops so the shape trips the check.
Fixes: c38abd64dbc1 ("if_epair: support IFCAP_MEXTPG")
Suggested by: markj
Reviewed by: markj, gallatin
Assisted-by: Claude Code (Fable 5, Opus 5)
if_bridge: count the drops on the fragmentation path
bridge_pfil() returned a fragmentation failure without counting it,
and bridge_fragment() dropped a chain on three allocation failures
without counting those either.
Count the first on the filtered interface and the others with
ips_odropped, which is what ip_fragment() uses for the same failure
and what bridge_fragment() already uses for its success case.
Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D59391
Assisted-by: Claude Code (Fable 5, Opus 5)
LinuxKPI: Run irq_work callbacks under RCU protection
Linux executes irq_work callbacks from an interrupt context that
provides implicit RCU read-side protection. LinuxKPI dispatches these
callbacks through a taskqueue, so provide equivalent protection
explicitly.
This prevents an RCU grace period from completing while an irq_work
callback is still using an RCU-protected object.
Suggested by: wulf
Tested by: JustAnotherHumanBeing
Signed-off-by: JustAnotherHumanBeing <oleglelchuk at gmail.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/2385
hid: Add Sony DualSense gamepad driver
Add a driver for the Sony PS5 DualSense controller (054c:0ce6)
providing gamepad input via evdev, lightbar RGB LED control, and
player indicator LEDs through sysctl.
Signed-off-by: Christos Longros <chris.longros at gmail.com>
Reviewed by: ziaee, wulf
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D56345
kobj: allow multiple inheritance with per-class softc
Add support for hierarchical softc layout so that a leaf class and each
of its base classes owns a private softc region inside a single
allocation.
device_get_softc_class(dev, cls) returns a pointer to the softc that
belongs to the requested class. The classic device_get_softc() still
returns the leaf softc and remains fully compatible with existing
drivers.
Existing drivers are unaffected; they simply obtain a slightly larger
softc block when they inherit from base classes.
MFC after: 2 months
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D59115
amd64/pmap: Return la57 in amd nested page
AMD doesn't encode page depth in eptp. As a result, the page level is
decided by the host la57 value. Without this, it uses 4 level page and
therefore cause machine enable la57 have garbage page translation.
PR: 291768
Reviewed by: kib
Tested by: Antranig Vartanian <antranigv at freebsd.am>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57978
linuxkpi: Add compat_ptr_ioctl
Adding the `compat_ptr_ioctl` function for amdkfd support it's called by
kfd_chardev.c
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D58076
pw: remove mail file with unlinkat instead of building a path
This is consistent with how at jobs and crontabs are removed.
MFC After: 1 week
(cherry picked from commit 1ccf8075eaa84088ad4acb65aabb1e59c3fddd3f)
pw: remove crontab with unlinkat instead of spawning crontab
crontab -r only unlinks the crontab file, so spawn it directly with
unlinkat() relative to conf.rootfd. This also makes the crontab
removal work with pw -R.
MFC After: 1 week
(cherry picked from commit ba391775e8acb7a539c18f1231a396a7d0d763e9)
pw: fix at job removal when deleting a user
rmat() used stat() with a path relative to the current working
directory, so it never found the job files in /var/at/jobs and the
at(1) jobs of a deleted user were never removed.
ef7d0eb9489f also broke it by introducing a typo: /usr/sbin/atrm instead
of /usr/bin/artm.
Use fstatat() with the directory fd to stat the job files relative to
the at jobs directory, and unlinkat() them directly instead of spawning
atrm.
Those changes allow us to make it works with pw -R.
MFC After: 1 week
(cherry picked from commit 6b6aa45f9a1a35acb7fef68824c1a5eb08503909)
pw: use _PWDASH pseudo-fd for "-" in pw_checkfd
pw_checkfd() returned the character "-" (45) for the "-" argument,
which was ambiguous with a real file descriptor.
MFC After: 1 week
(cherry picked from commit 92e8a76b87862aa2ee7e6c3f637034e60ffbc2e6)
rc.conf.5: Improve NOAUTO configuration + tag SPDX
- Show how to start a NOAUTOed interface
- "configured" is not quite right, try to improve that
MFC after: 3 days
Event: EuroBSDcon Devsummit 2026
Reviewed by: adrian
Discussed with: Antranig Vartanian <antranigv at freebsd.am>
Differential Revision: https://reviews.freebsd.org/D59571