FreeBSD/src ea71fa9sys/dev/e1000 if_em.c

e1000: Express TSO restart policy without OACTIVE

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
DeltaFile
+6-10sys/dev/e1000/if_em.c
+6-101 files

FreeBSD/src d5ae08fsys/dev/bnxt/bnxt_en bnxt_sysctl.c, sys/dev/e1000 if_em.c

iflib: Use the framework run-state accessor in drivers

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.

    [14 lines not shown]
DeltaFile
+2-10sys/dev/igc/if_igc.c
+2-10sys/dev/e1000/if_em.c
+4-7sys/dev/ixgbe/if_ixv.c
+5-6sys/dev/ixgbe/if_ix.c
+5-5sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+3-6sys/dev/iavf/if_iavf_iflib.c
+21-449 files not shown
+34-6115 files

FreeBSD/src 4b5e09bshare/man/man9 iflibdi.9, sys/net iflib.h iflib.c

iflib: Separate software admission from legacy driver flags

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

    [11 lines not shown]
DeltaFile
+81-48sys/net/iflib.c
+28-1share/man/man9/iflibdi.9
+7-0sys/net/iflib.h
+116-493 files

FreeBSD/src 7fb0040sys/net iflib.c

iflib: Use private lifecycle state for control work

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
DeltaFile
+27-24sys/net/iflib.c
+27-241 files

FreeBSD/src 47b02acsbin/ipfw nat64clat.c

ipfw: guard against NULL deref with clat/plat prefixes without length

Found with:     Claude Code Sonnet 5
MFC after:      2 weeks
DeltaFile
+3-0sbin/ipfw/nat64clat.c
+3-01 files

FreeBSD/src 6ac7152sys/sys videoio.h

video(4): add extended controls and remaining V4L2 compat symbols

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
DeltaFile
+162-1sys/sys/videoio.h
+162-11 files

FreeBSD/src 8e5e2c3share/man/man4 hfsts.4, sys/amd64/conf NOTES

intel: add hfsts debug-probe driver for Intel ME/HECI firmware status

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
DeltaFile
+564-0sys/dev/intel/hfsts.c
+237-0sys/dev/intel/hfsts_isa.c
+219-0share/man/man4/hfsts.4
+12-0sys/dev/intel/hfsts.h
+11-0sys/modules/hfsts/Makefile
+3-0sys/amd64/conf/NOTES
+1,046-03 files not shown
+1,052-09 files

FreeBSD/src 592ae60sbin/devmatch devmatch.c

devmatch(8): Preserve const qualifier on strchr(3) and strstr(3) results

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59667
DeltaFile
+4-3sbin/devmatch/devmatch.c
+4-31 files

FreeBSD/src d10e39dbin/ps ps.c

ps(1): Preserve const qualifier on strchr(3) result

Reviewed by:    fuz, dteske
Approved by:    fuz (mentor), dteske (mentor)
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59666
DeltaFile
+2-1bin/ps/ps.c
+2-11 files

FreeBSD/src 63786b0sys/dev/cxgbe/iw_cxgbe cq.c

iw_cxgbe: Remove unused return value from destroy_cq

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
DeltaFile
+7-8sys/dev/cxgbe/iw_cxgbe/cq.c
+7-81 files

FreeBSD/src e29dcccsys/dev/cxgbe/iw_cxgbe iw_cxgbe.h qp.c

iw_cxgbe: Fix qpid leak

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
DeltaFile
+18-32sys/dev/cxgbe/iw_cxgbe/qp.c
+2-2sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+20-342 files

FreeBSD/src 0505738sys/dev/cxgbe/iw_cxgbe iw_cxgbe.h t4.h

iw_cxgbe: Miscellaneous changes from the iw_cxgb4 driver

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 at chelsio.com>
Co-authored-by: Krishnamraju Eraparaju <krishna2 at chelsio.com>
Co-authored-by: Vishal Kulkarni <vishal at chelsio.com>
DeltaFile
+26-29sys/dev/cxgbe/iw_cxgbe/cm.c
+12-11sys/dev/cxgbe/iw_cxgbe/cq.c
+8-6sys/dev/cxgbe/iw_cxgbe/qp.c
+5-2sys/dev/cxgbe/iw_cxgbe/provider.c
+1-1sys/dev/cxgbe/iw_cxgbe/t4.h
+0-1sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+52-506 files

FreeBSD/src 9f2a288sys/dev/cxgbe/iw_cxgbe qp.c cq.c

