FreeBSD/src 5bb8119sbin/ifconfig ifgif.c

ifconfig: Add netlink support for gif(4)

This implementation does not cover tunnel addresses.

Differential Revision: https://reviews.freebsd.org/D57667
DeltaFile
+194-0sbin/ifconfig/ifgif.c
+194-01 files

FreeBSD/src 9bfb78bsys/net if_gif.c, sys/netlink/route interface.h

if_gif: Add netlink support with tests

Migrate to new if_clone KPI and implement netlink support
for gif(4). Also break GIFSOPTS ioctl logic out of gif_ioctl.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D57666
DeltaFile
+270-34sys/net/if_gif.c
+160-0tests/sys/netlink/test_rtnl_gif.c
+10-0sys/netlink/route/interface.h
+1-0tests/sys/netlink/Makefile
+441-344 files

FreeBSD/src 6f940casys/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.

MFC after:      1 week
DeltaFile
+13-0sys/dev/ixgbe/if_sriov.c
+13-01 files

FreeBSD/src 9cf1aa6sys/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
MFC after:      1 week
DeltaFile
+3-1sys/dev/ixgbe/ixgbe_api.c
+1-0sys/dev/ixgbe/ixgbe_common.c
+4-12 files

FreeBSD/src 86869d7sys/dev/ixgbe ixgbe_common.c

ixgbe: avoid signed shift when assembling ETrack ID

Obtained from:  Intel ix 3.4.39
MFC after:      1 week
DeltaFile
+4-4sys/dev/ixgbe/ixgbe_common.c
+4-41 files

FreeBSD/src db2bf45sys/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")
MFC after:      1 week
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-11 files

FreeBSD/src 786c718sys/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)
MFC after:      1 week
DeltaFile
+4-1sys/dev/ixgbe/if_sriov.c
+4-11 files

FreeBSD/src 8d1d329sys/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.

MFC after:      1 week
DeltaFile
+1-1sys/dev/ixgbe/if_sriov.c
+1-11 files

FreeBSD/src 9fc83casys/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")
MFC after:      1 week
DeltaFile
+1-1sys/dev/ixgbe/if_sriov.c
+1-11 files

FreeBSD/src 35374c3sys/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.

MFC after:      1 week
DeltaFile
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-1sys/dev/ixgbe/ixgbe_82598.c
+2-22 files

FreeBSD/src 8fa2a75sys/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
MFC after:      1 week
DeltaFile
+1-2sys/dev/ixgbe/ixgbe_x550.c
+1-0sys/dev/ixgbe/ixgbe_type.h
+2-22 files

FreeBSD/src 985bef0sys/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>

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

FreeBSD/src a859814sys/dev/ixgbe ixgbe_82599.c

ixgbe: check EEPROM read in 82599 D3 path

DPDK commit message

net/ixgbe/base: fix unchecked return value

Check the return value from ixgbe_read_eeprom() before using the
control word to configure link disable during D3.

Fixes:          b7ad3713b958 ("ixgbe/base: allow to disable link on D3")
Cc: stable at dpdk.org

Signed-off-by: Barbara Skobiej <barbara.skobiej at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>

Obtained from:  DPDK (eb3684b191)
MFC after:      1 week
DeltaFile
+5-3sys/dev/ixgbe/ixgbe_82599.c
+5-31 files

FreeBSD/src 21e03absys/dev/ixgbe if_ix.c

ixgbe: avoid flow control counter overflow

DPDK commit message

net/ixgbe: fix flow control frame byte adjustment

LXONTXC and LXOFFTXC are 32-bit counters for transmitted XON and XOFF
packets.  Their deltas are summed and used to adjust the transmitted
packet and byte counters.

Perform the addition in 64 bits so it cannot wrap before the result is
used for the byte adjustment.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes:          af75078fece3 ("first public release")
Cc: stable at dpdk.org

Signed-off-by: Daniil Iskhakov <dish at amicon.ru>

    [4 lines not shown]
DeltaFile
+3-3sys/dev/ixgbe/if_ix.c
+3-31 files

FreeBSD/src e451789sys/dev/ixgbe ixgbe_e610.c

ixgbe: copy ACI buffer before command retry

DPDK commit message

net/ixgbe/base: add missing buffer copy for ACI

Add the missing buffer copy in ixgbe_aci_send_cmd().

The retry path saves the original descriptor and allocates storage for
the command buffer so both can be restored before another attempt.  It
did not copy the original command buffer into that storage.

Fixes:          25b48e569f2f
Cc: stable at dpdk.org

Signed-off-by: Dan Nowlin <dan.nowlin at intel.com>
Signed-off-by: Yuan Wang <yuanx.wang at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>


    [2 lines not shown]
DeltaFile
+1-0sys/dev/ixgbe/ixgbe_e610.c
+1-01 files

FreeBSD/src 6020de5sys/dev/ixgbe if_ixv.c

ixv: fix multicast address enumeration

if_foreach_llmaddr() adds each callback return value to its running
count.  Returning the incremented count made the address indices grow
as 0, 1, 3, 7, and so on, eventually writing beyond the multicast
address array.

Return one address per callback and stop copying when the array is
full, matching the ixv-1.6.12 driver.

Fixes:          ff06a8dbb677 ("Mechanically convert ixgbe(4) to IfAPI")
MFC after:      1 week
DeltaFile
+4-2sys/dev/ixgbe/if_ixv.c
+4-21 files

FreeBSD/src 2a678cfsys/dev/ixgbe ixgbe_mbx.c

ixgbe: fail fast on VF-held PF mailboxes

The active PF mailbox operations use the legacy helpers.  The mailbox API
import changed check_for_msg into a read-only probe and added up to 2,000
500-microsecond lock retries.  If a VF leaves VFU set, the PF cannot acquire
the lock, busy-waits for up to one second, and leaves VFREQ pending so the
delay can repeat.

Give the legacy checker its old consume-on-check behavior so a failed read
does not leave VFREQ asserted.  If VFU is already set, fail immediately
instead of retrying, while preserving retries for PF-side contention.  Do
not force RVFU, which would discard peer transaction state.

MFC after:      1 week
DeltaFile
+23-3sys/dev/ixgbe/ixgbe_mbx.c
+23-31 files

FreeBSD/src 4096019sys/dev/ixgbe ixgbe_vf.c ixgbe_mbx.c

ixgbe: respect peer mailbox ownership

A VF currently treats an existing VFU bit as a successful acquisition,
while the PF checks its own PFU bit before claiming the mailbox.  Check
both the local and peer ownership bits before setting local ownership.
This prevents same-side callers from sharing the mailbox and avoids an
acquisition attempt while the peer owns it.

VFLR does not clear VFMAILBOX.VFU.  Clear stale VF ownership and cached
mailbox status after the reset indication settles and before sending the
reset request, so the ownership check cannot strand a reinitialized VF.

Adapt only the live ownership checks from Intel ix 3.4.39.  Do not import
its upgraded-mailbox changes, which are not active in FreeBSD.

Obtained from:  Intel ix 3.4.39
MFC after:      1 week
DeltaFile
+8-2sys/dev/ixgbe/ixgbe_mbx.c
+7-0sys/dev/ixgbe/ixgbe_vf.c
+15-22 files

FreeBSD/src 4b67335sys/dev/ixgbe ixgbe_type.h ixgbe_common.c

ixgbe: isolate VF reset state

IXGBE_VF_INDEX() selects a 32-VF register bank.  PFMBMEM() selects
one mailbox per VF, while ixgbe_toggle_txdctl() calculates queue
offsets from a VF number.  Passing the bank index aliases VF1-31 to
VF0 and VF32-63 to VF1.  Resetting one VF can therefore clear the peer
mailbox and leave its transmit queues disabled.

