public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH net 0/2] ethtool: rss: small fixes to spec and GET
@ 2024-07-24 23:42 Jakub Kicinski
  2024-07-24 23:42 ` [PATCH net 1/2] netlink: specs: correct the spec of ethtool Jakub Kicinski
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jakub Kicinski @ 2024-07-24 23:42 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski

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(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net 1/2] netlink: specs: correct the spec of ethtool
  2024-07-24 23:42 [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Jakub Kicinski
@ 2024-07-24 23:42 ` Jakub Kicinski
  2024-08-11  8:25   ` Kory Maincent
  2024-07-24 23:42 ` [PATCH net 2/2] ethtool: rss: echo the context number back Jakub Kicinski
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2024-07-24 23:42 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, donald.hunter,
	kory.maincent, sdf

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 <kuba@kernel•org>
---
CC: donald.hunter@gmail•com
CC: kory.maincent@bootlin•com
CC: sdf@fomichev•me
---
 Documentation/netlink/specs/ethtool.yaml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index 495e35fcfb21..ebbd8dd96b5c 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -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.
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net 2/2] ethtool: rss: echo the context number back
  2024-07-24 23:42 [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Jakub Kicinski
  2024-07-24 23:42 ` [PATCH net 1/2] netlink: specs: correct the spec of ethtool Jakub Kicinski
@ 2024-07-24 23:42 ` Jakub Kicinski
  2024-08-11  8:27   ` Kory Maincent
  2024-07-25 11:30 ` [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Paolo Abeni
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Jakub Kicinski @ 2024-07-24 23:42 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, donald.hunter,
	kory.maincent, ahmed.zaki, sudheer.mogilappagari

The 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'},
  [...]

Fixes: 7112a04664bf ("ethtool: add netlink based get rss support")
Signed-off-by: Jakub Kicinski <kuba@kernel•org>
---
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: donald.hunter@gmail•com
CC: kory.maincent@bootlin•com
CC: ahmed.zaki@intel•com
CC: sudheer.mogilappagari@intel•com
---
 Documentation/netlink/specs/ethtool.yaml     | 1 +
 Documentation/networking/ethtool-netlink.rst | 1 +
 net/ethtool/rss.c                            | 8 +++++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index ebbd8dd96b5c..ea21fe135b97 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -1757,6 +1757,7 @@ doc: Partial family for Ethtool Netlink.
         reply:
           attributes:
             - header
+            - context
             - hfunc
             - indir
             - hkey
diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst
index 3ab423b80e91..d5f246aceb9f 100644
--- a/Documentation/networking/ethtool-netlink.rst
+++ b/Documentation/networking/ethtool-netlink.rst
@@ -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
diff --git a/net/ethtool/rss.c b/net/ethtool/rss.c
index 71679137eff2..5c4c4505ab9a 100644
--- a/net/ethtool/rss.c
+++ b/net/ethtool/rss.c
@@ -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)) ||
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net 0/2] ethtool: rss: small fixes to spec and GET
  2024-07-24 23:42 [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Jakub Kicinski
  2024-07-24 23:42 ` [PATCH net 1/2] netlink: specs: correct the spec of ethtool Jakub Kicinski
  2024-07-24 23:42 ` [PATCH net 2/2] ethtool: rss: echo the context number back Jakub Kicinski
@ 2024-07-25 11:30 ` Paolo Abeni
  2024-07-25 17:36 ` Joe Damato
  2024-07-25 23:30 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 8+ messages in thread
From: Paolo Abeni @ 2024-07-25 11:30 UTC (permalink / raw)
  To: Jakub Kicinski, davem; +Cc: netdev, edumazet

On 7/25/24 01:42, Jakub Kicinski wrote:
> 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(-)

Acked-by: Paolo Abeni <pabeni@redhat•com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 0/2] ethtool: rss: small fixes to spec and GET
  2024-07-24 23:42 [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Jakub Kicinski
                   ` (2 preceding siblings ...)
  2024-07-25 11:30 ` [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Paolo Abeni
@ 2024-07-25 17:36 ` Joe Damato
  2024-07-25 23:30 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 8+ messages in thread
From: Joe Damato @ 2024-07-25 17:36 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni

On Wed, Jul 24, 2024 at 04:42:47PM -0700, Jakub Kicinski wrote:
> 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(-)

Thanks for fixing this.

Reviewed-by: Joe Damato <jdamato@fastly•com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 0/2] ethtool: rss: small fixes to spec and GET
  2024-07-24 23:42 [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Jakub Kicinski
                   ` (3 preceding siblings ...)
  2024-07-25 17:36 ` Joe Damato
@ 2024-07-25 23:30 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-25 23:30 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel•org>:

On Wed, 24 Jul 2024 16:42:47 -0700 you wrote:
> 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
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 1/2] netlink: specs: correct the spec of ethtool
  2024-07-24 23:42 ` [PATCH net 1/2] netlink: specs: correct the spec of ethtool Jakub Kicinski
@ 2024-08-11  8:25   ` Kory Maincent
  0 siblings, 0 replies; 8+ messages in thread
From: Kory Maincent @ 2024-08-11  8:25 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, donald.hunter, sdf

On Wed, 24 Jul 2024 16:42:48 -0700
Jakub Kicinski <kuba@kernel•org> 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 <kuba@kernel•org>

Reviewed-by: Kory Maincent <kory.maincent@bootlin•com>

-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net 2/2] ethtool: rss: echo the context number back
  2024-07-24 23:42 ` [PATCH net 2/2] ethtool: rss: echo the context number back Jakub Kicinski
@ 2024-08-11  8:27   ` Kory Maincent
  0 siblings, 0 replies; 8+ messages in thread
From: Kory Maincent @ 2024-08-11  8:27 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, netdev, edumazet, pabeni, donald.hunter, ahmed.zaki,
	sudheer.mogilappagari

On Wed, 24 Jul 2024 16:42:49 -0700
Jakub Kicinski <kuba@kernel•org> wrote:

> The 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'},
>   [...]

Reviewed-by: Kory Maincent <kory.maincent@bootlin•com>

-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-08-11  8:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 23:42 [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Jakub Kicinski
2024-07-24 23:42 ` [PATCH net 1/2] netlink: specs: correct the spec of ethtool Jakub Kicinski
2024-08-11  8:25   ` Kory Maincent
2024-07-24 23:42 ` [PATCH net 2/2] ethtool: rss: echo the context number back Jakub Kicinski
2024-08-11  8:27   ` Kory Maincent
2024-07-25 11:30 ` [PATCH net 0/2] ethtool: rss: small fixes to spec and GET Paolo Abeni
2024-07-25 17:36 ` Joe Damato
2024-07-25 23:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox