FreeBSD/src 91bff7d — sys/netinet in_pcb_var.h in_pcb.h, sys/netinet6 in6_pcb.c

Revert "inpcb: add single peer local port caching"

This reverts commit 289082428c764ed282623cc6f7ee9b7448fddad1.

Requested by:   markj
DeltaFile
+1-243sys/netinet/in_pcb.c
+1-1sys/netinet/in_pcb.h
+0-1sys/netinet6/in6_pcb.c
+0-1sys/netinet/in_pcb_var.h
+2-2464 files

FreeBSD/src f172668 — sys/net iflib.c

iflib: Do not pull up trailing IPv4 fragments to the L4 header

iflib_parse_header() pulls every IPv4 packet up to the end of the TCP or
UDP header, including fragments at a non-zero offset, which carry no L4
header at all.  A trailing fragment shorter than that header (1-7 bytes
of UDP, 1-19 bytes of TCP) makes m_pullup() fail and the frame is freed
without a trace in the interface counters.

Only parse the L4 header on the first fragment.  TSO never produces
fragments, so assert that.

With a 1500-byte MTU every UDP datagram of 1473-1479 bytes is lost
behind a forwarding host whose ingress NIC sets receive checksum flags,
or on any VLAN with hardware tagging.  SIP over UDP is a common victim.

Reported by:    Alex Roberts
Reviewed by:    gallatin
Fixes:          c224b2ce7de0 ("iflib: don't pullup UDP payloads to the TCP header size")
See also:       https://redmine.pfsense.org/issues/17196

    [2 lines not shown]
DeltaFile
+11-4sys/net/iflib.c
+11-41 files

FreeBSD/src c31cc43 — usr.bin/sockstat main.c

sockstat: improve consistency

Include the entries of the BBLOG STATE column in the computation
of the column width as done also for other columns.
Also set first to falso only when needed.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 732c8d2a1a0e169bad1c02b1e54a4306861bde4a)
DeltaFile
+5-1usr.bin/sockstat/main.c
+5-11 files

FreeBSD/src a949836 — usr.bin/sockstat main.c

Revert "sockstat: improve consistency"

This reverts commit 2001681da17920216251a4dd35c6778bcabb25bd.
DeltaFile
+1-5usr.bin/sockstat/main.c
+1-51 files

FreeBSD/src 2001681 — usr.bin/sockstat main.c

sockstat: improve consistency

Include the entries of the BBLOG STATE column in the computation
of the column width as done also for other columns.
Also set first to falso only when needed.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 732c8d2a1a0e169bad1c02b1e54a4306861bde4a)
DeltaFile
+5-1usr.bin/sockstat/main.c
+5-11 files

FreeBSD/src 3b09a93 — usr.bin/sockstat main.c

Revert "sockstat: improve consistency"

This reverts commit 71b1f005a56ea11bea1588f2b215f8714a36e71b.
It  breaks compilation.
DeltaFile
+1-5usr.bin/sockstat/main.c
+1-51 files

FreeBSD/src 86a925f — share/man/man4 ptnet.4

ptnet.4: Fix typo

MFC after:      3 days
Reviewed by:    ziaee
Signed-off-by:  Seth Hoffert <seth.hoffert at gmail.com>
Closes:         https://github.com/freebsd/freebsd-src/pull/2480
DeltaFile
+1-1share/man/man4/ptnet.4
+1-11 files

FreeBSD/src cf63e3f — lib/libsys pdfork.2

pdfork.2: improve markup

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1lib/libsys/pdfork.2
+1-11 files

FreeBSD/src 2b6479e — sys/dev/ice if_ice_iflib.c ice_lib.c

ice(4): Fix link bringup on driver load

Patch adding Total Port Shutdown support incorrectly
handled a case when this feature was not enabled in the NVM.
When TPS bit is not set driver should apply link configuration
according to user settings and update the status. Those steps
were mistakenly omitted, while the state flag was still set
to prevent link renegotation and status update on first
attempt to bring interface up with ifconfig.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Reported by:    kbowling
Reviewed by:    kbowling
Fixes:          0011cd9f8863 ("ice(4): Support Total Port Shutdown on E830 devices")
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D59578