iw_cxgbe: Remove unneeded memset

Obtained from:  Linux commit 4c44d4634b5c90993fccca9f155347221df6f877
DeltaFile
+0-1sys/dev/cxgbe/iw_cxgbe/qp.c
+0-1sys/dev/cxgbe/iw_cxgbe/cq.c
+0-22 files

FreeBSD/src 3968a87contrib/ofed/libcxgb4 t4.h dev.c, sys/dev/cxgbe/iw_cxgbe device.c t4.h

iw_cxgbe/libcxgb4: Pass ftid_base to libcxgb4 through status page

While here, fix incorrect frees in error paths in c4iw_alloc_context().

Sponsored by:   Chelsio Communications
DeltaFile
+2-2contrib/ofed/libcxgb4/dev.c
+1-1sys/dev/cxgbe/iw_cxgbe/t4.h
+1-1contrib/ofed/libcxgb4/t4.h
+1-0sys/dev/cxgbe/iw_cxgbe/device.c
+5-44 files

FreeBSD/src a83be0bsys/dev/cxgbe/iw_cxgbe mem.c

iw_cxgbe: Do not dma memory off of the stack

Obtained from:  Linux commit 3840c5b78803b2b6cc1ff820100a74a092c40cbb
DeltaFile
+17-11sys/dev/cxgbe/iw_cxgbe/mem.c
+17-111 files

FreeBSD/src 0d63508sys/dev/cxgbe t4_main.c, sys/dev/cxgbe/common common.h

cxgbe: Enable RDMA WRITE_CMPL work requests if the firmware supports them

This work request permits combining RDMA WRITE and SEND_INV commands
into a single work request.

Sponsored by:   Chelsio Communications
DeltaFile
+5-0sys/dev/cxgbe/t4_main.c
+2-0sys/dev/cxgbe/common/common.h
+7-02 files

FreeBSD/src e03c2c0contrib/ofed/libcxgb4 qp.c

libcxgb4: remove update_qp_state()

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
DeltaFile
+1-15contrib/ofed/libcxgb4/qp.c
+1-151 files

FreeBSD/src b78f8facontrib/ofed/libcxgb4 libcxgb4.h t4.h, sys/dev/cxgbe/iw_cxgbe device.c t4.h

iw_cxgbe/libcxgb4: Support for RDMA WRITE_COMPL work requests

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 at chelsio.com>
DeltaFile
+167-10contrib/ofed/libcxgb4/qp.c
+146-1sys/dev/cxgbe/iw_cxgbe/qp.c
+7-2contrib/ofed/libcxgb4/t4.h
+5-1sys/dev/cxgbe/iw_cxgbe/t4.h
+2-0sys/dev/cxgbe/iw_cxgbe/device.c
+1-0contrib/ofed/libcxgb4/libcxgb4.h
+328-141 files not shown
+329-147 files

FreeBSD/src f9076bdsys/dev/cxgbe/iw_cxgbe cq.c device.c

iw_cxgbe: Use XArray instead of IDR

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 at chelsio.com>
DeltaFile
+5-64sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+9-8sys/dev/cxgbe/iw_cxgbe/ev.c
+8-8sys/dev/cxgbe/iw_cxgbe/mem.c
+9-7sys/dev/cxgbe/iw_cxgbe/qp.c
+6-7sys/dev/cxgbe/iw_cxgbe/device.c
+3-3sys/dev/cxgbe/iw_cxgbe/cq.c
+40-976 files

FreeBSD/src 054db35contrib/ofed/libcxgb4 cq.c qp.c, contrib/ofed/libibverbs verbs.h

libcxgb4: Support for RDMA SEND_WITH_INV requests

Sponsored by:   Chelsio Communications
DeltaFile
+27-8contrib/ofed/libcxgb4/qp.c
+22-3contrib/ofed/libcxgb4/cq.c
+4-1contrib/ofed/libibverbs/verbs.h
+53-123 files

FreeBSD/src 73151e4sys/dev/cxgbe/iw_cxgbe qp.c

iw_cxgbe: Cleanups to ucontext handling when creating queues

Obtained from:  Linux commit e00b64f7c54c4cbd88143bbd43e7c3d61a090e5c
Obtained from:  Linux commit 89944450547334aa6655e0cd4aec8df1897a205a
DeltaFile
+2-3sys/dev/cxgbe/iw_cxgbe/qp.c
+2-31 files

FreeBSD/src deb465asys/dev/cxgbe/iw_cxgbe provider.c

iw_cxgbe: Add ib_device->get_netdev support

Obtained from:  Linux commit f215a3d2448ae77253f0b93dcc37114779f51778
DeltaFile
+20-0sys/dev/cxgbe/iw_cxgbe/provider.c
+20-01 files

FreeBSD/src 96d9a91sys/dev/cxgbe/iw_cxgbe t4.h

iw_cxgbe: use __raw_write*() to allow write-combining

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
DeltaFile
+5-7sys/dev/cxgbe/iw_cxgbe/t4.h
+5-71 files

FreeBSD/src c1325c5sys/dev/cxgbe/iw_cxgbe mem.c

iw_cxgbe: Use correct sizing on buffers holding page DMA addresses

Obtained from:  Linux commit 5f818d676ac455bbc812ffaaf5bf780be5465114
DeltaFile
+1-1sys/dev/cxgbe/iw_cxgbe/mem.c
+1-11 files

FreeBSD/src 6ee16b9sys/dev/cxgbe/iw_cxgbe cm.c device.c

iw_cxgbe: Various fixes around waiting for replies to work requests

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
DeltaFile
+139-81sys/dev/cxgbe/iw_cxgbe/mem.c
+76-42sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+36-30sys/dev/cxgbe/iw_cxgbe/qp.c
+34-31sys/dev/cxgbe/iw_cxgbe/cq.c
+21-0sys/dev/cxgbe/iw_cxgbe/device.c
+9-3sys/dev/cxgbe/iw_cxgbe/cm.c
+315-1876 files

FreeBSD/src 6262cbecontrib/ofed/libcxgb4 t4.h cq.c

libcxgb4: Support send/recv drain work requests

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
DeltaFile
+126-6contrib/ofed/libcxgb4/qp.c
+15-0contrib/ofed/libcxgb4/cq.c
+14-0contrib/ofed/libcxgb4/t4.h
+155-63 files

FreeBSD/src f08d90esys/dev/cxgbe/iw_cxgbe iw_cxgbe.h t4.h

iw_cxgbe: Fixes around work queue flushing and draining

- 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.

    [3 lines not shown]
DeltaFile
+90-9sys/dev/cxgbe/iw_cxgbe/qp.c
+16-6sys/dev/cxgbe/iw_cxgbe/cq.c
+6-0sys/dev/cxgbe/iw_cxgbe/t4.h
+1-3sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h
+113-184 files

FreeBSD/src 6c858dacontrib/ofed/libcxgb4 cq.c t4.h, sys/dev/cxgbe/iw_cxgbe t4.h qp.c

iw_cxgbe/libcxgb4: Support for RDMA WRITE_WITH_IMMEDIATE requests

Sponsored by:   Chelsio Communications
DeltaFile
+22-3sys/dev/cxgbe/iw_cxgbe/cq.c
+13-1sys/dev/cxgbe/iw_cxgbe/qp.c
+11-1contrib/ofed/libcxgb4/qp.c
+9-2contrib/ofed/libcxgb4/t4.h
+8-1contrib/ofed/libcxgb4/cq.c
+7-1sys/dev/cxgbe/iw_cxgbe/t4.h
+70-93 files not shown
+78-109 files

FreeBSD/src c957af2contrib/ofed/libcxgb4 cxgb4-abi.h t4.h, sys/dev/cxgbe/iw_cxgbe cq.c user.h

iw_cxgbe/libcxgb4: Support 64B CQEs

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 at opengridcomputing.com>
DeltaFile
+10-2contrib/ofed/libcxgb4/verbs.c
+6-1sys/dev/cxgbe/iw_cxgbe/t4.h
+4-2contrib/ofed/libcxgb4/t4.h
+5-1sys/dev/cxgbe/iw_cxgbe/user.h
+2-3sys/dev/cxgbe/iw_cxgbe/cq.c
+5-0contrib/ofed/libcxgb4/cxgb4-abi.h
+32-92 files not shown
+34-108 files

FreeBSD/src 2a580b3sys/dev/cxgbe t4_main.c, sys/dev/cxgbe/common common.h

cxgbe: Query the ability to use RDMA WRITE_WITH_IMMEDIATE requests

Sponsored by:   Chelsio Communications
DeltaFile
+5-0sys/dev/cxgbe/t4_main.c
+1-0sys/dev/cxgbe/common/common.h
+6-02 files