Netdev List
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Tao Cui <cuitao@kylinos.cn>,
	andrew@lunn.ch, kuba@kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com
Cc: horms@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: ethtool: fix missing closing paren in rings_reply_size()
Date: Fri, 8 May 2026 10:30:46 +0100	[thread overview]
Message-ID: <539af15d-3d38-49d9-9023-6b074220149a@linux.dev> (raw)
In-Reply-To: <20260508071402.183909-1-cuitao@kylinos.cn>

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>

  reply	other threads:[~2026-05-08  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=539af15d-3d38-49d9-9023-6b074220149a@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew@lunn.ch \
    --cc=cuitao@kylinos.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox