RE: [Intel-wired-lan] [PATCH v2 3/4] ice: use bitmap_empty() in ice_vf_has_no_qs_ena
From: Loktionov, Aleksandr
Date: Mon Mar 02 2026 - 02:15:49 EST
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Yury Norov via Intel-wired-lan
> Sent: Monday, March 2, 2026 2:12 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Thomas Hellström
> <thomas.hellstrom@xxxxxxxxxxxxxxx>; Andrew Lunn
> <andrew+netdev@xxxxxxx>; Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>;
> David Airlie <airlied@xxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>;
> Jakub Kicinski <kuba@xxxxxxxxxx>; Brost, Matthew
> <matthew.brost@xxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@xxxxxxxxx>; Vivi, Rodrigo
> <rodrigo.vivi@xxxxxxxxx>; Simona Vetter <simona@xxxxxxxx>; Yury Norov
> <yury.norov@xxxxxxxxx>; Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>;
> dri-devel@xxxxxxxxxxxxxxxxxxxxx; intel-xe@xxxxxxxxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; intel-wired-
> lan@xxxxxxxxxxxxxxxx
> Cc: Yury Norov <ynorov@xxxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>;
> David Laight <david.laight.linux@xxxxxxxxx>
> 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@xxxxxxxxxx>
> ---
> 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@xxxxxxxxx>