summaryrefslogtreecommitdiffstats
path: root/src/vnet/l2/feat_bitmap.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-05-10 13:40:44 +0200
committerDave Barach <openvpp@barachs.net>2018-05-10 17:16:56 +0000
commit1105600416e0560cb05120a22e0a2e7359a13665 (patch)
treeacf1df08de42344c380473d81886864e662890cf /src/vnet/l2/feat_bitmap.h
parent132dc49ee847a3e3b644de8b36499d73e8a8d37e (diff)
vppinfra: use count_trailing_zeros in sparse_vec_index
It is much cheaper to use ctzll than to do shift,subtract and mask in likely case when we are looking for 1st set bit in the uword. Change-Id: I31954081571978878c7098bafad0c85a91755fa2 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/l2/feat_bitmap.h')
-rw-r--r--src/vnet/l2/feat_bitmap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/l2/feat_bitmap.h b/src/vnet/l2/feat_bitmap.h
index 5940ff7ea9b..a1b295ac4ac 100644
--- a/src/vnet/l2/feat_bitmap.h
+++ b/src/vnet/l2/feat_bitmap.h
@@ -80,7 +80,7 @@ feat_bitmap_get_next_node_index (u32 * next_nodes, u32 bitmap)
{
u32 first_bit;
- count_leading_zeros (first_bit, bitmap);
+ first_bit = count_leading_zeros (bitmap);
first_bit = uword_bits - 1 - first_bit;
return next_nodes[first_bit];
}