(cherry picked from commit dcb84ddcfe89d358a66cffb45196e6b45b45502c)
DeltaFile
+22-4sys/dev/ice/ice_lib.c
+2-4sys/dev/ice/if_ice_iflib.c
+24-82 files

FreeBSD/src 8b5c666 — sys/dev/ice ice_lib.h ice_strings.c

ice(4): Support Total Port Shutdown on E830 devices

When 'Permit Total Port Shutdown' feature in BIOS is enabled then Port
Disable bit is set in the Link Default Override Mask TLV PFA module
in the NVM. In this mode, the driver acts as if the link_active_on_if_down
flag is always disabled and disallow any change to that flag.
This feature applies for E830 and E835 NIC series.

Signed-off-by: Pawel Sobczyk <pawel.sobczyk at intel.com>

Tested by:      Mateusz Moga <mateusz.moga at intel.com>
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D58149

(cherry picked from commit 0011cd9f8863fce3743bfd9920b7924162bb6410)
DeltaFile
+10-5sys/dev/ice/ice_lib.c
+9-0sys/dev/ice/if_ice_iflib.c
+2-0sys/dev/ice/ice_strings.c
+1-0sys/dev/ice/ice_lib.h
+22-54 files

FreeBSD/src bbd9741 — sys/netinet sctp_indata.c

sctp: improve locking validation

Ensure that the TCB lock is hold in sctp_calc_rwnd().

Reviewed by:    tuexen

(cherry picked from commit 38479a4832789c239eb1ff097ee51e93e8084315)
DeltaFile
+2-0sys/netinet/sctp_indata.c
+2-01 files

FreeBSD/src 0b3f85d — sys/netinet sctputil.c

sctp: hold tcp lock when calling sctp_calc_rwnd()

This was done in all code paths except one. Fix this to avoid
race conditions.

Reported by:    syzbot+2e2dc35c0e24a74663a7 at syzkaller.appspotmail.com
Reviewed by:    tuexen

(cherry picked from commit 429f2fb48b92011d07798e681d96aa628fd8e387)
DeltaFile
+14-21sys/netinet/sctputil.c
+14-211 files

FreeBSD/src fafba56 — sys/kern kern_sysctl.c

sysctl: don't loop when EAGAIN is returned

When userland_sysctl() experiences EAGAIN, don't loop internally but
leave retrying to the caller.
Looping was a problem in case of using tcpsso(8) to switch a TCP stack
where the acceptance check of the new TCP stack results in EAGAIN.

Reviewed by:            kib, glebius
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D60444

(cherry picked from commit d39b12e9030b20410cecbcbb0c22847d7f8b5471)
DeltaFile
+3-8sys/kern/kern_sysctl.c
+3-81 files

FreeBSD/src f9b8c15 — usr.sbin/tcpdrop tcpdrop.c

tcpdrop: improve handling of -C and -S

Handle empty strings for -C and -S correctly.

Reported by:            maxim
Reviewed by:            maxim
Sponsored by:           Netflix, Inc.
Differential Revision:  https://reviews.freebsd.org/D60210

(cherry picked from commit e2279d5ba9a91407239cba4bed80abff73b15798)
DeltaFile
+11-9usr.sbin/tcpdrop/tcpdrop.c
+11-91 files

FreeBSD/src 8e55feb — sys/dev/ixl if_ixl.c ixl_pf.h

ixl(4): Fix NVM update API

Driver provides an interface for tools operating on adapters'
Non-Volatile Memory using SIOC(G|S)DRVSPEC ioctls. It allows
tools to issue Admin Queue commands to the firmware, which
may return an error code encoded as a negative integer.
The driver passed this negative integer as the return value
of the ioctl handler. This was causing issues because the FreeBSD
kernel reserves negative error codes in system calls for special
purposes such as restarting the handler or detecting incorrect
behavior in VFS operations. Simple remapping of negative values
to positive integers caused currently available tools to misbehave
and could break the NVM update process. Introduce a new API version,
which allows new versions of tools to detect the fixed driver.
Temporarily keep the old API, but issue a warning that tools need
to be updated.

