netinet: Generate a random RSS key on boot.
Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential D24989
netinet: Generate a random RSS key on boot. nc on May 24 2020, 8:58 PM. Authored by Tags Referenced Files
Details
Diff Detail
Event TimelineComment Actions Did you mean to add some reviewers for this too? :)
Comment Actions @cem thanks for the comments. I fixed arc4random_buf(). About waiting for entropy, I think you're right.
Comment Actions I have a vague memory, maybe wrong, that commonly used fixed RSS keys were selected because they had some property (-ies). Comment Actions I also have such feeling. For example, you have some server that handles some serious workload, but after reboot due to the new key it will not be able to handle the same workload. Comment Actions I believe Linux just uses random keys: Callers (example):
However, DPDK uses something called "MAXIMALLY EQUIDISTRIBUTEDCOMBINED LFSR GENERATORS" (paper: https://www.ams.org/journals/mcom/1999-68-225/S0025-5718-99-01039-X/S0025-5718-99-01039-X.pdf):
Caller (example): Comment Actions I Google searched this and haven't found much evidence on RSS keys. I could be wrong as well. EDIT: There is evidence on "Symmetric" RSS keys like seen here: http://galsagie.github.io/2015/02/26/dpdk-tips-1/ Is that what you're talking about? Comment Actions Should I sequence the key into "symmetrical RSS" where the first 32 bits == the next 32 bits, and all subsequent 16 bits chunks are equal?. Or is it something else? Comment Actions i remember there was some concern in the past where there were very bad rss key choices out there. is there a reason for actually pushing for a random rss key? I stuck with the microsoft rss key (and a symmetric rss key at norse) specifically so there wouldn't be boot to boot variation in traffic patterns when doing testing/evaluation. Comment Actions Hi everyone, At stormshield we are using a similar hand-made patch so i can give you some feedback about this feature. We support symmetric and non-symmetric static or random rss key, using the following systctls:
We were also forced to add a reseed sysctl proc after noticing that the initial entropy is too low during rss key init, and we call it after boot just before loading our network kernel modules. Before this we had some product that were using RSS key that fail to provide proper distribution of packets. This change was made before we start using the initial entropy feature of the loader so i am not sure if it is still relevant. If some of you have interest i can share our patch (in private) which only support the rss_getkey() API and not all the other rss_xxx functions has we are not using them in our codebase. Damien for Stormshield. |