The VF raises its reset event before posting its mailbox request.  The
PF checks reset events before mailbox messages.  If both are pending,
clearing PFMBMEM during generic reset handling can erase the request
before ixgbe_read_mbx() consumes it.  Clear the mailbox only from the
reset-message handler after the request has been read.

Use the VF number for queue toggling and document that API contract.

MFC after:      1 week
DeltaFile
+6-14sys/dev/ixgbe/if_sriov.c
+3-3sys/dev/ixgbe/ixgbe_api.c
+1-1sys/dev/ixgbe/ixgbe_type.h
+1-1sys/dev/ixgbe/ixgbe_common.c
+1-1sys/dev/ixgbe/ixgbe_api.h
+12-205 files

FreeBSD/src 9d30fd3sys/dev/igc igc_base.h igc_base.c

igc: Disable ASPM L1.2 on I226 to prevent RX stalls

I226 parts advertise support for the PCIe L1.2 link substate, but a
hardware erratum makes the exit latency from that low-power state
longer than the packet buffer can absorb under load. This stalls the
inbound packet stream. Disabling ASPM system-wide (BIOS or OS ASPM
policy) does not fix it. The L1.2 enable bit must be cleared directly
in the device's own PCIe L1 PM extended capability.

Add igc_is_device_id_i226() to identify affected parts and
igc_disable_broken_aspm_l1_2() to clear the ASPM L1.2 enable bit
on attach and after resume, since PCIe config space can be
reset across a suspend/resume cycle.

Adapted from the Linux igc driver:

  0325143b59c6 igc: disable L1.2 PCI-E link substate to avoid
               performance issue
  1468c1f97cf3 igc: fix disabling L1.2 PCI-E link substate on I226

    [8 lines not shown]
DeltaFile
+44-0sys/dev/igc/if_igc.c
+21-0sys/dev/igc/igc_base.c
+1-0sys/dev/igc/igc_base.h
+66-03 files

FreeBSD/src 04f8a6asys/dev/pci pcireg.h

pci: Add L1 PM definitions

Add register/bit definitions for the L1 PM substates capability
(PCIZ_L1PM) to pcireg.h.

Signed-off-by: Michael Adler <madler at tapil.com>

MFC after:      1 week
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2318
DeltaFile
+14-0sys/dev/pci/pcireg.h
+14-01 files

FreeBSD/src 4175949sys/dev/e1000 if_em.h if_em.c

e1000: restrict conventional PCI DMA to 32 bits

Some conventional PCI e1000 configurations hang when given DMA
addresses above 4 GB, particularly on systems using AMD
HyperTransport-to-PCI bridges.  Linux has restricted e1000 to DMA32 in
PCI mode since 2011 for the same failure class in commit
e508be174ad36b0cf9b324cd04978c2b13c21502.

Set iflib's DMA width after determining the negotiated bus type.  This
covers descriptor and packet-buffer mappings while preserving 64-bit
DMA for PCI-X and PCIe devices and providing a conditional tunable.

PR:             297064
Reported by:    Alexander Leidinger <netchild at FreeBSD.org>
Tested by:      Alexander Leidinger <netchild at FreeBSD.org>
MFC after:      1 week
DeltaFile
+21-0sys/dev/e1000/if_em.c
+1-0sys/dev/e1000/if_em.h
+22-02 files

FreeBSD/src f4860c3stand/libsa bootp.c

stand: Bump DHCP xid between transactions

Transaction ID should persist only between OFFER and the following
REQUEST.  In all other cases it should change.
DeltaFile
+7-1stand/libsa/bootp.c
+7-11 files

FreeBSD/src a1edeb4sys/dev/e1000 if_em.c

e1000: fix 82574 MSI-X interrupt throttling

em_newitr() and the per-queue interrupt_rate sysctl both tested
que->msix to decide whether an 82574 is running in MSI-X mode.  0 is a
valid MSI-X vector so queue 0 was misclassified as legacy/MSI.

