From: Jakub Kicinski <kuba@kernel.org>
To: Marco Bonelli <marco@mebeim.net>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ethtool: Fix and optimize ethtool_convert_link_mode_to_legacy_u32()
Date: Tue, 24 May 2022 16:21:49 -0700 [thread overview]
Message-ID: <20220524162149.7789df7f@kernel.org> (raw)
In-Reply-To: <20220524223818.259303-1-marco@mebeim.net>
On Wed, 25 May 2022 00:38:19 +0200 Marco Bonelli wrote:
> Fix the implementation of ethtool_convert_link_mode_to_legacy_u32(), which
> is supposed to return false if src has bits higher than 31 set. The current
> implementation uses the complement of bitmap_fill(ext, 32) to test high
> bits of src, which is wrong as bitmap_fill() fills _with long granularity_,
> and sizeof(long) can be > 4. No users of this function currently check the
> return value, so the bug was dormant.
>
> Also remove the check for __ETHTOOL_LINK_MODE_MASK_NBITS > 32, as the enum
> ethtool_link_mode_bit_indices contains far beyond 32 values. Using
> find_next_bit() to test the src bitmask works regardless of this anyway.
>
> Signed-off-by: Marco Bonelli <marco@mebeim.net>
# Form letter - net-next is closed
We have already sent the networking pull request for 5.19
and therefore net-next is closed for new drivers, features,
code refactoring and optimizations. We are currently accepting
bug fixes only.
Please repost when net-next reopens after 5.19-rc1 is cut.
RFC patches sent for review only are obviously welcome at any time.
prev parent reply other threads:[~2022-05-24 23:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 22:38 [PATCH] ethtool: Fix and optimize ethtool_convert_link_mode_to_legacy_u32() Marco Bonelli
2022-05-24 23:21 ` Jakub Kicinski [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=20220524162149.7789df7f@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marco@mebeim.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.