FreeBSD/src d81f120 — sys/netinet tcp_syncache.c, sys/sys mbuf.h

tcp: restrict flowtype copying to specific RSS TCP types

Reviewed by:    gallatin, tuexen
Differential Revision:  https://reviews.freebsd.org/D55196

(cherry picked from commit a485399f88348efbe52aad2fa9b14af8b9ae55c7)
DeltaFile
+2-2sys/netinet/tcp_syncache.c
+4-0sys/sys/mbuf.h
+6-22 files

FreeBSD/src d65e33b — sys/netinet tcp_syncache.c

tcp: fix build with RSS

PR:     291439
Fixes:  73fe85e486d297c9c976095854c1c84007e543f0
(cherry picked from commit 6f4debc004c31a2bd846757859e67855ab3d4c8d)
DeltaFile
+2-0sys/netinet/tcp_syncache.c
+2-01 files

FreeBSD/src 1bf6be7 — sys/netinet tcp_input.c tcp_syncache.h

tcp: store flowid info in syncache

Now retransmissions by syncache would use correct flowid, same as
synchronous responds.

Reviewed by:            tuexen, gallatin
Differential Revision:  https://reviews.freebsd.org/D51792

(cherry picked from commit 73fe85e486d297c9c976095854c1c84007e543f0)
DeltaFile
+65-36sys/netinet/tcp_syncache.c
+4-4sys/netinet/tcp_syncache.h
+1-1sys/netinet/tcp_input.c
+70-413 files

FreeBSD/src 403586d — sys/netinet tcp_input.c

tcp: don't set flowid in tcp_input()

With dd0e6bb996dc setting it always on connect(2) and syncache always
picking up the flowid from the incoming packet, any ESTABLISHED connection
shall have the flowid already set.

Reviewed by:            tuexen, gallatin
Differential Revision:  https://reviews.freebsd.org/D53886

(cherry picked from commit ee18f8be21655c2d98c1c1bd4e081c366fa91c9a)
DeltaFile
+0-31sys/netinet/tcp_input.c
+0-311 files

FreeBSD/src 67661c5 — sys/netinet tcp_syncache.c

tcp: Unifidef use of rss software hash in syncache

Ever since "d9c55b2e8cd6 rss: Enable portions of RSS globally.."
exposed the RSS software hashing functions, it has been possible
to use them without "ifdef RSS".   Do so now in the syncache
so as to get flowids recorded.

Note that the use of the rss hash functions is conditional on IP versions,
so we must ifdef INET to ensure rss_proto_software_hash_v4() is available.

Fixes 73fe85e486d2
Sponsored by: Netflix
Reviewed by: glebius, p.mousavizadeh_protonmail.com, nickbanks_netflix.com, tuexen
Differential Revision: https://reviews.freebsd.org/D54534

(cherry picked from commit 21865c970888ad0e2cde06db843ae2a05af550e7)
DeltaFile
+2-3sys/netinet/tcp_syncache.c
+2-31 files

FreeBSD/src df9269b — sys/net rss_config.c

rss: manifest RSS option in kernel with kern.features sysctl

(cherry picked from commit 78843218b0cc4679826c15829b355f27c17d3fc1)
DeltaFile
+1-0sys/net/rss_config.c
+1-01 files

FreeBSD/src 02327c2 — sys/net rss_config.c

rss_config: Add option to enable rss udp hashing

Added optional system tunable parameter to enable
4-tuple rss udp hashing.

Signed-off-by: bigJ <bigj at solanavibestation.com>
Reviewed by: adrian, pouria
Pull Request: https://github.com/freebsd/freebsd-src/pull/2057
(cherry picked from commit 283ef95d1677b873903f8b8fa077fbfa3a5e0036)
DeltaFile
+22-12sys/net/rss_config.c
+22-121 files

FreeBSD/src 814fc45 — sys/netinet tcp_usrreq.c

tcp: Enable symmetric hashing by setting hash on outgoing conns

