mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Damato <joe@dama.to>
To: "Björn Töpel" <bjorn@kernel.org>
Cc: Alexander Duyck <alexanderduyck@fb.com>,
	Jakub Kicinski <kuba@kernel.org>,
	kernel-team@meta.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mohsin Bashir <mohsin.bashr@gmail.com>,
	"Mike Marciniszyn (Meta)" <mike.marciniszyn@gmail.com>,
	Sashiko <netdev-bot+sashiko@kernel.org>
Subject: Re: [PATCH net v2] eth: fbnic: Avoid rounding zero ring sizes
Date: Fri, 18 Sep 2026 16:03:32 -0700	[thread overview]
Message-ID: <aq3DRKLjJW+8MmVa@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <20260918114641.1281172-1-bjorn@kernel.org>

On Fri, Sep 18, 2026 at 01:46:40PM +0200, Björn Töpel wrote:
> roundup_pow_of_two() is undefined for zero. ethtool permits a zero ring
> size to reach the driver, where the minimum-size check should reject it.
> 
> Leave zero unchanged while rounding nonzero ring sizes. The minimum-size
> check then rejects zero deterministically without changing the established
> behavior for other values.
> 
> Fixes: 6cbf18a05c06 ("eth: fbnic: support ring size configuration")
> Reported-by: Sashiko <netdev-bot+sashiko@kernel.org>
> Link: https://lore.kernel.org/netdev/178971206933.22033.236948278674126701@kernel.org/
> Suggested-by: Alexander Duyck <alexanderduyck@fb.com>
> Signed-off-by: Björn Töpel <bjorn@kernel.org>
> 
> ---
> v2:
> - Preserve rounding before minimum-size validation for nonzero values;
>   Sashiko found that v1 rejected values which previously rounded up to a
>   valid size.
> ---
>  drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)

Reviewed-by: Joe Damato <joe@dama.to>

      reply	other threads:[~2026-09-18 23:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 11:46 Björn Töpel
2026-09-18 23:03 ` Joe Damato [this message]

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=aq3DRKLjJW+8MmVa@devvm20253.cco0.facebook.com \
    --to=joe@dama.to \
    --cc=alexanderduyck@fb.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bjorn@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.marciniszyn@gmail.com \
    --cc=mohsin.bashr@gmail.com \
    --cc=netdev-bot+sashiko@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

all inboxes | Powered by JetHome®