public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: ynorov@nvidia.com
Cc: Simon Horman <horms@kernel.org>,
	edumazet@google.com, linux@weissschuh.net, andrew+netdev@lunn.ch,
	pabeni@redhat.com, sbhatta@marvell.com, brauner@kernel.org,
	netdev@vger.kernel.org, sdf@fomichev.me, sgoutham@marvell.com,
	kuba@kernel.org, yajun.deng@linux.dev, kuniyu@google.com,
	yury.norov@gmail.com, jerinj@marvell.com, lcherian@marvell.com,
	gakula@marvell.com, linux-kernel@vger.kernel.org,
	davem@davemloft.net
Subject: Re: [1/2] octeontx2-af: siplify rvu_debugfs
Date: Thu,  5 Mar 2026 10:16:41 +0000	[thread overview]
Message-ID: <20260305101641.127065-1-horms@kernel.org> (raw)
In-Reply-To: <20260303185507.111841-2-ynorov@nvidia.com>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
octeontx2-af: siplify rvu_debugfs

The driver uses bitmap_print_to_pagebuf() to store human-readable
bitmaps representations in a temporary buffers; and then feed
seq_printf() with it. Switch to using seq_printf("%*pb") directly
and drop intermediate buffer.

> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> index 413f9fa40b33..cae61c4de47f 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
> @@ -962,30 +962,21 @@ static bool rvu_dbg_is_valid_lf(struct rvu *rvu, int blkaddr, int lf,
>
>  static void print_npa_qsize(struct seq_file *m, struct rvu_pfvf *pfvf)
>  {
> -	char *buf;
> -
> -	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
> -	if (!buf)
> -		return;
> -
>  	if (!pfvf->aura_ctx) {
>  		seq_puts(m, "Aura context is not initialized\n");
>  	} else {
> -		bitmap_print_to_pagebuf(false, buf, pfvf->aura_bmap,
> -					pfvf->aura_ctx->qsize);
>  		seq_printf(m, "Aura count : %d\n", pfvf->aura_ctx->qsize);
> -		seq_printf(m, "Aura context ena/dis bitmap : %s\n", buf);
> +		seq_printf(m, "Aura context ena/dis bitmap : %*pb\n",
> +			   pfvf->aura_ctx->qsize, pfvf->aura_bmap);
>  	}
>
>  	if (!pfvf->pool_ctx) {
>  		seq_puts(m, "Pool context is not initialized\n");
>  	} else {
> -		bitmap_print_to_pagebuf(false, buf, pfvf->pool_bmap,
> -					pfvf->pool_ctx->qsize);
>  		seq_printf(m, "Pool count : %d\n", pfvf->pool_ctx->qsize);
> -		seq_printf(m, "Pool context ena/dis bitmap : %s\n", buf);
> +		seq_printf(m, "Pool context ena/dis bitmap : %*pb\n",
> +			   pfvf->aura_ctx->qsize, pfvf->aura_bmap);
                   ^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^

Does this code have a copy-paste error? The pool context output is
displaying the aura bitmap instead of the pool bitmap.

The old code correctly used pfvf->pool_bmap and pfvf->pool_ctx->qsize:

    bitmap_print_to_pagebuf(false, buf, pfvf->pool_bmap,
                            pfvf->pool_ctx->qsize);

But the new code uses pfvf->aura_bmap and pfvf->aura_ctx->qsize for
both the aura and pool context displays. This makes the pool context
debugfs output show incorrect information.

>  	}
> -	kfree(buf);
>  }

[ ... ]

  reply	other threads:[~2026-03-05 10:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 18:55 [PATCH RESEND 0/2] net: cleanup bitmaps printing Yury Norov
2026-03-03 18:55 ` [PATCH 1/2] octeontx2-af: siplify rvu_debugfs Yury Norov
2026-03-05 10:16   ` Simon Horman [this message]
2026-03-05 14:55   ` Jakub Kicinski
2026-03-03 18:55 ` [PATCH 2/2] net-sysfs: switch xps_queue_show() to sysfs_emit() Yury Norov
2026-03-03 19:16   ` Thomas Weißschuh

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=20260305101641.127065-1-horms@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=brauner@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sdf@fomichev.me \
    --cc=sgoutham@marvell.com \
    --cc=yajun.deng@linux.dev \
    --cc=ynorov@nvidia.com \
    --cc=yury.norov@gmail.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