Now that we can trust NICs to supply an identical hash result
to software, we can setup the inpcb hash on outgoing connections.
This gives us symmetric hashing, meaning packets should enter
and leave on the same NIC queue.

Differential Revision:  https://reviews.freebsd.org/D53104
Reviewed by: adrian, cc, kbowling, tuexen, zlei
Sponsored by: Netflix

(cherry picked from commit dd0e6bb996dc46e1d91f3d9aef87979716479465)
DeltaFile
+10-0sys/netinet/tcp_usrreq.c
+10-01 files

FreeBSD/src 0c6468d — sys/dev/e1000 em_txrx.c

em: remove M_HASHTYPE when RSS is not enabled

Summary:
Since "73fe85e486d2 tcp: store flowid info in syncache", inp_flowid can be set
if the incoming packet is not M_HASHTYPE_NONE. But this can introduce dummy
and duplicated flowid when a virtual interface set M_HASHTYPE_OPAQUE. This
change will let the upper layer know how to deal with software hash, with
benefits like inp_flowid can be set correctly and m_pkthdr.flowid can be set
correctly in output path.

This fix is similar to "20285cad7a55"

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55137

(cherry picked from commit efcc0423d80e4048e11e997abc46bd0343537e1b)
DeltaFile
+1-1sys/dev/e1000/em_txrx.c
+1-11 files

FreeBSD/src bae107c — sys/dev/e1000 igb_txrx.c

igb: remove M_HASHTYPE when RSS is not enabled

manually cherry-pick efcc0423d80e

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55143

(cherry picked from commit 21dd554d16971a9cce36bb48ebbf5219297995b4)
DeltaFile
+1-1sys/dev/e1000/igb_txrx.c
+1-11 files

FreeBSD/src 6ede1a5 — sys/dev/igc igc_txrx.c if_igc.c

igc: make the hardware RSS hash agree with the stack's configuration

rss_gethashconfig() is available without options RSS since d9c55b2e8cd6.
Use it to program MRQC, as ixl(4), ice(4) and iavf(4) do, instead of a
fixed field set that included UDP 4-tuple, which the configuration
excludes unless net.inet.rss.udp_4tuple is set.  UDP is now hashed on
addresses only by default.

Also report the UDP hash types on receive; they were passed up as
M_HASHTYPE_NONE.

Reviewed by:            kbowling
Fixes:                  517904de5cca ("igc(4): Introduce new driver for the Intel I225 Ethernet controller.")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60284

(cherry picked from commit 66ff9289b041720f29205f179337f81b5dd0c365)
DeltaFile
+21-9sys/dev/igc/if_igc.c
+6-0sys/dev/igc/igc_txrx.c
+27-92 files

FreeBSD/src 215fbb3 — sys/dev/ixl ixl_txrx.c

ixl: verify flowid is valid before setting rsstype & flowid

According to section 8.3.2.2.1 of the XL710 datasheet,
FLTSTAT indicates if RSS hashing was used (or flow director
or nothing) to arrive at the flowid it is reporting.
We need to check this before reporting the flowid and setting the
rss type. Not checking this allows invalid flowids (0s) to be
reported for some TCP traffic (it seems to mostly impact incoming
connections). This leads to the inp flowid being 0, and egress
traffic being unbalanced (going to tx queue 0, and NIC 0 of an
lacp bundle).

Differential Revision: https://reviews.freebsd.org/D54442
Reviewed by: adrian, kbowling
Sponsored by: Netflix

(cherry picked from commit ac1cd655f647cfd8e8d8c08da00f41abfce212a1)
DeltaFile
+7-3sys/dev/ixl/ixl_txrx.c
+7-31 files

FreeBSD/src 70b78ef — sys/dev/igc igc_txrx.c

igc: remove M_HASHTYPE when RSS is not enabled

Summary: manually cherry-pick 21dd554d1697

Reviewed by: kbowling
Differential Revision: https://reviews.freebsd.org/D55256

