Page MenuHomeFreeBSD

rss: Enable portions of RSS globally to enable symmetric hashing
ClosedPublic

Authored by gallatin on Oct 14 2025, 7:46 PM.
Tags
None
Referenced Files
F141192566: D53089.id166949.diff
Fri, Jan 2, 4:21 AM
Unknown Object (File)
Tue, Dec 23, 5:50 PM
Unknown Object (File)
Sat, Dec 20, 9:49 PM
Unknown Object (File)
Fri, Dec 19, 12:45 PM
Unknown Object (File)
Sat, Dec 13, 10:30 PM
Unknown Object (File)
Tue, Dec 9, 12:21 PM
Unknown Object (File)
Tue, Dec 9, 6:56 AM
Unknown Object (File)
Mon, Dec 8, 2:59 PM

Details

Summary

We use the fact that all NICs that support hashing are using the
same hash algorithm and hash key to enable symmetic hashing in
TCP, where a software version of the same hash is used to
establish hashes on outgoing connections.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Yup, most multiqueue NICs now just "do" RSS natively whether we want it or not, and the main difference here with RSS defined was whether the configured key or a random key was used, etc.

So exposing the global RSS API for the key management / configuration is fine.

(Eventually I'd like it to be a key we can program in per device and globally, and tweak it all at runtime, but that's later.)

This revision is now accepted and ready to land.Oct 22 2025, 7:14 PM
  • Made rss_config.c standard. This is needed because most

drivers do not check to see if INET/INET6 is enabled before
setting up RSS. This fixes compilation errors in most
drivers with LINT-NOIP

-Fixed compilattion error with LINT-NOIP after making rss_config
standard. Basically, the net_inet sysctl tree does not exist in
a NOIP kernel. So when in this configuration, hang rss config
off of net instead.

This revision now requires review to proceed.Oct 30 2025, 7:03 PM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 22 2025, 2:31 PM
This revision was automatically updated to reflect the committed changes.

Is it safe for MFC to stable/15 ? I see no plans for the MFC, I see that cherry-picking works fine, but there are clearly no plans for MFC in the commit message.

Is it safe for MFC to stable/15 ? I see no plans for the MFC, I see that cherry-picking works fine, but there are clearly no plans for MFC in the commit message.

I don't have a great way to test things on 15-stable (since we run -current), and so I don't MFC things that I feel would require a lot of testing.
I'm currently working on a bug (either in this, or in some related changes) that our testing revealed and which seems to be caused by ixl setting a valid hash type but invalid flowid.

what are you seeing? I remember ixl RSS being buggy!

Thanks for dusting off those RSS bytes and for the reply !

I'll test this on a few hosts in the stable/15 branch, as I've been using the kernel with "options RSS" on some of them for a while now, with no issues so far.

what are you seeing? I remember ixl RSS being buggy!

A valid rss type set with a 0 flowid for connections nginx accepts. Not sure why ixl can't calculate a proper hash in that case, but it can be worked around by checking to see if the flowid (rss hash result) is valid.

See https://reviews.freebsd.org/D54442