Also refactor the code to use centralized cleanup and move the
debug message from the firmware earlier to make sure it is not masked

    [9 lines not shown]
DeltaFile
+41-25sys/dev/ixl/ixl_pf_main.c
+7-1sys/dev/ixl/ixl_pf.h
+2-1sys/dev/ixl/if_ixl.c
+50-273 files

FreeBSD/src ae93abe — sys/netinet tcp_syncache.c

tcp md5: improve consistency

All other usages of SCF_SIGNATURE are protected by IPSEC_SUPPORT
or TCP_SIGNATURE.
No functional change intended.

Reported by:    Hannes Elfert

(cherry picked from commit 74d330943b572a6f17f45b7c9c2035bde2956380)
DeltaFile
+2-0sys/netinet/tcp_syncache.c
+2-01 files

FreeBSD/src f23fa56 — sys/netinet tcp_syncache.c

tcp md5: fix accounting of ACK with bad signatures

When processing the ACK of the initial TCP handshake using the
SYN cookie, don't increment the counter for unexpected
signatures (tcps_sig_err_sigopt). The correct
counter (tcps_sig_rcvbadsig) for bad signatures is already
incremented in TCPMD5_INPUT().

Reported by:            Hannes Elfert
Reviewed by:            rscheff
Differential Revision:  https://reviews.freebsd.org/D59302

(cherry picked from commit 2fb53436cd05f65164d166ef3ab33660fe451470)
DeltaFile
+0-1sys/netinet/tcp_syncache.c
+0-11 files

FreeBSD/src 6fa319d — sys/netinet tcp_syncache.c

tcp md5: fix accounting for SYN segments with unexpected signature

When receiving a SYN segment with an MD5 option on a listening socket,
which has not enabled TCP MD5 support, increment the counter for
unexpected signatures (tcps_sig_err_sigopt).

Reviewed by:            rscheff
Differential Revision:  https://reviews.freebsd.org/D59303

(cherry picked from commit 5d3e31df7c4fc0e53168bac717bed5f94dab7068)
DeltaFile
+3-1sys/netinet/tcp_syncache.c
+3-11 files

FreeBSD/src 3d55464 — sys/netinet tcp_input.c, sys/netinet/tcp_stacks rack.c bbr.c

tcp md5: improve handling of tcps_sig_err_sigopt counter

For non listening TCP endpoints, increment the tcps_sig_err_sigopt
counter when TCP MD5 is not enabled in the TCP connection, but a
segment containing a TCP MD5 option is received.
Also increment the counter when using the RACK or BBR stack.

Reported by:            Hannes Elfert
Reviewed by:            rrs
Differential Revision:  https://reviews.freebsd.org/D59249

(cherry picked from commit c6ae11c1b0d96fd2ed0b55c655ff58a46b26ddcb)
DeltaFile
+2-4sys/netinet/tcp_input.c
+5-0sys/netinet/tcp_stacks/rack.c
+5-0sys/netinet/tcp_stacks/bbr.c
+12-43 files

FreeBSD/src 2890824 — sys/netinet in_pcb_var.h in_pcb.h, sys/netinet6 in6_pcb.c

inpcb: add single peer local port caching

A typical caching proxy problem is port allocation to backends.  We
usually have a few of them, with thousands connections to each.  Upon
creation of a new connection we need to find a new unique local port for
the peer:port.  This is achieved by linear search in in_pcb_lport_dest().
The closer we get to the port exhaustion the more expensive this loop is.
It needs to be executed tens thousands of times to find a port or fail.

