]> www.infradead.org Git - nvme.git/commit
ethtool: fix setting key and resetting indir at once
authorJakub Kicinski <kuba@kernel.org>
Thu, 25 Jul 2024 22:23:51 +0000 (15:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2024 09:59:07 +0000 (10:59 +0100)
commit7195f0ef7f5b8c678cf28de7c9b619cb908b482c
treefeb3ab04fc87456e3c61fcff0dd3092c4edde030
parent9dbad38336a9c9a6e77df07c6c770ff6cf55c365
ethtool: fix setting key and resetting indir at once

The indirection table and the key follow struct ethtool_rxfh
in user memory.

To reset the indirection table user space calls SET_RXFH with
table of size 0 (OTOH to say "no change" it should use -1 / ~0).
The logic for calculating the offset where they key sits is
incorrect in this case, as kernel would still offset by the full
table length, while for the reset there is no indir table and
key is immediately after the struct.

  $ ethtool -X eth0 default hkey 01:02:03...
  $ ethtool -x eth0
  [...]
  RSS hash key:
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
  [...]

Fixes: 3de0b592394d ("ethtool: Support for configurable RSS hash key")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/ioctl.c