(cherry picked from commit 9778537b6738d8693e887c3b0c8bc4d5a0aa28ce)
DeltaFile
+1-1sys/dev/igc/igc_txrx.c
+1-11 files

FreeBSD/src fa247b5 — sys/dev/mlx5/mlx5_en en.h mlx5_en_rx.c

mlx5: use newly exposed RSS hash key API rather than ad-hoc hashing

Differential Revision:  https://reviews.freebsd.org/D53091
Reviewed by: kib
Sponsored by: Netflix

(cherry picked from commit 8f94088bc5d3ee586b36f8f7b269223b420ac957)
DeltaFile
+1-29sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+0-4sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
+0-2sys/dev/mlx5/mlx5_en/en.h
+1-353 files

FreeBSD/src adf98ce — sys/conf files

rss: make toeplitz.c standard part of the kernel

This will fix LINT-NOIP build.  This actually adds very little to the
kernel text, e.g. 500 bytes on amd64.  A perfect solution would be to
instead declare rss_config.c as 'optional inet | inet6', but that would
fail to build LINT-NOIP in several NIC drivers, that use RSS and
absolutely ignore that both INET and INET6 are optional.  It is very
unlikely that vendors who maintain these drivers will will ever chase the
holy grail of a build that doesn't support IPv4 and IPv6.

Fixes:  d9c55b2e8cd6b79f6926278e10a79f1bcca27a4b
(cherry picked from commit 407b1e4980189252fade78438aa08191a9883cdc)
DeltaFile
+1-1sys/conf/files
+1-11 files

FreeBSD/src 434994d — sys/netinet sctp_usrreq.c

sctp: improve handling of SO_SETFIB socket option

Since SCTP keeps fibnum in the SCTP protocol control block,
the code can't just defer the processing to the IPv4 or IPv6
layer. Therefore it needs to be implemented in the the SCTP
layer and it needs to call the socket layer function.

PR:             300091
Reviewed by:    tuexen
Fixes:          caccbaef8e26 ("socket: Move SO_SETFIB handling to protocol layers")

(cherry picked from commit 7b8151b0cd1b4f077b382b6be2c02c936d1988fa)
DeltaFile
+10-2sys/netinet/sctp_usrreq.c
+10-21 files

FreeBSD/src e28fb76 — sys/dev/bnxt/bnxt_en if_bnxt.c

bnxt: Initialize RSS with the common key

Use rss_getkey() for the initial VNIC key instead of generating a
per-attachment private key.  Preserve the writable rss_key sysctl,
its override lifetime, the hardware DMA representation, and all hash
and indirection settings.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59795

(cherry picked from commit 62c80d76f7dc960f430cb34f88c2a549612e3e93)
DeltaFile
+4-1sys/dev/bnxt/bnxt_en/if_bnxt.c
+4-11 files

FreeBSD/src 43a6b6d — sys/dev/qlnx/qlnxe ecore_vf.h ecore_vf.c

qlnx: Report the programmed RSS key and hash types

Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH for qlnxe and qlnxev using
the cached vport RSS configuration.  This lets hn(4) synchronize its
synthetic RSS configuration with the VF without assuming that every
driver programs all of the common RSS hash selections.

Serialize the queries with the device lock and reject them while the
interface is not running.  Convert the firmware request's key words back
into network byte order and translate the six representable IPv4/IPv6
TCP/UDP hash selections.  Report no hashing when RSS is disabled, including
the driver's single-queue configuration.

For VFs, require a successful RSS extension response from every hardware
function.  The overall vport-update reply can succeed while its RSS TLV
is missing or rejected; recording that result prevents reporting an
unconfirmed configuration.  Invalidate the confirmation before each RSS
request.  Leave existing vport-update return semantics, queue setup, and
the receive datapath unchanged.

    [6 lines not shown]
DeltaFile
+84-0sys/dev/qlnx/qlnxe/qlnx_os.c
+5-0sys/dev/qlnx/qlnxe/ecore_vf.c
+3-0sys/dev/qlnx/qlnxe/ecore_vf.h
+92-03 files