Test sc->intr_type == IFLIB_INTR_MSIX instead.  While here, index the tx
EITR read by tque->msix rather than tque->me so it matches the register
em_newitr() actually writes; the two differ once tx_num_queues exceeds
rx_num_queues.

Also seed que->itr_setting in em_initialize_receive_unit() with the rate
the hardware was just programmed with.  Otherwise an itr_setting left
over from AIM across an interface re-init makes the change detection in
em_newitr() suppress the write that would restore it, leaving the
hardware at the default rate while software believes otherwise.

Fixes:          3e501ef89667 ("e1000: Re-add AIM")

(cherry picked from commit 941113a0097ea047bd493f7f78b384718249779d)
DeltaFile
+20-4sys/dev/e1000/if_em.c
+20-41 files

FreeBSD/src 2389c5dsys/dev/e1000 if_em.c

e1000: fix 82574 MSI-X interrupt throttling

em_newitr() and the per-queue interrupt_rate sysctl both tested
que->msix to decide whether an 82574 is running in MSI-X mode.  0 is a
valid MSI-X vector so queue 0 was misclassified as legacy/MSI.

Test sc->intr_type == IFLIB_INTR_MSIX instead.  While here, index the tx
EITR read by tque->msix rather than tque->me so it matches the register
em_newitr() actually writes; the two differ once tx_num_queues exceeds
rx_num_queues.

Also seed que->itr_setting in em_initialize_receive_unit() with the rate
the hardware was just programmed with.  Otherwise an itr_setting left
over from AIM across an interface re-init makes the change detection in
em_newitr() suppress the write that would restore it, leaving the
hardware at the default rate while software believes otherwise.

Fixes:          3e501ef89667 ("e1000: Re-add AIM")

(cherry picked from commit 941113a0097ea047bd493f7f78b384718249779d)
DeltaFile
+20-4sys/dev/e1000/if_em.c
+20-41 files

FreeBSD/src 491f8d0sys/net if_gre.c

if_gre(4): Fix link state announcement in SIOCDIFPHYADDR

Since we unlock gre before if_detach() and use slock in gre_clone_modify_nl()
there is no need to split if_link_state_change() out of gre_delete_tunnel().

Reported by: markj
Fixes: a0d2e5ebaa2e ("if_gre(4): Fix races by changing initialization order and locks")
DeltaFile
+1-2sys/net/if_gre.c
+1-21 files

FreeBSD/src a28c289. .mailmap, share/misc committers-src.dot

Add new src committer: Minsoo Choo (mchoo)

Completed steps 5-6 and 10 in the committer's guide.

Reviewed by:    jhb
Approved by:    jhb (mentor)
Differential Revision:  https://reviews.freebsd.org/D58507
DeltaFile
+2-0share/misc/committers-src.dot
+2-0.mailmap
+1-0usr.bin/calendar/calendars/calendar.freebsd
+5-03 files

FreeBSD/src fdf86dftests/sys/net Makefile if_gre.sh

if_gre: Add a regression test

Add a regression test for gre(4)
to make sure all of the gre capabilities and options are
working as intended.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55363
DeltaFile
+396-0tests/sys/net/if_gre.sh
+1-0tests/sys/net/Makefile
+397-02 files

FreeBSD/src 1cd332asbin/ifconfig ifgre.c

ifconfig: Add gre netlink support

Implement netlink support for gre in ifconfig

Differential Revision: https://reviews.freebsd.org/D55366
DeltaFile
+274-0sbin/ifconfig/ifgre.c
+274-01 files

FreeBSD/src a0d2e5esys/net if_gre.h if_gre.c

if_gre(4): Fix races by changing initialization order and locks

Treat if_gre like any other network drivers during module
initialization by using SI_SUB_PROTO_IF.
Also, destroy cloned interfaces via a prison removal callback for
gre over udp.

PR:             275474
Reviewed by:    markj
Discussed with: glebius
Differential Revision: https://reviews.freebsd.org/D57669
DeltaFile
+62-34sys/net/if_gre.c
+0-3sys/net/if_gre.h
+62-372 files