RE: [Intel-wired-lan] [PATCH v2 3/4] ice: use bitmap_empty() in ice_vf_has_no_qs_ena

Romanowski, Rafal
2026-03-27T10:37:33Z

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Loktionov, Aleksandr
> Sent: Monday, March 2, 2026 8:14 AM
> To: Yury Norov <ynorov@nvidia.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; David S. Miller <davem@davemloft.net>;
> Thomas Hellström <thomas.hellstrom@linux.intel.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; Andrew Morton <akpm@linux-foundation.org>;
> David Airlie <airlied@gmail.com>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Brost, Matthew <matthew.brost@intel.com>; Paolo
> Abeni <pabeni@redhat.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>; Simona
> Vetter <simona@ffwll.ch>; Yury Norov <yury.norov@gmail.com>; Rasmus
> Villemoes <linux@rasmusvillemoes.dk>; dri-devel@lists.freedesktop.org; intel-
> xe@lists.freedesktop.org; linux-kernel@vger.kernel.org; netdev@vger.kernel.org;
> intel-wired-lan@lists.osuosl.org
> Cc: Simon Horman <horms@kernel.org>; David Laight
> <david.laight.linux@gmail.com>
> Subject: Re: [Intel-wired-lan] [PATCH v2 3/4] ice: use bitmap_empty() in
> ice_vf_has_no_qs_ena
>
>
>
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > Of Yury Norov via Intel-wired-lan
> > Sent: Monday, March 2, 2026 2:12 AM
> > To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; David S. Miller
> > <davem@davemloft.net>; Thomas Hellström
> > <thomas.hellstrom@linux.intel.com>; Andrew Lunn
> > <andrew+netdev@lunn.ch>; Andrew Morton <akpm@linux-foundation.org>;
> > David Airlie <airlied@gmail.com>; Eric Dumazet <edumazet@google.com>;
> > Jakub Kicinski <kuba@kernel.org>; Brost, Matthew
> > <matthew.brost@intel.com>; Paolo Abeni <pabeni@redhat.com>; Kitszel,
> > Przemyslaw <przemyslaw.kitszel@intel.com>; Vivi, Rodrigo
> > <rodrigo.vivi@intel.com>; Simona Vetter <simona@ffwll.ch>; Yury Norov
> > <yury.norov@gmail.com>; Rasmus Villemoes <linux@rasmusvillemoes.dk>;
> > dri-devel@lists.freedesktop.org; intel-xe@lists.freedesktop.org;
> > linux-kernel@vger.kernel.org; netdev@vger.kernel.org; intel-wired-
> > lan@lists.osuosl.org
> > Cc: Yury Norov <ynorov@nvidia.com>; Simon Horman <horms@kernel.org>;
> > David Laight <david.laight.linux@gmail.com>
> > Subject: [Intel-wired-lan] [PATCH v2 3/4] ice: use bitmap_empty() in
> > ice_vf_has_no_qs_ena
> >
> > bitmap_empty() is more verbose and efficient, as it stops traversing
> > {r,t}xq_ena as soon as the 1st set bit found.
> >
> > Signed-off-by: Yury Norov <ynorov@nvidia.com>
> > ---
> > drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > index c8bc952f05cd..772f6b07340d 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> > @@ -1210,8 +1210,8 @@ bool ice_is_vf_trusted(struct ice_vf *vf)
> > */
> > bool ice_vf_has_no_qs_ena(struct ice_vf *vf) {
> > - return (!bitmap_weight(vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF) &&
> > - !bitmap_weight(vf->txq_ena, ICE_MAX_RSS_QS_PER_VF));
> > + return bitmap_empty(vf->rxq_ena, ICE_MAX_RSS_QS_PER_VF) &&
> > + bitmap_empty(vf->txq_ena, ICE_MAX_RSS_QS_PER_VF);
> > }
> >
> > /**
> > --
> > 2.43.0
>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>

Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>