Skip to content

Commit ea82849

Browse files
kuba-mooNipaLocal
authored andcommitted
net: ethtool: call .parse_request for SET handlers
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 <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent a670c4d commit ea82849

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/ethtool/netlink.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,7 @@ static int ethnl_default_set_doit(struct sk_buff *skb, struct genl_info *info)
878878
if (!req_info)
879879
return -ENOMEM;
880880

881-
ret = ethnl_parse_header_dev_get(req_info, info->attrs[ops->hdr_attr],
882-
genl_info_net(info), info->extack,
883-
true);
881+
ret = ethnl_default_parse(req_info, info, ops, true);
884882
if (ret < 0)
885883
goto out_free_req;
886884

0 commit comments

Comments
 (0)