Address the problem by adding advisory negative cache that is lazily
allocated upon first conflict.  Once the cache is in action we skip trying
those ports that are already marked in the cache.  During the search we
may encounter a cache allocated by other lookup.  In this case the caches
are merged into one.  The expectation is that under a stable heavy load we
are going to stabilize at a very low number of allocated caches, ideally
one per peer:port. The cache is a bitset of IPPORT_MAX, which makes it 8k.
Unfortunately metadata pushes allocation size to 16k UMA bucket.  However,
the expectation is that we are going to have a very few allocated, thus
current decision is to not create a separate UMA zone.

    [2 lines not shown]
DeltaFile
+243-1sys/netinet/in_pcb.c
+1-1sys/netinet/in_pcb.h
+1-0sys/netinet6/in6_pcb.c
+1-0sys/netinet/in_pcb_var.h
+246-24 files

FreeBSD/src 6873fec — sys/netinet tcp_input.c

tcp: minor cleanup

Several cleanups in tcp_input_with_port():
* Don't assign m twice.
* Don't reassign pointers without having done pullup().
* While there, change the type of isipv6 to bool, since it is used
  that way.
No functional change intended.

Reported by:            Hannes Elfert
Reviewed by:            pouria, Timo Völker, Nick Banks
Differential Revision:  https://reviews.freebsd.org/D59142

(cherry picked from commit 191dad334c646457c012d0d0963505a2f2d73a98)
DeltaFile
+5-8sys/netinet/tcp_input.c
+5-81 files

FreeBSD/src a991de8 — sys/netinet tcp_var.h

tcp: cleanup whitespaces

Use tabs consistently in #defines
No functional change intended.

Reported by:    Hannes Elfert

(cherry picked from commit 74019bc3ea91f7a1dfd36acbc1627f3d00ca002f)
DeltaFile
+3-3sys/netinet/tcp_var.h
+3-31 files

FreeBSD/src 71b1f00 — usr.bin/sockstat main.c

sockstat: improve consistency

Include the entries of the BBLOG STATE column in the computation
of the column width as done also for other columns.
Also set first to falso only when needed.

Sponsored by:   Netflix, Inc.

(cherry picked from commit 732c8d2a1a0e169bad1c02b1e54a4306861bde4a)
DeltaFile
+5-1usr.bin/sockstat/main.c
+5-11 files

FreeBSD/src a492f31 — share/man/man4 epair.4, sys/net if_epair.c

epair: allow disabling receive checksum offloading

Allow disabling RXCSUM and RXCSUM6 on an epair interface. If disabled,
epair unsets the mbuf flags that indicate a valid checksum when
transferring a packet from one epair end to the other. This gives a
user in a jail the power to control whether the user wants to use the
result of a previous validation (by a physical interface) or not.

Reviewed by:            kp, tuexen
Differential Revision:  https://reviews.freebsd.org/D58786

(cherry picked from commit f343f036c780cfd8e7f243b7708d96b006a257d7)
DeltaFile
+16-8sys/net/if_epair.c
+7-3share/man/man4/epair.4
+23-112 files

FreeBSD/src bea44a8 — sys/conf kern.mk

kernel: Use external retpoline thunks

External retpoline thunks for amd64 and i386 were added in commit
74d971fe1561 ("x86: Add external retpoline thunk").  Use them when
WITH_KERNEL_RETPOLINE is set.

There should not be any material performance impact -- the call sites
are identical, and this just replaces (on amd64) compiler-generated
__llvm_retpoline_r11 functions in each object with our
__x86_indirect_thunk_r11.

After this change we could implement boot-time patching, replacing
__x86_indirect_thunk_r11 with just jmp %r11 when retpoline is not
required.

Note on i386: An i386 build WITH_KERNEL_RETPOLINE was successful, but
has not been extensively tested.  Clang may use registers other than
just eax on i386 and so in the future additional thunks beyond the one
added in 74d971fe1561 could be required for i386.  Patches are welcome

    [4 lines not shown]
DeltaFile
+1-1sys/conf/kern.mk
+1-11 files

FreeBSD/src 0ab8bd1 — sys/netinet sctp_output.c

sctp: initialize inp to avoid uninitialized use