FreeBSD/src e2ecf41 — sys/dev/vnic nicvf_main.c

vnic nicvf: Program the common RSS key in network word order

Replace the repeated hardware-reset key with rss_getkey().  Decode each
eight-byte chunk with be64dec() into the register-word array before
programming the five key registers.

This matches the key serialization in DPDK's nicvf_rss_set_key(), added
by commit 7694fab264ac666d62a4cae04f2979991ce64259
("net/thunderx/base: add RSS and RETA configuration").  A raw copy into
the word array on little-endian hosts would reverse bytes within each
register relative to that convention.

Preserve the CPI-algorithm gate, enabled hash fields, and round-robin
indirection table.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59806

(cherry picked from commit 8c25b70120e8838135cb356c94d350105f45ff7c)
DeltaFile
+8-6sys/dev/vnic/nicvf_main.c
+8-61 files

FreeBSD/src d93919d — sys/dev/enetc if_enetc.c

enetc: Use the common RSS key

Replace the random register words with rss_getkey() and decode each
four-byte chunk with le32dec() before writing the port's key registers.

Keep the RSS capability check and existing queue-count and indirection
table programming unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59805

(cherry picked from commit 449fc84f370b079619eaa0d70008391ac07718f5)
DeltaFile
+6-1sys/dev/enetc/if_enetc.c
+6-11 files

FreeBSD/src a1ff07f — sys/dev/al_eth al_eth.c

al_eth: Use the common RSS key

Fetch the common Toeplitz key instead of filling it with random bytes
during receive-forwarding setup.  Check the key size at compile time and
retain the existing host-to-network conversion for each hardware word.

Leave forwarding, hash selection, and queue mapping unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59804

(cherry picked from commit fbe4eefbb6ca29e1f88d122619f7311896b81b1f)
DeltaFile
+4-2sys/dev/al_eth/al_eth.c
+4-21 files

FreeBSD/src 56211de — sys/dev/qlxgb qla_hw.c

qlxgb: Derive the firmware RSS key from the common key

Replace the embedded key with rss_getkey().  Retain the reversed 64-bit
word-pair order and low-word-first layout used by the existing firmware
request, matching the qlxgbe conversion.

The common default produces the same five firmware words as the old
constants.  Leave hash selections, RSS enablement, and the indirection
mask unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59803

(cherry picked from commit 4ad740ad48e2b461637c85cad675202874e182e2)
DeltaFile
+13-6sys/dev/qlxgb/qla_hw.c
+13-61 files

FreeBSD/src 56f734f — sys/dev/qlxge qls_hw.c

qlxge: Derive both RSS keys from the common key

Replace the embedded default with rss_getkey().  Preserve the ICB's
little-endian representation of each big-endian key word, then copy
the initial 16 bytes of the serialized IPv6 key into the IPv4 key.

This retains the old default-key bytes and allows a configured common
key to take effect.  Leave RSS flags and queue mapping unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59802

(cherry picked from commit a5e3c38531cd94d245372147f6f6e1d6d2f82a39)
DeltaFile
+13-14sys/dev/qlxge/qls_hw.c
+13-141 files

FreeBSD/src eae583d — sys/dev/qlxgbe ql_hw.c

qlxgbe: Derive the mailbox RSS key from the common key

Replace the embedded key with rss_getkey(), retaining the firmware's
reversed 64-bit word-pair order and low-word-first layout within each
pair.  The common default produces the same mailbox key as the existing
constants, while configured common keys no longer get ignored.

Leave the RSS enable flags, hash types, and indirection policy unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59801

(cherry picked from commit 30fdef26de87516dbdd1dd5e3031a57ba8759437)
DeltaFile
+12-7sys/dev/qlxgbe/ql_hw.c
+12-71 files

FreeBSD/src 60ec0fa — sys/dev/qlnx/qlnxe qlnx_os.c

