netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org, donald.hunter@gmail.com,
	maxime.chevallier@bootlin.com, sdf@fomichev.me,
	jdamato@fastly.com, ecree.xilinx@gmail.com,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next v2 3/8] net: ethtool: call .parse_request for SET handlers
Date: Mon, 23 Jun 2025 16:17:15 -0700	[thread overview]
Message-ID: <20250623231720.3124717-4-kuba@kernel.org> (raw)
In-Reply-To: <20250623231720.3124717-1-kuba@kernel.org>

In preparation for using req_info to carry parameters between SET
and NTF - call .parse_request during ethnl_default_set_doit().

The main question here is whether .parse_request is intended to be
GET-specific. Originally the SET handling was delegated to each subcommand
directly - ethnl_default_set_doit() and .set callbacks in ethnl_request_ops
did not exist. Looking at existing users does not shed much light, all
of the following subcommands use .parse_request but have no SET handler
(and no NTF):

  net/ethtool/eeprom.c
  net/ethtool/rss.c
  net/ethtool/stats.c
  net/ethtool/strset.c
  net/ethtool/tsinfo.c

There's only one which does have a SET:

  net/ethtool/pause.c

where .parse_request handling is used to select which statistics to query.
Not relevant for SET but also harmless.

Going back to RSS (which doesn't have SET today) .parse_request parses
the rss_context ID. Using the req_info struct to pass the context ID
from SET to NTF will be very useful.

Switch to ethnl_default_parse(), effectively adding the .parse_request
for SET handlers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 net/ethtool/netlink.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
index a9467b96f00c..c5ec3c82ab2e 100644
--- a/net/ethtool/netlink.c
+++ b/net/ethtool/netlink.c
@@ -878,9 +878,7 @@ static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
 	if (!req_info)
 		return -ENOMEM;
 
-	ret = ethnl_parse_header_dev_get(req_info, info->attrs[ops->hdr_attr],
-					 genl_info_net(info), info->extack,
-					 true);
+	ret = ethnl_default_parse(req_info, info,  ops, true);
 	if (ret < 0)
 		goto out_free_req;
 
-- 
2.49.0


  parent reply	other threads:[~2025-06-23 23:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 23:17 [PATCH net-next v2 0/8] net: ethtool: rss: add notifications Jakub Kicinski
2025-06-23 23:17 ` [PATCH net-next v2 1/8] netlink: specs: add the multicast group name to spec Jakub Kicinski
2025-06-23 23:17 ` [PATCH net-next v2 2/8] net: ethtool: dynamically allocate full req size req Jakub Kicinski
2025-06-24  5:57   ` Maxime Chevallier
2025-06-23 23:17 ` Jakub Kicinski [this message]
2025-06-24  5:57   ` [PATCH net-next v2 3/8] net: ethtool: call .parse_request for SET handlers Maxime Chevallier
2025-06-23 23:17 ` [PATCH net-next v2 4/8] net: ethtool: remove the data argument from ethtool_notify() Jakub Kicinski
2025-06-24  5:56   ` Maxime Chevallier
2025-06-23 23:17 ` [PATCH net-next v2 5/8] net: ethtool: copy req_info from SET to NTF Jakub Kicinski
2025-06-24  5:55   ` Maxime Chevallier
2025-06-23 23:17 ` [PATCH net-next v2 6/8] net: ethtool: rss: add notifications Jakub Kicinski
2025-06-23 23:17 ` [PATCH net-next v2 7/8] doc: ethtool: mark ETHTOOL_GRXFHINDIR as reimplemented Jakub Kicinski
2025-06-25  8:55   ` Donald Hunter
2025-06-23 23:17 ` [PATCH net-next v2 8/8] selftests: drv-net: test RSS Netlink notifications Jakub Kicinski
2025-06-25  9:46   ` Donald Hunter
2025-06-25 20:04     ` Jakub Kicinski
2025-06-25 21:55       ` Donald Hunter
2025-06-24  6:00 ` [PATCH net-next v2 0/8] net: ethtool: rss: add notifications Maxime Chevallier
2025-06-24 14:13   ` Jakub Kicinski
2025-06-25 22:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250623231720.3124717-4-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).