]> www.infradead.org Git - nvme.git/commit
ethtool: fix the state of additional contexts with old API
authorJakub Kicinski <kuba@kernel.org>
Thu, 25 Jul 2024 22:23:52 +0000 (15:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2024 09:59:08 +0000 (10:59 +0100)
commitdc9755370e1c5965d16dff98c9877f5b1847e367
tree5409f0de7f389232f84ef7ac80bc5a424cea560b
parent7195f0ef7f5b8c678cf28de7c9b619cb908b482c
ethtool: fix the state of additional contexts with old API

We expect drivers implementing the new create/modify/destroy
API to populate the defaults in struct ethtool_rxfh_context.
In legacy API ctx isn't even passed, and rxfh.indir / rxfh.key
are NULL so drivers can't give us defaults even if they want to.
Call get_rxfh() to fetch the values. We can reuse rxfh_dev
for the get_rxfh(), rxfh stores the input from the user.

This fixes IOCTL reporting 0s instead of the default key /
indir table for drivers using legacy API.

Add a check to try to catch drivers using the new API
but not populating the key.

Fixes: 7964e7884643 ("net: ethtool: use the tracking array for get_rxfh on custom RSS contexts")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Edward Cree <ecree.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/ioctl.c