qlnx: Derive the hardware RSS key from the common key

Replace the embedded default key with rss_getkey().  Decode each group
of four key bytes as a big-endian word; the shared code then serializes
those host-order words as little-endian firmware fields.  This preserves
the existing hardware representation for the common default and allows
a configured common key to take effect.

Keep the existing multi-queue gate, RSS hash selections, and indirection
policy unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59800

(cherry picked from commit ce68b58217ed8a9bf45b1622d3d32ec26e9025d0)
DeltaFile
+8-13sys/dev/qlnx/qlnxe/qlnx_os.c
+8-131 files

FreeBSD/src d38a29e — sys/dev/mana mana_en.c

mana: Initialize ports with the common RSS key

Use rss_getkey() for each port's initial key instead of a lazily generated
driver-global random key.  Remove the obsolete helper and its unsynchronized
initialization flag.  Make the common-key declaration available without
options RSS.

The port still retains the key used for hardware programming and the
existing SIOCGIFRSSKEY response.  Leave hash types and queue placement
unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59799

(cherry picked from commit aef4c3eb31d9c29c6aeb08023b1c9d2457d817e3)
DeltaFile
+3-19sys/dev/mana/mana_en.c
+3-191 files

FreeBSD/src 99b41b3 — sys/dev/mlx4/mlx4_en en.h mlx4_en_netdev.c

mlx4en: Use the common RSS key for programming and queries

Replace the private fixed key with rss_getkey().  Copy the common byte
stream directly into the RSS queue-pair context and use the same helper
for SIOCGIFRSSKEY, so hardware programming and hn's query agree.

Change the helper to fill caller-owned storage instead of returning a
pointer to a static key.  Check the fixed hardware and ioctl buffer sizes
at compile time.  Leave RSS masks and queue steering unchanged.

Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59798

(cherry picked from commit 1ad999a1c7e0efd4fd65df634a4c108d593d4027)
DeltaFile
+7-23sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
+4-6sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
+1-1sys/dev/mlx4/mlx4_en/en.h
+12-303 files

FreeBSD/src bffb71b — sys/dev/oce oce_mbox.c

oce: Use the common RSS key

Fill the RSS configuration request with the common 40-byte key instead
of fresh random bytes.  Preserve the mailbox representation, hash
selection, and indirection table.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59797

(cherry picked from commit fd74d1e83e18b8f014d8fcc7b61f2e9461512dca)
DeltaFile
+4-1sys/dev/oce/oce_mbox.c
+4-11 files

FreeBSD/src 0abea94 — sys/dev/bxe bxe.c

bxe: Program the common RSS key in searcher byte order

Use the common RSS key instead of generating private random words.
Reverse the bytes before passing the key to the shared code, which copies
the supplied bytes directly into the firmware request.  The searcher
consumes this array in reverse order; a raw copy of the common key would
not produce matching Toeplitz hashes.

The hardware ordering is documented by Linux commit
d682d2bdc30650a5c7ce9908ab83ab674b658744 ("bnx2x: byte swap rss_key to
comply to Toeplitz specs").  Keep the conversion in the FreeBSD caller
rather than changing the shared-code interface.

Preserve the config_hash gate, including the PMF-only key programming
on 57710/57711, and leave hash types and indirection policy unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59796

    [2 lines not shown]
DeltaFile
+10-5sys/dev/bxe/bxe.c
+10-51 files

FreeBSD/src dddc7c1 — sys/dev/axgbe if_axgbe_pci.c

axgbe: Use the common RSS key without options RSS

Fetch the common key in the PCI iflib frontend regardless of options RSS
and make the key API declaration available in both configurations.
Retain the existing hash-field selection and queue-placement branches.
The independent ARM frontend is unchanged.

Reviewed by:    gallatin
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59794

(cherry picked from commit e94de94f8d14ede98d38c9fc506ddf5c77ee9788)
DeltaFile
+6-4sys/dev/axgbe/if_axgbe_pci.c
+6-41 files