• Jakub Kicinski's avatar
    ethtool: fix setting key and resetting indir at once · 7195f0ef
    Jakub Kicinski authored
    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: 3de0b592 ("ethtool: Support for configurable RSS hash key")
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7195f0ef
ioctl.c 93.4 KB