igc: defer sysctl-driven reinit to the admin task
igc_sysctl_eee() and igc_sysctl_dmac() called igc_if_init() directly.
Request the reset through iflib instead, and skipping while the interface
is down; the new value is picked up by the next init.
Unlike e1000, igc has no ASSERT_CTX_LOCK_HELD and no acquire_swflag
path, so the defect is silent here rather than an assertion failure.
While here also remove unnecessary igc_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58629
(cherry picked from commit 30ccf2f48c11e54fc0540510dcec7cd006a2c366)
e1000: defer sysctl-driven reinit to the admin task
Request the reset through iflib and let the admin task perform the
stop/init under the context lock, matching what the VF and SR-IOV paths
already do.
The assertion is compiled out without INVARIANTS, where the same write
instead resets the MAC and takes the ICH software flag while the queues
stay live and an ioctl or the admin task may be running.
While here also remove unnecessary em_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58628
(cherry picked from commit abdde8b602813753e423610b39be6806da5647e2)
igc: defer sysctl-driven reinit to the admin task
igc_sysctl_eee() and igc_sysctl_dmac() called igc_if_init() directly.
Request the reset through iflib instead, and skipping while the interface
is down; the new value is picked up by the next init.
Unlike e1000, igc has no ASSERT_CTX_LOCK_HELD and no acquire_swflag
path, so the defect is silent here rather than an assertion failure.
While here also remove unnecessary igc_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58629
(cherry picked from commit 30ccf2f48c11e54fc0540510dcec7cd006a2c366)
e1000: defer sysctl-driven reinit to the admin task
Request the reset through iflib and let the admin task perform the
stop/init under the context lock, matching what the VF and SR-IOV paths
already do.
The assertion is compiled out without INVARIANTS, where the same write
instead resets the MAC and takes the ICH software flag while the queues
stay live and an ioctl or the admin task may be running.
While here also remove unnecessary em_if_init uses:
iflib_if_init_locked() already runs after IFDI_RESUME and
IFDI_MEDIA_CHANGE, so the trailing *_if_init() only added an unstopped
IFDI_INIT that the following iflib_stop() undoes.
Differential Revision: https://reviews.freebsd.org/D58628
(cherry picked from commit abdde8b602813753e423610b39be6806da5647e2)
iflib: Allow conditional LED device support
A driver class may implement LED control even though the capability is
not available on every device or firmware version it supports. Add an
optional capability method and consult it before creating the led(4)
device. Default to supported so existing providers are unchanged.
This will be used by bnxt which blends PF and VF in the same driver.
MFC after: 2 weeks
igc: Recover from fatal internal memory errors
I225 and I226 report uncorrectable internal memory errors through
ICR.FER and identify the affected region in PEIND. Depending on the
region, hardware stops transmit or all PCIe and DMA traffic until the
port is reset and reinitialized.
Enable the fatal error interrupt and capture its read clear status in
the interrupt filter. Mask the cause while an iflib reset is pending,
report the affected memory regions, and expose per region indication
counters.
PCIe region parity failures require a different recovery order from a
normal reset: assert DEV_RST, wait at least 3 ms, disable PCIe master
requests, clear PCIEERRSTS, and then reinitialize the port. Follow that
sequence before entering the normal reset path and clear the remaining
LAN status afterward.
The I225/I226 PBECCSTS layout is unrelated to the PCH layout previously
[20 lines not shown]
igc: Report corrected internal ECC errors
I225 and I226 do not interrupt for corrected internal ECC errors.
Instead, the DMA packet buffer and PCIe memories expose sticky status
bits in PBECCSTS and PCIEECCSTS.
Sample these bits with the regular hardware statistics update, preserve
the PBECCSTS ECC enable state while clearing its RW1C indication, and
expose separate counters for the DMA packet buffer, PCIe transmit-data
memory, and PCIe retry buffer.
These counters represent observed indications rather than an exact error
count because multiple corrections between samples collapse into one
sticky status bit.
Hardware validation used an I225-IT (rev 3) and a debug kernel that
wrote only the documented self-clearing injection bits. Each test
armed the injector, exercised the owning RAM with traffic, and compared
the corresponding counter before and after.
[14 lines not shown]
du: Print progress information to stderr
* On SIGINFO, print the current path to stderr rather than stdout.
* Do so immediately, instead of the next time we finish a directory.
* Document this behavior in the manual page.
PR: 296861
MFC after: 1 week
Fixes: d1588599c024 ("Report the next directory being scanned ...")
Reviewed by: wollman
Differential Revision: https://reviews.freebsd.org/D58702
(cherry picked from commit fd79bf63442eefd2c3bfb695a377dbd705f5cc6d)
du: Print progress information to stderr
* On SIGINFO, print the current path to stderr rather than stdout.
* Do so immediately, instead of the next time we finish a directory.
* Document this behavior in the manual page.
PR: 296861
MFC after: 1 week
Fixes: d1588599c024 ("Report the next directory being scanned ...")
Reviewed by: wollman
Differential Revision: https://reviews.freebsd.org/D58702
(cherry picked from commit fd79bf63442eefd2c3bfb695a377dbd705f5cc6d)
pseudofs: Don't purge the cache on shutdown
This is a waste of time and results in a use-after-free if linsysfs is
loaded and a USB network interface is in use, since USB devices are
disconnected at shutdown, which triggers a call into linsysfs, which
then tries to destroy a pseudofs node which has already been purged.
MFC after: 1 week
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D58359
(cherry picked from commit 4ebcdb8dd9a7bdddbc97ff6ee47e0a7556c76b5a)
pseudofs: Don't purge the cache on shutdown
This is a waste of time and results in a use-after-free if linsysfs is
loaded and a USB network interface is in use, since USB devices are
disconnected at shutdown, which triggers a call into linsysfs, which
then tries to destroy a pseudofs node which has already been purged.
MFC after: 1 week
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D58359
(cherry picked from commit 4ebcdb8dd9a7bdddbc97ff6ee47e0a7556c76b5a)
mfc-candidates: Fix remote repo detection
In my repos the remote "freebsd" is git at gitrepo.freebsd.org:src.git.
In particular, the last component is delimited by a colon, not a slash.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D48951
video: add V4L2 compat symbols for ffmpeg/opencv
Adds v4l2_std_id, struct v4l2_standard/v4l2_plane, VIDIOC_G_STD/S_STD/
ENUMSTD, V4L2_STD_NTSC*, the MPLANE capability flag, multiplanar types
(VIDEO_MAX_PLANES, v4l2_plane_pix_format, v4l2_pix_format_mplane,
V4L2_TYPE_IS_MULTIPLANAR), V4L2_PIX_FMT_JPEG/YUV411P/SN9C10X, and the
MPEG control class (V4L2_CID_MPEG_BASE, V4L2_CID_MPEG_VIDEO_B_FRAMES).
video(4) capture devices are digital-only and never expose these, but
ffmpeg's libavdevice/v4l2.c and opencv's cap_v4l.cpp both reference
them unconditionally. Fixes their build against sys/videoio.h.
PR: 297454
Reviewed by: manu, adrian
Differential Revision: https://reviews.freebsd.org/D58793
video: fix v4l2_buffer size assert on non-i386 32-bit ports
Split the #else branch into an explicit __i386__ case (68) and a
generic ILP32-with-64-bit-time_t case (80) covering arm and powerpc.
Fixes: 0343ab8a6afa
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58790
ixgbe: Defer E610 thermal shutdown to iflib
The E610 firmware event handler invoked ixgbe_if_stop() directly from
IFDI_UPDATE_ADMIN_STATUS(). This reset the device without the iflib
queue lifecycle and left the interface marked running after its hardware
was stopped.
Request an iflib reset instead. Fail the automatic initialization once
so the reset transaction stops the interface and publishes that state.
A later operator-requested initialization remains possible, matching the
previous recovery policy without bypassing iflib.
MFC after: 2 weeks
ixgbe: Defer firmware recovery transitions to iflib
The firmware-mode callout invoked ixgbe_if_stop() directly. This
performed a full device reset without the iflib context lock or the
iflib queue lifecycle. It could also poll the E610 firmware command
interface from callout context while identification was active.
Request an iflib reset from the callout instead. Reject initialization
while firmware recovery remains active. This leaves the interface
stopped and lets iflib publish that state. Request initialization when
firmware exits recovery so an administratively-up interface can recover
without operator intervention.
MFC after: 2 weeks
ixgbe: Defer ECC recovery to iflib
The link interrupt filter performed a full hardware reset in interrupt
context. This bypassed iflib stop and initialization, including queue
quiescence and restoration of temporary LED state.
Record the ECC event in the administrative request mask and ask iflib
to perform the reset from its taskqueue. Keep the ECC cause masked
until reset so the intermediate admin pass cannot re-enable a sticky
condition. Handle ECC independently of Flow Director and in legacy
interrupt mode.
Remove the redundant EICR write; the filter has already cleared the
reported causes. Also remove the accompanying complement-mask update
of mac.flags. It set every flag except DOUBLE_RESET_REQUIRED and had
no place in ECC recovery.
MFC after: 2 weeks
ixl: Add led(4) identification support
Expose each physical port identification LED through /dev/led/ixl*.
Use the existing GPIO LED helpers for most devices and the PHY
provisioning interface for X710 10GBASE-T adapters.
Preserve and restore the original GPIO or PHY indication mode,
including before the interface is stopped.
MFC after: 2 weeks
ixgbe: Add led(4) identification support
Expose the physical port identification LED through /dev/led/ix*.
Save and restore the NVM-selected LEDCTL value around each request.
The X550 operations also clear their PHY manual override before the
register is restored.
Use the dedicated firmware port-identification command on E610. Its
interface selects between firmware blinking and the original mode
rather than directly controlling LEDCTL.
Restore the normal indication before a device stop or reset.
MFC after: 2 weeks