All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in qed_roce_stop()
@ 2022-02-15  5:35 Prabhakar Kushwaha
  0 siblings, 0 replies; 2+ messages in thread
From: Prabhakar Kushwaha @ 2022-02-15  5:35 UTC (permalink / raw)
  To: yury.norov, andriy.shevchenko, linux, akpm, mirq-linux, gregkh,
	peterz, David.Laight, joe, dennis, kernel, npiggin,
	matti.vaittinen, aklimov, linux-kernel, Ariel Elior,
	Manish Chopra, davem, kuba, netdev, Alok Prasad

Hi Yury,

> -----Original Message-----
> From: Prabhakar Kushwaha <pkushwaha@marvell.com>
> Sent: Tuesday, February 15, 2022 10:41 AM
> To: Prabhakar Kushwaha <pkushwaha@marvell.com>
> 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@gmail.com
> To:  Yury Norov mailto:yury.norov@gmail.com, Andy Shevchenko
> mailto:andriy.shevchenko@linux.intel.com, Rasmus Villemoes
> mailto:linux@rasmusvillemoes.dk, Andrew Morton mailto:akpm@linux-
> foundation.org, Michał Mirosław mailto:mirq-linux@rere.qmqm.pl, Greg Kroah-
> Hartman mailto:gregkh@linuxfoundation.org, Peter Zijlstra
> mailto:peterz@infradead.org, David Laight mailto:David.Laight@aculab.com,
> Joe Perches mailto:joe@perches.com, Dennis Zhou mailto:dennis@kernel.org,
> Emil Renner Berthing mailto:kernel@esmil.dk, Nicholas Piggin
> mailto:npiggin@gmail.com, Matti Vaittinen
> mailto:matti.vaittinen@fi.rohmeurope.com, Alexey Klimov
> mailto:aklimov@redhat.com, mailto:linux-kernel@vger.kernel.org, Ariel Elior
> mailto:aelior@marvell.com, Manish Chopra mailto:manishc@marvell.com,
> David S. Miller mailto:davem@davemloft.net, Jakub Kicinski
> mailto:kuba@kernel.org, mailto:netdev@vger.kernel.org
> 
> 
> 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@gmail.com
> ---

Acked-by: Prabhakar Kushwaha <pkushwaha@marvell.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in qed_roce_stop()
  2022-02-10 22:48 [PATCH v4 00/49] bitmap: optimize bitmap_weight() usage Yury Norov
@ 2022-02-10 22:48 ` Yury Norov
  0 siblings, 0 replies; 2+ messages in thread
From: Yury Norov @ 2022-02-10 22:48 UTC (permalink / raw)
  To: Yury Norov, Andy Shevchenko, Rasmus Villemoes, Andrew Morton,
	Michał Mirosław, Greg Kroah-Hartman, Peter Zijlstra,
	David Laight, Joe Perches, Dennis Zhou, Emil Renner Berthing,
	Nicholas Piggin, Matti Vaittinen, Alexey Klimov, linux-kernel,
	Ariel Elior, Manish Chopra, David S. Miller, Jakub Kicinski,
	netdev

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 <yury.norov@gmail.com>
---
 drivers/net/ethernet/qlogic/qed/qed_roce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_roce.c b/drivers/net/ethernet/qlogic/qed/qed_roce.c
index 071b4aeaddf2..134ecfca96a3 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_roce.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_roce.c
@@ -76,7 +76,7 @@ void qed_roce_stop(struct qed_hwfn *p_hwfn)
 	 * We delay for a short while if an async destroy QP is still expected.
 	 * Beyond the added delay we clear the bitmap anyway.
 	 */
-	while (bitmap_weight(rcid_map->bitmap, rcid_map->max_count)) {
+	while (!bitmap_empty(rcid_map->bitmap, rcid_map->max_count)) {
 		/* If the HW device is during recovery, all resources are
 		 * immediately reset without receiving a per-cid indication
 		 * from HW. In this case we don't expect the cid bitmap to be
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-15  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15  5:35 [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in qed_roce_stop() Prabhakar Kushwaha
  -- strict thread matches above, loose matches on Subject: below --
2022-02-10 22:48 [PATCH v4 00/49] bitmap: optimize bitmap_weight() usage Yury Norov
2022-02-10 22:48 ` [PATCH 11/49] qed: replace bitmap_weight with bitmap_empty in qed_roce_stop() Yury Norov

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.