FreeBSD/src 4a13b8asys/dev/ixgbe if_ixv.c

ixv: Advertise SCTP checksum offload

The shared ixgbe transmit path already creates SCTP context
descriptors, and the hardware exposes the same checksum capability to
VFs.  Advertise it through iflib as the PF driver does.

MFC after:      2 weeks
DeltaFile
+2-1sys/dev/ixgbe/if_ixv.c
+2-11 files

FreeBSD/src 8eeb258sys/dev/ixgbe if_ixv.c

ixv: Remove unused loader tunables

The flow_control and hdr_split variables have never been read.  VF
flow control is controlled by the PF, while implementing header split
would require receive-path support that ixv does not provide.

MFC after:      2 weeks
DeltaFile
+0-17sys/dev/ixgbe/if_ixv.c
+0-171 files

FreeBSD/src c017bceshare/man/man4 ix.4, sys/dev/ixgbe if_sriov.c

ixgbe: Reject Flow Director with SR-IOV

The iflib Flow Director path does not assign filters using the
absolute queue and pool identifiers required by SR-IOV.  Reject the
combination during preflight validation rather than allowing an
unsupported configuration to alter the PF receive path.

The loader tunable is fixed before VFs can be created, so validation
also prevents the reverse ordering of this combination.

MFC after:      2 weeks
DeltaFile
+5-0sys/dev/ixgbe/if_sriov.c
+2-1share/man/man4/ix.4
+7-12 files

FreeBSD/src 9f4df9fsys/x86/iommu amd_intrmap.c

amd_iommu: Honor disabled interrupt remapping

Do not instantiate an interrupt-remapping context for a unit whose IRTE
support is disabled. In that mode the caller must retain the ordinary
interrupt path.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58725
DeltaFile
+1-1sys/x86/iommu/amd_intrmap.c
+1-11 files

FreeBSD/src d6f97c6share/man/man4 iflib.4, share/man/man9 iflibdi.9

iflib: Add sysctl stat for TX watchdog reset events

iflib counts resets initiated by its transmit watchdog in 69c3e0de01c1.

Export the counter in the per-device iflib sysctl tree so every
driver provides the diagnostic without a driver callback or duplicate
storage.

A watchdog reset does not establish how many packets failed.  It can
recover a hardware stall involving several queued packets or a missed
completion involving no packet loss.  Stop adding one output error per
watchdog event in em(4), igb(4), and igc(4).

Remove the redundant driver counters and move the diagnostic to
dev.<driver>.<unit>.iflib.tx_watchdog_events.

MFC after:      1 month
Relnotes:       yes
DeltaFile
+1-23sys/dev/e1000/if_em.c
+1-18sys/dev/igc/if_igc.c
+5-2sys/net/iflib.c
+6-1share/man/man4/iflib.4
+3-3share/man/man9/iflibdi.9
+0-2sys/dev/ixgbe/if_ixv.c
+16-494 files not shown
+16-5510 files

FreeBSD/src 7e2781fsys/netpfil/pf if_pfsync.c, tests/sys/netpfil/pf pfsync.sh

pfsync: handle large MTU pfsync interfaces

pfsync packets were allocated with m_get2(), which can't return packets
larger than MJUMPAGESIZE. As a result 9k MTU pfsync interfaces simply didn't work.

Use m_get3(), which can allocate sufficiently large mbufs.

Extend the pfsync:bulk test case to provoke this problem.

PR:             297307
MFC after:      2 weeks
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+8-3tests/sys/netpfil/pf/pfsync.sh
+1-1sys/netpfil/pf/if_pfsync.c
+9-42 files

FreeBSD/src 8ea4e92sys/net route.c

net: don't panic on ifconfig pfsync0 mtu 9000

pfsync interfaces do not have ifp->if_inet6 set, so when we update the
MTU for those interfaces we panicked.

Add an explicit check for this. This should be temporary, until pfsync
is no longer a struct ifnet (as we've already done for pflog).

Reviewed by:    glebius
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D58701
DeltaFile
+3-1sys/net/route.c
+3-11 files

FreeBSD/src 42d54a8sys/amd64/vmm/amd ivrs_drv.c, sys/amd64/vmm/io iommu.h iommu.c

vmm: Tear down the IOMMU before AMD-Vi detach

Register the vmm module handler after both the bundled device drivers
and SMP. On platforms without EARLY_AP_STARTUP, SI_SUB_SMP follows
SI_SUB_DRIVERS; using the later subsystem preserves the
smp_rendezvous() requirement.

The resulting reverse unload order performs IOMMU cleanup while every
IVHD softc remains valid. Refuse an independent IVHD detach while
translation state remains initialized.

MFC after:      2 weeks
DeltaFile
+9-5sys/amd64/vmm/amd/ivrs_drv.c
+10-2sys/amd64/vmm/io/iommu.c
+8-2sys/dev/vmm/vmm_dev.c
+1-0sys/amd64/vmm/io/iommu.h
+28-94 files

FreeBSD/src 4174cc2release Makefile.gce

release/Makefile.gce: migrate gsutil usages to gcloud CLI

Google Cloud recommends migrating from gsutil to gcloud storage CLI.
Update gce-do-upload target to use `gcloud storage buckets create` and
`gcloud storage cp` instead of `gsutil mb` and `gsutil cp` commands.

PR:             conf/297016
Reviewed by:    lwhsu
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D58464
DeltaFile
+2-2release/Makefile.gce
+2-21 files

FreeBSD/src 5017a24sys/dev/ixgbe if_sriov.c

ixgbe: Drain events for inactive VFs

The aggregate VF mailbox poll includes only VFs whose driver
configuration completed. A configured VF slot whose vf_add callback
failed can nevertheless report reset, request, or acknowledgement
events. Because the mailbox handler skips inactive entries, such an
event remains latched and can retrigger administrative work
indefinitely.

Build the poll masks from every configured VF index and consume reset,
message, and acknowledgement events for inactive entries without
treating them as usable VFs. Use the index rather than the pool because
early vf_add errors precede pool initialization. Also include E610
PFVFLREC in aggregate reset sampling.

MFC after:      2 weeks
DeltaFile
+63-62sys/dev/ixgbe/if_sriov.c
+63-621 files

FreeBSD/src 2b763a8sys/dev/ixgbe if_ix.c

ixgbe: Handle deferred link-status requests

The iflib conversion records link-status interrupts in the
administrative request mask, but the administrative task did not
consume them.  Timer polling usually hid the omission; frequent mailbox
interrupts could continually rearm that timer and leave cached link
state down after hardware recovered.

Claim request batches atomically, process link-setup dependencies, and
sample hardware before publishing link state.  Bound each invocation to
eight batches and requeue residual work so a continuous producer cannot
monopolize the admin taskqueue.

Queue every link-related request from the legacy interrupt path.
Unlike MSI-X, its threaded continuation services RX and does not enqueue
the admin task.  This restores the event-driven behavior of ix-3.4.39.

Fixes:  b2c1e8e62049 ("ix(4): Run {mod,msf,mbx,fdir,phy}_task in if_update_admin_status")
MFC after:      2 weeks
DeltaFile
+83-50sys/dev/ixgbe/if_ix.c
+83-501 files

FreeBSD/src 26e3a80sys/dev/ixgbe if_ixv.c

ixv: Tolerate temporary PF mailbox unavailability

A PF can be resetting, handling a slow link event, or deliberately
withholding mailbox CTS while its VFs enumerate. Keep the VF attached
when the reset handshake is temporarily unavailable so a later if_init
can retry.

Never leave VF hardware running without a negotiated mailbox API: start
hardware only after reset succeeds, stop it when negotiation fails in
attach or init, and defer later recovery through iflib. This prevents a
tight reset loop while preserving recovery when the PF returns.

MFC after:      2 weeks
DeltaFile
+49-28sys/dev/ixgbe/if_ixv.c
+49-281 files

FreeBSD/src c521b16share/man/man4 route.4

route.4: Add RTV_METRIC flag to rt_metrics

Reviewed by:    ziaee
Differential Revision: https://reviews.freebsd.org/D58565
DeltaFile
+2-1share/man/man4/route.4
+2-11 files

FreeBSD/src a97e1c2sys/dev/enic if_enic.c

enic: Correct queue and attach resource ownership

Completion queues are allocated by attach_pre but released by
queues_free. An iflib failure between those stages leaks the allocation,
while the original size expression also underallocates the array.

Move completion queue allocation into the TX queue callback, correct its
size, and unwind it with TX state if RX allocation fails. Make interrupt
cleanup tolerate an unavailable array and reuse the array allocated
during device initialization instead of replacing and leaking it.

Release the DMA, multicast, and lock resources owned by a successful
attach_pre during detach. Avoid allocating the statistics DMA area a
second time near the end of attach_pre.

MFC after:      2 weeks
DeltaFile
+42-26sys/dev/enic/if_enic.c
+42-261 files

FreeBSD/src 65228a8sys/dev/axgbe if_axgbe_pci.c

axgbe: Align channel lifetime with queue allocation

DMA channels are allocated by attach_pre but released by queues_free.
When iflib fails after attach_pre and before queue allocation, neither
the old detach nor queues_free path releases them.

Allocate channels with the TX queue state and make queues_free tolerate
partially allocated rings. Use it to unwind allocation failures so TX
rings are also released when RX allocation fails.

An early detach can also precede PHY initialization and interrupt
assignment. Skip absent PHY and channel state, and release the locks
owned by attach_pre on both failure and detach.

MFC after:      2 weeks
DeltaFile
+37-42sys/dev/axgbe/if_axgbe_pci.c
+37-421 files

FreeBSD/src b3e20e1usr.sbin/rtadvd rtadvd.c

rtadvd(8): Fix RA flag inconsistency messages

During flag inconsistency report, we handle rai->rai_otherflg
as a bool, but the value is 0x40. Make it a simple number comparison.

PR:             295995
Reviewed by:    markj, Faraz Vahedi <kfv at kfv.io>
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D58672

(cherry picked from commit 200de1b70e2b4f809d1d3a4c430db80b24124468)
DeltaFile
+4-4usr.sbin/rtadvd/rtadvd.c
+4-41 files

FreeBSD/src c3a70b0usr.sbin/rtadvd rtadvd.c

rtadvd(8): Fix RA flag inconsistency messages

During flag inconsistency report, we handle rai->rai_otherflg
as a bool, but the value is 0x40. Make it a simple number comparison.

PR:             295995
Reviewed by:    markj, Faraz Vahedi <kfv at kfv.io>
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D58672

(cherry picked from commit 200de1b70e2b4f809d1d3a4c430db80b24124468)
DeltaFile
+4-4usr.sbin/rtadvd/rtadvd.c
+4-41 files

FreeBSD/src 8befc9esys/kern kern_environment.c

kern: fix oversight in security.bsd.unprivileged_kenv_read

It was intended that one could close the hole back in loader, but the
sysctl was actually not marked TUNABLE.  The hardening menu option thus
did nothing, because we wouldn't read the value from kenv.

Reported by:    markj
Fixes:  6e81fbf5833d ("bsdinstall: add a hardening knob [...]")
Fixes:  4fd518fcb2bb ("kern: add a security knob to disable [...]")
DeltaFile
+1-1sys/kern/kern_environment.c
+1-11 files

FreeBSD/src 3da5abasys/dev/igc igc_base.h igc_base.c

igc: Disable PCIe L1.2 on I225

I225 devices can incorrectly enter L1 substates while CLKREQ# is
asserted, both while idle and in D3.  Disable ASPM and PCI-PM L1.2 on
I225 to prevent the resulting packet loss.

Keep the I226 workaround ASPM-only because it addresses a separate
traffic exit latency observation.

PR:             265714

(cherry picked from commit 4a28d390f5fbae2483e88805559881b04ccf9a80)
DeltaFile
+22-20sys/dev/igc/if_igc.c
+29-0sys/dev/igc/igc_base.c
+1-0sys/dev/igc/igc_base.h
+52-203 files

FreeBSD/src 30f4095sys/dev/igc igc_base.c

igc: Apply ASPM L1.2 workaround to all I226 devices

Classify I226_LMVP and I226_BLANK_NVM as I226 silicon so they
receive the I226-specific ASPM L1.2 workaround.

PR:             279245
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2318

(cherry picked from commit cecb0f45cb83349c60514da38fddce83ad042468)
DeltaFile
+5-0sys/dev/igc/igc_base.c
+5-01 files

FreeBSD/src 94d7960sys/dev/ixgbe if_sriov.c

ixgbe: clear VF head write-back state on reset

VF reset and FLR do not clear the transmit head write-back address
registers.  A previous VF driver can therefore leave DMA write-back
enabled with a stale address for the next driver instance.

After consuming the reset request and disabling the VF queues, clear the
address registers for each queue belonging to that VF.  Derive the queue
count from the active IOV mode so peer queue state is not touched.

Linux commit dbf231af81a7 documents the hardware behavior.  The FreeBSD
implementation follows the local queue mapping and register interfaces.

(cherry picked from commit 6f940ca879cbf691ddf5605d852770cef27847b2)
DeltaFile
+13-0sys/dev/ixgbe/if_sriov.c
+13-01 files

FreeBSD/src 2ece404sys/dev/ixgbe ixgbe_common.c ixgbe_api.c

ixgbe: dispatch PBA string reads through EEPROM ops

E610 installs a device-specific PBA string reader, but the public API
always calls the generic implementation.  Dispatch through the EEPROM
operation table so device overrides are honored.

Initialize the generic operation for devices that use the ordinary
EEPROM representation.

Obtained from:  Intel ix 3.4.39

(cherry picked from commit 9cf1aa6e68e4b9dd4a77c67b7b902b9221198e7a)
DeltaFile
+3-1sys/dev/ixgbe/ixgbe_api.c
+1-0sys/dev/ixgbe/ixgbe_common.c
+4-12 files

FreeBSD/src 72b7612sys/dev/ixgbe ixgbe_common.c

ixgbe: avoid signed shift when assembling ETrack ID

Obtained from:  Intel ix 3.4.39

(cherry picked from commit 86869d77658aef48b2bab3e57517f88d7bd5389d)
DeltaFile
+4-4sys/dev/ixgbe/ixgbe_common.c
+4-41 files

FreeBSD/src 33fb0b4sys/dev/ixgbe ixgbe_common.c

ixgbe: fix host interface timeout detection

The host-interface polling loop was scaled from milliseconds to
microseconds, but its terminal test was left using the unscaled timeout.
Completion at that intermediate iteration can be reported as a timeout,
while actual expiry is not recognized and can accept stale status.

Test against the scaled loop bound used by the polling loop.

Fixes:          f46d75c90f5f ("ixgbe: improve MDIO performance by reducing semaphore/IPC delays")

(cherry picked from commit db2bf4553ce32fdcae00f6e7392a6c2010247dd6)
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-11 files

FreeBSD/src edf4edbsys/dev/ixgbe if_sriov.c

ixgbe: disable VF multicast reception for empty list

Clear ROMPE for an empty list and enable it only for a nonempty list.
FreeBSD already clears ROMPE when resetting a VF, so that part of the
DPDK change is not needed.

DPDK commit message

net/ixgbe: fix over using multicast table for VF

VMOLR.ROMPE allows a VF to receive packets matching the shared multicast
table.  Leaving it enabled after the VF removes its last multicast
address lets PF or peer-VF table entries continue selecting that VF.

Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>

Obtained from:  DPDK (dc5a6e7422)

(cherry picked from commit 786c71845f80b8bf733d07f9155de9740a8cbc19)
DeltaFile
+4-1sys/dev/ixgbe/if_sriov.c
+4-11 files

FreeBSD/src 4857be0sys/dev/ixgbe if_sriov.c

ixgbe: check negotiated API for VF queue query

The GET_QUEUES handler switches on msg[0], which contains the mailbox
command rather than the negotiated API version.  It therefore cannot
reject API 1.0 or an unnegotiated VF as intended.

Switch on the API version stored for the VF.

(cherry picked from commit 8d1d32942b810d613be45ea78939872711803c3b)
DeltaFile
+1-1sys/dev/ixgbe/if_sriov.c
+1-11 files

FreeBSD/src 23c1d52sys/dev/ixgbe if_sriov.c

ixgbe: reject VF requests before CTS

A VF that sends a non-reset request before completing reset negotiation
has not received CTS.  The PF ignores the request but currently reports
success, leaving the VF with a false view of the programmed state.

Return failure for the ignored request.  This restores the behavior lost
when the mailbox helpers were renamed.

Fixes:          36c516b31136 ("ixgbe: update if_sriov to use the new mailbox apis")

(cherry picked from commit 9fc83caf48e710c3f6457cab4bdb5e6c76e8be51)
DeltaFile
+1-1sys/dev/ixgbe/if_sriov.c
+1-11 files

FreeBSD/src 49fc8bbsys/dev/ixgbe ixgbe_common.c ixgbe_82598.c

ixgbe: avoid signed overflow in pause time calculation

pause_time is promoted to signed int before multiplication.  Its default
value of 65535 multiplied by 65537 exceeds INT_MAX and triggers UBSAN,
even though the result is assigned to a u32.

Make the multiplier unsigned so the calculation has the intended u32
semantics.  Linux commit 3b70683fc4d6 reported the failure in the generic
path and used the same mechanical correction.  The 82598-specific flow
control operation contains the identical expression, so correct it as well.

(cherry picked from commit 35374c3ec69aa87561431e6236706c485bdeeacc)
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-1sys/dev/ixgbe/ixgbe_82598.c
+2-22 files

FreeBSD/src c50447csys/dev/ixgbe ixgbe_type.h ixgbe_x550.c

ixgbe: fix unaligned access in ixgbe_update_flash_X550()

ixgbe_host_interface_command() treats its buffer as a u32 array.  The
local union contained only byte-sized fields, giving it one-byte stack
alignment and allowing unaligned accesses on strict-align systems.

Add a u32 member to the union to provide the required alignment and
pass that member to ixgbe_host_interface_command().

No functional change is expected on x86.

Obtained from:  Intel ix 3.4.39

(cherry picked from commit 8fa2a7503468abb5f863729c4e244d738239503d)
DeltaFile
+1-2sys/dev/ixgbe/ixgbe_x550.c
+1-0sys/dev/ixgbe/ixgbe_type.h
+2-22 files

FreeBSD/src 70df28asys/dev/ixgbe ixgbe_phy.c

ixgbe: retry incoherent SFP identifier reads

FreeBSD's I2C helper already retries failed transactions.  Limit this
new outer loop to successful reads with an invalid identifier so that
retry budget is not multiplied.

DPDK commit message

net/ixgbe: retry misbehaving SFP read

Some XGS-PON SFPs ACK I2C reads and return uninitialized data while
their microcontroller boots.  A bogus identifier can cause an otherwise
working module to be marked unsupported.

Retry the identifier read several times, checking for both successful
I2C completion and a valid SFP identifier.

Signed-off-by: Stephen Douthit <stephend at silicom-usa.com>
Signed-off-by: Jeff Daly <jeffd at silicom-usa.com>

    [5 lines not shown]
DeltaFile
+17-3sys/dev/ixgbe/ixgbe_phy.c
+17-31 files