]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: ethtool: remove the data argument from ethtool_notify()
authorJakub Kicinski <kuba@kernel.org>
Mon, 23 Jun 2025 23:17:16 +0000 (16:17 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Jun 2025 22:24:14 +0000 (15:24 -0700)
commitf9dc3e52d821dc1f9afeec43fb1c18ac94bd587a
tree4291ec2bff5125ad6394030c9cf1fb7153d3b05a
parent963781bdfe2007e062e05b6b8a263ae9340bd523
net: ethtool: remove the data argument from ethtool_notify()

ethtool_notify() takes a const void *data argument, which presumably
was intended to pass information from the call site to the subcommand
handler. This argument currently has no users.

Expecting the data to be subcommand-specific has two complications.

Complication #1 is that its not plumbed thru any of the standardized
callbacks. It gets propagated to ethnl_default_notify() where it
remains unused. Coming from the ethnl_default_set_doit() side we pass
in NULL, because how could we have a command specific attribute in
a generic handler.

Complication #2 is that we expect the ethtool_notify() callers to
know what attribute type to pass in. Again, the data pointer is
untyped.

RSS will need to pass the context ID to the notifications.
I think it's a better design if the "subcommand" exports its own
typed interface and constructs the appropriate argument struct
(which will be req_info). Remove the unused data argument from
ethtool_notify() but retain it in a new internal helper which
subcommands can use to build a typed interface.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20250623231720.3124717-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h
net/ethtool/ioctl.c
net/ethtool/netlink.c
net/ethtool/netlink.h