Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: ethtool: fix missing closing paren in rings_reply_size()
@ 2026-05-08  7:14 Tao Cui
  2026-05-08  9:30 ` Vadim Fedorenko
  2026-05-08  9:33 ` Breno Leitao
  0 siblings, 2 replies; 8+ messages in thread
From: Tao Cui @ 2026-05-08  7:14 UTC (permalink / raw)
  To: andrew, kuba, davem, edumazet, pabeni; +Cc: horms, netdev, Tao Cui

sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
parenthesis, causing nla_total_size() to absorb the subsequent
_TX_PUSH and _RX_PUSH entries. The resulting size estimate
happens to be numerically identical due to NLA alignment, but
the nesting is wrong and misleading.

Signed-off-by: Tao Cui <cuitao@kylinos.cn>
---
 net/ethtool/rings.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
index 0fd5dcc3729f..9054c89c5d7b 100644
--- a/net/ethtool/rings.c
+++ b/net/ethtool/rings.c
@@ -63,9 +63,9 @@ static int rings_reply_size(const struct ethnl_req_info *req_base,
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_RX_BUF_LEN */
 	       nla_total_size(sizeof(u8))  +	/* _RINGS_TCP_DATA_SPLIT */
-	       nla_total_size(sizeof(u32)  +	/* _RINGS_CQE_SIZE */
+	       nla_total_size(sizeof(u32)) +	/* _RINGS_CQE_SIZE */
 	       nla_total_size(sizeof(u8))  +	/* _RINGS_TX_PUSH */
-	       nla_total_size(sizeof(u8))) +	/* _RINGS_RX_PUSH */
+	       nla_total_size(sizeof(u8))  +	/* _RINGS_RX_PUSH */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN_MAX */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_HDS_THRESH */
-- 
2.43.0


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

* Re: [PATCH] net: ethtool: fix missing closing paren in rings_reply_size()
  2026-05-08  7:14 [PATCH] net: ethtool: fix missing closing paren in rings_reply_size() Tao Cui
@ 2026-05-08  9:30 ` Vadim Fedorenko
  2026-05-08  9:33 ` Breno Leitao
  1 sibling, 0 replies; 8+ messages in thread
From: Vadim Fedorenko @ 2026-05-08  9:30 UTC (permalink / raw)
  To: Tao Cui, andrew, kuba, davem, edumazet, pabeni; +Cc: horms, netdev

On 08/05/2026 08:14, Tao Cui wrote:
> sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
> parenthesis, causing nla_total_size() to absorb the subsequent
> _TX_PUSH and _RX_PUSH entries. The resulting size estimate
> happens to be numerically identical due to NLA alignment, but
> the nesting is wrong and misleading.
> 
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>
> ---
>   net/ethtool/rings.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
> index 0fd5dcc3729f..9054c89c5d7b 100644
> --- a/net/ethtool/rings.c
> +++ b/net/ethtool/rings.c
> @@ -63,9 +63,9 @@ static int rings_reply_size(const struct ethnl_req_info *req_base,
>   	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX */
>   	       nla_total_size(sizeof(u32)) +	/* _RINGS_RX_BUF_LEN */
>   	       nla_total_size(sizeof(u8))  +	/* _RINGS_TCP_DATA_SPLIT */
> -	       nla_total_size(sizeof(u32)  +	/* _RINGS_CQE_SIZE */
> +	       nla_total_size(sizeof(u32)) +	/* _RINGS_CQE_SIZE */
>   	       nla_total_size(sizeof(u8))  +	/* _RINGS_TX_PUSH */
> -	       nla_total_size(sizeof(u8))) +	/* _RINGS_RX_PUSH */
> +	       nla_total_size(sizeof(u8))  +	/* _RINGS_RX_PUSH */
>   	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN */
>   	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN_MAX */
>   	       nla_total_size(sizeof(u32)) +	/* _RINGS_HDS_THRESH */

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

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

* Re: [PATCH] net: ethtool: fix missing closing paren in rings_reply_size()
  2026-05-08  7:14 [PATCH] net: ethtool: fix missing closing paren in rings_reply_size() Tao Cui
  2026-05-08  9:30 ` Vadim Fedorenko
@ 2026-05-08  9:33 ` Breno Leitao
  2026-05-08 10:04   ` [PATCH net v2] " Tao Cui
  2026-05-08 20:41   ` [PATCH] " Jakub Kicinski
  1 sibling, 2 replies; 8+ messages in thread
From: Breno Leitao @ 2026-05-08  9:33 UTC (permalink / raw)
  To: Tao Cui; +Cc: andrew, kuba, davem, edumazet, pabeni, horms, netdev

On Fri, May 08, 2026 at 03:14:02PM +0800, Tao Cui wrote:
> sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
> parenthesis, causing nla_total_size() to absorb the subsequent
> _TX_PUSH and _RX_PUSH entries. The resulting size estimate
> happens to be numerically identical due to NLA alignment, but
> the nesting is wrong and misleading.
> 
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>

Reviewed-by: Breno Leitao <leitao@debian.org>

Even thought the resulting size is identical, I am wondering if you
should add the Fixes: here. (or target net-next instead).

I think this is a net material, which will require a Fixes: tag.

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

* [PATCH net v2] net: ethtool: fix missing closing paren in rings_reply_size()
  2026-05-08  9:33 ` Breno Leitao
@ 2026-05-08 10:04   ` Tao Cui
  2026-05-08 12:07     ` Andrew Lunn
  2026-05-08 20:41   ` [PATCH] " Jakub Kicinski
  1 sibling, 1 reply; 8+ messages in thread
From: Tao Cui @ 2026-05-08 10:04 UTC (permalink / raw)
  To: leitao, vadim.fedorenko
  Cc: andrew, cuitao, davem, edumazet, horms, kuba, netdev, pabeni

sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
parenthesis, causing nla_total_size() to absorb the subsequent
_TX_PUSH and _RX_PUSH entries. The resulting size estimate
happens to be numerically identical due to NLA alignment, but
the nesting is wrong and misleading.

Fixes: 4dc84c06a343 ("net: ethtool: extend ringparam set/get APIs for tx_push")
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Breno Leitao <leitao@debian.org>
---
v2:
- Added Fixes: tag as suggested by Breno Leitao.
- Added Reviewed-by tags from Vadim Fedorenko and Breno Leitao.
---
 net/ethtool/rings.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
index 0fd5dcc3729f..9054c89c5d7b 100644
--- a/net/ethtool/rings.c
+++ b/net/ethtool/rings.c
@@ -63,9 +63,9 @@ static int rings_reply_size(const struct ethnl_req_info *req_base,
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_RX_BUF_LEN */
 	       nla_total_size(sizeof(u8))  +	/* _RINGS_TCP_DATA_SPLIT */
-	       nla_total_size(sizeof(u32)  +	/* _RINGS_CQE_SIZE */
+	       nla_total_size(sizeof(u32)) +	/* _RINGS_CQE_SIZE */
 	       nla_total_size(sizeof(u8))  +	/* _RINGS_TX_PUSH */
-	       nla_total_size(sizeof(u8))) +	/* _RINGS_RX_PUSH */
+	       nla_total_size(sizeof(u8))  +	/* _RINGS_RX_PUSH */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN_MAX */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_HDS_THRESH */
-- 
2.43.0


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

* Re: [PATCH net v2] net: ethtool: fix missing closing paren in rings_reply_size()
  2026-05-08 10:04   ` [PATCH net v2] " Tao Cui
@ 2026-05-08 12:07     ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2026-05-08 12:07 UTC (permalink / raw)
  To: Tao Cui
  Cc: leitao, vadim.fedorenko, davem, edumazet, horms, kuba, netdev,
	pabeni

On Fri, May 08, 2026 at 06:04:35PM +0800, Tao Cui wrote:
> sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
> parenthesis, causing nla_total_size() to absorb the subsequent
> _TX_PUSH and _RX_PUSH entries. The resulting size estimate
> happens to be numerically identical due to NLA alignment, but
> the nesting is wrong and misleading.
> 
> Fixes: 4dc84c06a343 ("net: ethtool: extend ringparam set/get APIs for tx_push")
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>
> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> Reviewed-by: Breno Leitao <leitao@debian.org>
> ---
> v2:
> - Added Fixes: tag as suggested by Breno Leitao.
> - Added Reviewed-by tags from Vadim Fedorenko and Breno Leitao.

Please always start a new thread for a new version of a
patch. Otherwise the CI/CD system just thinks it is a comment to an
existing patch.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

	Andrew

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

* [PATCH net v2] net: ethtool: fix missing closing paren in rings_reply_size()
@ 2026-05-08 12:54 Tao Cui
  2026-05-12  1:49 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 8+ messages in thread
From: Tao Cui @ 2026-05-08 12:54 UTC (permalink / raw)
  To: andrew, kuba, davem, edumazet, pabeni
  Cc: horms, vadim.fedorenko, leitao, netdev, Tao Cui

sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
parenthesis, causing nla_total_size() to absorb the subsequent
_TX_PUSH and _RX_PUSH entries. The resulting size estimate
happens to be numerically identical due to NLA alignment, but
the nesting is wrong and misleading.

Fixes: 4dc84c06a343 ("net: ethtool: extend ringparam set/get APIs for tx_push")
Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Breno Leitao <leitao@debian.org>
---
v2:
- Added Fixes: tag as suggested by Breno Leitao.
- Added Reviewed-by tags from Vadim Fedorenko and Breno Leitao.
---
 net/ethtool/rings.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ethtool/rings.c b/net/ethtool/rings.c
index 0fd5dcc3729f..9054c89c5d7b 100644
--- a/net/ethtool/rings.c
+++ b/net/ethtool/rings.c
@@ -63,9 +63,9 @@ static int rings_reply_size(const struct ethnl_req_info *req_base,
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_RX_BUF_LEN */
 	       nla_total_size(sizeof(u8))  +	/* _RINGS_TCP_DATA_SPLIT */
-	       nla_total_size(sizeof(u32)  +	/* _RINGS_CQE_SIZE */
+	       nla_total_size(sizeof(u32)) +	/* _RINGS_CQE_SIZE */
 	       nla_total_size(sizeof(u8))  +	/* _RINGS_TX_PUSH */
-	       nla_total_size(sizeof(u8))) +	/* _RINGS_RX_PUSH */
+	       nla_total_size(sizeof(u8))  +	/* _RINGS_RX_PUSH */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_TX_PUSH_BUF_LEN_MAX */
 	       nla_total_size(sizeof(u32)) +	/* _RINGS_HDS_THRESH */
-- 
2.43.0


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

* Re: [PATCH] net: ethtool: fix missing closing paren in rings_reply_size()
  2026-05-08  9:33 ` Breno Leitao
  2026-05-08 10:04   ` [PATCH net v2] " Tao Cui
@ 2026-05-08 20:41   ` Jakub Kicinski
  1 sibling, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2026-05-08 20:41 UTC (permalink / raw)
  To: Breno Leitao; +Cc: Tao Cui, andrew, davem, edumazet, pabeni, horms, netdev

On Fri, 8 May 2026 02:33:28 -0700 Breno Leitao wrote:
> Even thought the resulting size is identical, I am wondering if you
> should add the Fixes: here. (or target net-next instead).

For the record - no and no.
But don't repost this again, please, I'll clean up.

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

* Re: [PATCH net v2] net: ethtool: fix missing closing paren in rings_reply_size()
  2026-05-08 12:54 [PATCH net v2] " Tao Cui
@ 2026-05-12  1:49 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 8+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-12  1:49 UTC (permalink / raw)
  To: Tao Cui
  Cc: andrew, kuba, davem, edumazet, pabeni, horms, vadim.fedorenko,
	leitao, netdev

Hello:

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

On Fri,  8 May 2026 20:54:12 +0800 you wrote:
> sizeof(u32) on the _RINGS_CQE_SIZE line is missing its closing
> parenthesis, causing nla_total_size() to absorb the subsequent
> _TX_PUSH and _RX_PUSH entries. The resulting size estimate
> happens to be numerically identical due to NLA alignment, but
> the nesting is wrong and misleading.
> 
> Fixes: 4dc84c06a343 ("net: ethtool: extend ringparam set/get APIs for tx_push")
> Signed-off-by: Tao Cui <cuitao@kylinos.cn>
> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> Reviewed-by: Breno Leitao <leitao@debian.org>
> 
> [...]

Here is the summary with links:
  - [net,v2] net: ethtool: fix missing closing paren in rings_reply_size()
    https://git.kernel.org/netdev/net-next/c/73d587ae684d

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

end of thread, other threads:[~2026-05-12  1:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08  7:14 [PATCH] net: ethtool: fix missing closing paren in rings_reply_size() Tao Cui
2026-05-08  9:30 ` Vadim Fedorenko
2026-05-08  9:33 ` Breno Leitao
2026-05-08 10:04   ` [PATCH net v2] " Tao Cui
2026-05-08 12:07     ` Andrew Lunn
2026-05-08 20:41   ` [PATCH] " Jakub Kicinski
  -- strict thread matches above, loose matches on Subject: below --
2026-05-08 12:54 [PATCH net v2] " Tao Cui
2026-05-12  1:49 ` 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