2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 08:45:23 +00:00

bitmap: Convert single bitmap functions to 64-bit.

Currently the functions to set, clear, and iterate over bitmaps
only operate over 32 bit values. If we convert them to handle
64 bit bitmaps, they can be used in more places.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jesse Gross
2015-06-25 09:18:38 -07:00
parent 099772c025
commit 3ee6026aba
4 changed files with 15 additions and 15 deletions

View File

@@ -390,13 +390,13 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map,
uint32_t c1s[sizeof map * CHAR_BIT];
/* Compute hashes and prefetch 1st buckets. */
ULONG_FOR_EACH_1(i, map) {
ULLONG_FOR_EACH_1(i, map) {
h1s[i] = rehash(impl, hashes[i]);
b1s[i] = &impl->buckets[h1s[i] & impl->mask];
OVS_PREFETCH(b1s[i]);
}
/* Lookups, Round 1. Only look up at the first bucket. */
ULONG_FOR_EACH_1(i, map) {
ULLONG_FOR_EACH_1(i, map) {
uint32_t c1;
const struct cmap_bucket *b1 = b1s[i];
const struct cmap_node *node;
@@ -414,12 +414,12 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map,
continue;
}
/* Found. */
ULONG_SET0(map, i); /* Ignore this on round 2. */
ULLONG_SET0(map, i); /* Ignore this on round 2. */
OVS_PREFETCH(node);
nodes[i] = node;
}
/* Round 2. Look into the 2nd bucket, if needed. */
ULONG_FOR_EACH_1(i, map) {
ULLONG_FOR_EACH_1(i, map) {
uint32_t c2;
const struct cmap_bucket *b2 = b2s[i];
const struct cmap_node *node;
@@ -445,7 +445,7 @@ cmap_find_batch(const struct cmap *cmap, unsigned long map,
}
}
/* Not found. */
ULONG_SET0(result, i); /* Fix the result. */
ULLONG_SET0(result, i); /* Fix the result. */
continue;
}
found: