From: Yury Norov <yury.norov@gmail.com>
To: "Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>
Cc: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Intel-wired-lan] [PATCH] i40e: drop useless bitmap_weight() call in i40e_set_rxfh_fields()
Date: Wed, 17 Dec 2025 19:29:29 -0500 [thread overview]
Message-ID: <aUNK6So7KzD3zngt@yury> (raw)
In-Reply-To: <IA3PR11MB89865FF35893188BDF61B7FAE5ABA@IA3PR11MB8986.namprd11.prod.outlook.com>
On Wed, Dec 17, 2025 at 11:37:32AM +0000, Loktionov, Aleksandr wrote:
>
>
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > Of Yury Norov (NVIDIA)
> > Sent: Tuesday, December 16, 2025 1:29 AM
> > To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> > Przemyslaw <przemyslaw.kitszel@intel.com>; Andrew Lunn
> > <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric
> > Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo
> > Abeni <pabeni@redhat.com>; intel-wired-lan@lists.osuosl.org;
> > netdev@vger.kernel.org; linux-kernel@vger.kernel.org
> > Cc: Yury Norov (NVIDIA) <yury.norov@gmail.com>
> > Subject: [Intel-wired-lan] [PATCH] i40e: drop useless bitmap_weight()
> > call in i40e_set_rxfh_fields()
> >
> > bitmap_weight() is O(N) and useless here, because the following
> > for_each_set_bit() returns immediately in case of empty flow_pctypes.
> >
> > Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
> > ---
> > .../net/ethernet/intel/i40e/i40e_ethtool.c | 24 ++++++++----------
> > -
> > 1 file changed, 10 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > index f2c2646ea298..54b0348fdee3 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > @@ -3720,20 +3720,16 @@ static int i40e_set_rxfh_fields(struct
> > net_device *netdev,
> > return -EINVAL;
> > }
> >
> > - if (bitmap_weight(flow_pctypes, FLOW_PCTYPES_SIZE)) {
> > - u8 flow_id;
> > -
> > - for_each_set_bit(flow_id, flow_pctypes,
> > FLOW_PCTYPES_SIZE) {
> > - i_setc = (u64)i40e_read_rx_ctl(hw,
> > I40E_GLQF_HASH_INSET(0, flow_id)) |
> > - ((u64)i40e_read_rx_ctl(hw,
> > I40E_GLQF_HASH_INSET(1, flow_id)) << 32);
> > - i_set = i40e_get_rss_hash_bits(&pf->hw, nfc,
> > i_setc);
> > -
> > - i40e_write_rx_ctl(hw, I40E_GLQF_HASH_INSET(0,
> > flow_id),
> > - (u32)i_set);
> > - i40e_write_rx_ctl(hw, I40E_GLQF_HASH_INSET(1,
> > flow_id),
> > - (u32)(i_set >> 32));
> > - hena |= BIT_ULL(flow_id);
> > - }
> > + for_each_set_bit(flow_id, flow_pctypes, FLOW_PCTYPES_SIZE) {
> You removed the flow_id declaration, but use it in the code below.
> Are you sure it compiles?
No it doesn't. I'll send the right version shortly. Sorry for this
noise.
Thanks,
Yury
next prev parent reply other threads:[~2025-12-18 0:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 0:28 [PATCH] i40e: drop useless bitmap_weight() call in i40e_set_rxfh_fields() Yury Norov (NVIDIA)
2025-12-17 11:37 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-12-18 0:29 ` Yury Norov [this message]
2025-12-17 22:46 ` kernel test robot
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=aUNK6So7KzD3zngt@yury \
--to=yury.norov@gmail.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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