ethtool: rss: small fixes to spec and GET
Subsystems (5)
Jakub Kicinski
maintainercover ethtool: rss: small fixes to spec and GET
Two small fixes to the ethtool RSS_GET over Netlink. Spec is a bit inaccurate and responses miss an identifier.
Jakub Kicinski (2):
netlink: specs: correct the spec of ethtool
ethtool: rss: echo the context number back
Documentation/netlink/specs/ethtool.yaml | 2 +- Documentation/networking/ethtool-netlink.rst | 1 + net/ethtool/rss.c | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-)
Signature · 1 line
2.45.2
Jakub Kicinski
maintainerPATCH 1/2 netlink: specs: correct the spec of ethtool
The spec for Ethtool is a bit inaccurate. We don't currently support dump. Context is only accepted as input and not echoed to output (which is a separate bug).
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/ethtool.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Documentation/netlink/specs/ethtool.yaml +1 -2
@@ -1753,15 +1753,14 @@ doc: Partial family for Ethtool Netlink. request: attributes: - header + - context reply: attributes: - header - - context - hfunc - indir - hkey - input_xfrm - dump: *rss-get-op - name: plca-get-cfg doc: Get PLCA params.
Signature · 1 line
2.45.2
Re: [PATCH net 1/2] netlink: specs: correct the spec of ethtool
Quoted 6 lines · On Wed, 24 Jul 2024 16:42:48 -0700 Jakub Kicinski <[email protected]> wrote:
The spec for Ethtool is a bit inaccurate. We don't currently support dump. Context is only accepted as input and not echoed to output (which is a separate bug).
Fixes a353318ebf24 ("tools: ynl: populate most of the ethtool spec")Signed-off-by Jakub Kicinski <[email protected]>
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Jakub Kicinski
maintainerPATCH 2/2 ethtool: rss: echo the context number back
In reply to Jakub KicinskiThe response to a GET request in Netlink should fully identify the queried object. RSS_GET accepts context id as an input, so it must echo that attribute back to the response.
After (assuming context 1 has been created):
$ ./cli.py --spec netlink/specs/ethtool.yaml \
--do rss-get \
--json '{"header": {"dev-index": 2}, "context": 1}'
{'context': 1,
'header': {'dev-index': 2, 'dev-name': 'eth0'},
[...]---
Calling this a fix may be a bit up to interpretation. For dumps missing ID would be really bad, but personally I also lean towards fixing it for do already.
---
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
--- Documentation/netlink/specs/ethtool.yaml | 1 + Documentation/networking/ethtool-netlink.rst | 1 + net/ethtool/rss.c | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-)
Documentation/netlink/specs/ethtool.yaml +1 -0
@@ -1757,6 +1757,7 @@ doc: Partial family for Ethtool Netlink. reply: attributes: - header + - context - hfunc - indir - hkey
Documentation/networking/ethtool-netlink.rst +1 -0
@@ -1875,6 +1875,7 @@ RSS context of an interface similar to ``ETHTOOL_GRSSH`` ioctl request. ===================================== ====== ========================== ``ETHTOOL_A_RSS_HEADER`` nested reply header + ``ETHTOOL_A_RSS_CONTEXT`` u32 context number ``ETHTOOL_A_RSS_HFUNC`` u32 RSS hash func ``ETHTOOL_A_RSS_INDIR`` binary Indir table bytes ``ETHTOOL_A_RSS_HKEY`` binary Hash key bytes
net/ethtool/rss.c +7 -1
@@ -111,7 +111,8 @@ rss_reply_size(const struct ethnl_req_info *req_base,const struct rss_reply_data *data =RSS_REPDATA (reply_base);int len; - len =nla_total_size (sizeof (u32)) +/* _RSS_HFUNC */ + len =nla_total_size (sizeof (u32)) +/* _RSS_CONTEXT */ +nla_total_size (sizeof (u32)) +/* _RSS_HFUNC */ nla_total_size (sizeof (u32)) +/* _RSS_INPUT_XFRM */ nla_total_size (sizeof (u32) * data->indir_size) +/* _RSS_INDIR */ nla_total_size (data->hkey_size);/* _RSS_HKEY */
@@ -124,6 +125,11 @@ rss_fill_reply(struct sk_buff *skb, const struct ethnl_req_info *req_base, const struct ethnl_reply_data *reply_base) {const struct rss_reply_data *data =RSS_REPDATA (reply_base); +struct rss_req_info *request =RSS_REQINFO (req_base); + +if (request->rss_context && +nla_put_u32 (skb,ETHTOOL_A_RSS_CONTEXT , request->rss_context)) +return -EMSGSIZE ; if ((data->hfunc && nla_put_u32(skb, ETHTOOL_A_RSS_HFUNC, data->hfunc)) ||
Signature · 1 line
2.45.2
Re: [PATCH net 2/2] ethtool: rss: echo the context number back
Quoted 4 lines · On Wed, 24 Jul 2024 16:42:49 -0700 Jakub Kicinski <[email protected]> wrote:
The response to a GET request in Netlink should fully identify the queried object.
RSS_GETaccepts context id as an input, so it must echo that attribute back to the response.
Quoted 8 lines
After (assuming context 1 has been created):
$ ./cli.py --spec netlink/specs/ethtool.yaml \ --do rss-get \ --json '{"header": {"dev-index": 2}, "context": 1}' {'context': 1, 'header': {'dev-index': 2, 'dev-name': 'eth0'}, [...]
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 11 lines · Jakub Kicinski
Two small fixes to the ethtool
RSS_GETover Netlink. Spec is a bit inaccurate and responses miss an identifier.Jakub Kicinski (2):
netlink: specs: correct the spec of ethtool
ethtool: rss: echo the context number backDocumentation/netlink/specs/ethtool.yaml | 2 +- Documentation/networking/ethtool-netlink.rst | 1 + net/ethtool/rss.c | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-)
Quoted 11 lines · Jakub Kicinski
Two small fixes to the ethtool
RSS_GETover Netlink. Spec is a bit inaccurate and responses miss an identifier.Jakub Kicinski (2):
netlink: specs: correct the spec of ethtool
ethtool: rss: echo the context number backDocumentation/netlink/specs/ethtool.yaml | 2 +- Documentation/networking/ethtool-netlink.rst | 1 + net/ethtool/rss.c | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-)
Thanks for fixing this.
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 24 Jul 2024 16:42:47 -0700 you wrote:
Two small fixes to the ethtool
RSS_GETover Netlink. Spec is a bit inaccurate and responses miss an identifier.Jakub Kicinski (2):
netlink: specs: correct the spec of ethtool
ethtool: rss: echo the context number back[...]
Here is the summary with links:
- [net,1/2] netlink: specs: correct the spec of ethtool
https://git.kernel.org/netdev/net/c/a40c7a24f97e - [net,2/2] ethtool: rss: echo the context number back https://git.kernel.org/netdev/net/c/f96aae91b0d2
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html