On 24/12/2013 04:58, Ben Pfaff wrote:
On Wed, Dec 18, 2013 at 05:48:40PM +0800, Alexander Wu wrote:
v5:
No change.
v4.1:
Update bitmap_count1 function: call count_1bits to improve
performance.
v4:
Add bitmap_count1 function to count all 1 bits.
Signed-off-by: Alexander Wu <alexander...@huawei.com>
Acked-by: Ben Pfaff <b...@nicira.com>
Signed-off-by: Ben Pfaff <b...@nicira.com>
Thanks.
I folded in the following changes and will soon apply this to master.
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 655b0a2..51ad5bf 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -94,14 +94,15 @@ bitmap_scan(const unsigned long int *bitmap, size_t start,
size_t end)
return i;
}
+/* Returns the number of 1-bits in the 'n'-bit bitmap at 'bitmap'. */
size_t
-bitmap_count1(const unsigned long int *bitmap, size_t end)
+bitmap_count1(const unsigned long int *bitmap, size_t n)
{
size_t i;
size_t count = 0;
BUILD_ASSERT(ULONG_MAX <= UINT64_MAX);
- for (i = 0; i < BITMAP_N_LONGS(end); i++) {
+ for (i = 0; i < BITMAP_N_LONGS(n); i++) {
count += count_1bits(bitmap[i]);
}
Roger that.
Best regards,
Alexander Wu
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev