Netdev List
 help / color / mirror / Atom feed
* [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; 4+ 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] 4+ 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
  0 siblings, 1 reply; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-08 12:54 [PATCH net v2] net: ethtool: fix missing closing paren in rings_reply_size() Tao Cui
2026-05-12  1:49 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2026-05-08  9:33 [PATCH] " Breno Leitao
2026-05-08 10:04 ` [PATCH net v2] " Tao Cui
2026-05-08 12:07   ` Andrew Lunn

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