]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: rss: fix reporting RXH_XFRM_NO_CHANGE as input_xfrm for contexts
authorJakub Kicinski <kuba@kernel.org>
Fri, 30 Jan 2026 19:03:11 +0000 (11:03 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Feb 2026 01:09:48 +0000 (17:09 -0800)
commit1c172febdf065375359b2b95156e476bfee30b60
treeffc696bc94f2ddbc4c409797e053696cad3911f2
parent83b67cc9be9223183caf91826d9c194d7fb128fa
net: rss: fix reporting RXH_XFRM_NO_CHANGE as input_xfrm for contexts

Initializing input_xfrm to RXH_XFRM_NO_CHANGE in RSS contexts is
problematic. I think I did this to make it clear that the context
does not have its own settings applied. But unlike ETH_RSS_HASH_NO_CHANGE
which is zero, RXH_XFRM_NO_CHANGE is 0xff. We need to be careful
when reading the value back, and remember to treat 0xff as 0.

Remove the initialization and switch to storing 0. This lets us
also remove the workaround in ethnl_rss_set(). Get side does not
need any adjustments and context get no longer reports:

  RSS input transformation:
    symmetric-xor: on
    symmetric-or-xor: on
    Unknown bits in RSS input transformation: 0xfc

for NICs which don't support input_xfrm.

Remove the init of hfunc to ETH_RSS_HASH_NO_CHANGE while at it.
As already mentioned this is a noop since ETH_RSS_HASH_NO_CHANGE
is 0 and struct is zalloc'd. But as this fix exemplifies storing
NO_CHANGE as state is fragile.

This issue is implicitly caught by running our selftests because
YNL in selftests errors out on unknown bits.

Fixes: d3e2c7bab124 ("ethtool: rss: support setting input-xfrm via Netlink")
Link: https://patch.msgid.link/20260130190311.811129-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/common.c
net/ethtool/rss.c