net: ethtool: fix compat with old RSS context API
authorJakub Kicinski <kuba@kernel.org>
Tue, 2 Jul 2024 16:41:57 +0000 (09:41 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jul 2024 02:22:17 +0000 (19:22 -0700)
commit1a16cdf77e0d7de0fb640e65d65c0898b38c1b4b
tree3f6cc3d9e4da206740b9691d6805091ea90830c9
parent0b8774586be5b2f3aa9a0e665846c985e15f621e
net: ethtool: fix compat with old RSS context API

Device driver gets access to rxfh_dev, while rxfh is just a local
copy of user space params. We need to check what RSS context ID
driver assigned in rxfh_dev, not rxfh.

Using rxfh leads to trying to store all contexts at index 0xffffffff.
From the user perspective it leads to "driver chose duplicate ID"
warnings when second context is added and inability to access any
contexts even tho they were successfully created - xa_load() for
the actual context ID will return NULL, and syscall will return -ENOENT.

Looks like a rebasing mistake, since rxfh_dev was added relatively
recently by commit fb6e30a72539 ("net: ethtool: pass a pointer to
parameters to get/set_rxfh ethtool ops").

Fixes: eac9122f0c41 ("net: ethtool: record custom RSS contexts in the XArray")
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20240702164157.4018425-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/ioctl.c