RE: [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in qed_roce_stop()

From: Prabhakar Kushwaha
Date: Tue Feb 15 2022 - 00:35:55 EST


Hi Yury,

> -----Original Message-----
> From: Prabhakar Kushwaha <pkushwaha@xxxxxxxxxxx>
> Sent: Tuesday, February 15, 2022 10:41 AM
> To: Prabhakar Kushwaha <pkushwaha@xxxxxxxxxxx>
> Subject: [PATCH 11/49] qed: replace bitmap_weight with
> bitmap_empty in qed_roce_stop()
>
> Subject: [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in
> qed_roce_stop()
> Date: Thu, 10 Feb 2022 14:48:55 -0800
> From: Yury Norov mailto:yury.norov@xxxxxxxxx
> To: Yury Norov mailto:yury.norov@xxxxxxxxx, Andy Shevchenko
> mailto:andriy.shevchenko@xxxxxxxxxxxxxxx, Rasmus Villemoes
> mailto:linux@xxxxxxxxxxxxxxxxxx, Andrew Morton mailto:akpm@linux-
> foundation.org, Michał Mirosław mailto:mirq-linux@xxxxxxxxxxxx, Greg Kroah-
> Hartman mailto:gregkh@xxxxxxxxxxxxxxxxxxx, Peter Zijlstra
> mailto:peterz@xxxxxxxxxxxxx, David Laight mailto:David.Laight@xxxxxxxxxx,
> Joe Perches mailto:joe@xxxxxxxxxxx, Dennis Zhou mailto:dennis@xxxxxxxxxx,
> Emil Renner Berthing mailto:kernel@xxxxxxxx, Nicholas Piggin
> mailto:npiggin@xxxxxxxxx, Matti Vaittinen
> mailto:matti.vaittinen@xxxxxxxxxxxxxxxxx, Alexey Klimov
> mailto:aklimov@xxxxxxxxxx, mailto:linux-kernel@xxxxxxxxxxxxxxx, Ariel Elior
> mailto:aelior@xxxxxxxxxxx, Manish Chopra mailto:manishc@xxxxxxxxxxx,
> David S. Miller mailto:davem@xxxxxxxxxxxxx, Jakub Kicinski
> mailto:kuba@xxxxxxxxxx, mailto:netdev@xxxxxxxxxxxxxxx
>
>
> qed_roce_stop() calls bitmap_weight() to check if any bit of a given
> bitmap is set. We can do it more efficiently with bitmap_empty() because
> bitmap_empty() stops traversing the bitmap as soon as it finds first set
> bit, while bitmap_weight() counts all bits unconditionally.
>
> Signed-off-by: Yury Norov mailto:yury.norov@xxxxxxxxx
> ---

Acked-by: Prabhakar Kushwaha <pkushwaha@xxxxxxxxxxx>