If we take an early goto out_unlocked inp is uninitialized and then
may be used in SCTP_LTRACE_ERR_RET().  Initialize inp to NULL
to avoid warnings.

Found with:     gcc15 tinderbox build
Reviewed by:    tuexen, pouria
Differential Revision: https://reviews.freebsd.org/D56503

(cherry picked from commit 4cdbcc2b6a2e551529f7133665ef406869b48bf7)
DeltaFile
+1-0sys/netinet/sctp_output.c
+1-01 files

FreeBSD/src ffcd788 — sys/conf files, sys/dev/fdt fdt_reserved_memory.c

fdt: Support SCMI shared memory under reserved-memory nodes

Add a simplebus-based pseudo-bus that matches the "reserved-memory"
node in the device tree.  Update the SCMI shared memory driver so that
it can attach either as a child of mmio_sram or directly under
simplebus (via the new reserved-memory bus). Make the mmio_sram memory
resource shareable so both attachment methods can coexist when required.

MFC after:      1 week
Reviewed by:    manu
DeltaFile
+80-0sys/dev/fdt/fdt_reserved_memory.c
+17-28sys/dev/firmware/arm/scmi_shmem.c
+1-1sys/dev/sram/mmio_sram.c
+1-0sys/conf/files
+99-294 files

FreeBSD/src f9126f8 — sys/dev/bnxt/bnxt_en bnxt_sysctl.h bnxt_hwrm.h

if_bnxt: add support for HW generic stats

HW generic stats provide information about PCIe transactions and
out-of-order doorbell writes, useful for debug. Allocate a DMA buffer
for them (disabling BNXT_FW_CAP_GENERIC_STATS if the allocation
fails), fetch them via HWRM_STAT_GENERIC_QSTATS once per admin-status
tick on P5+ chips, and expose them to userspace under
dev.bnxt.<unit>.hwstats.generic_stats.* via sysctl.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58614

(cherry picked from commit d1619865da1cd4c5b557158b4bbf666e0f7f040b)
DeltaFile
+94-0sys/dev/bnxt/bnxt_en/bnxt_sysctl.c
+20-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+15-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+3-0sys/dev/bnxt/bnxt_en/bnxt.h
+1-0sys/dev/bnxt/bnxt_en/bnxt_sysctl.h
+1-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.h
+134-06 files

FreeBSD/src 30c45bb — sys/dev/bnxt/bnxt_en bnxt_hwrm.c

if_bnxt: avoid FTQM/STQM pg_info alias on reset

Copying the STQM backing-store context to seed FTQM's also copied
STQM's pg_info pointer verbatim. On cold load STQM's pg_info is still
NULL so this is harmless, but on a firmware reset STQM's pg_info is
already non-NULL, making FTQM alias STQM's backing-store pages. The
allocator then skips FTQM since it looks already allocated, and FTQM
is later indexed as its own array, reading out of bounds into STQM's
buffer and dereferencing a bogus DMA address.

Clear ctxm->pg_info after the memcpy so FTQM always gets its own
backing store.

Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D58615

(cherry picked from commit f2ce672ade231a1e19f1238922a2c3b6fe696e22)
DeltaFile
+3-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+3-01 files

FreeBSD/src 443c423 — sys/dev/bnxt/bnxt_en if_bnxt.c

if_bnxt: add support for SIOCGI2CPB page/bank i2c requests

Advertise IFLIB_I2C_PAGE_BANK and forward the requested page/bank to
firmware, so CMIS optics can be read correctly instead of falling
back to bogus legacy SFF-8472 decoding. Also fix bnxt_i2c_req() to
return positive errno values.

Signed-off-by:  gallatin
Reviewed by:    gallatin
MFC after:      2 weeks
Sponsored by:   Broadcom Inc.
Differential Revision:  https://reviews.freebsd.org/D59573

(cherry picked from commit fdab50f6f8107c9d825a7e6d92d7a6b89c417bbb)
DeltaFile
+22-4sys/dev/bnxt/bnxt_en/if_bnxt.c
+22-41 files