aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_sched
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-02-26 09:17:37 +0100
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2019-02-26 09:24:19 +0100
commitaa00ee35bc549d2e1e3662322faa4fca4015a8aa (patch)
treea10fb52c93c9cd5e19925a0749283d06ab17e8dc /lib/librte_sched
parent485c8d32263895c0eefb59d2e070ba5d1e2aab22 (diff)
New upstream version 17.11.5
Change-Id: I4a70f597a4ed8a694e37b7a2a9e623024f6db3e0 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_sched')
-rw-r--r--lib/librte_sched/rte_reciprocal.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/librte_sched/rte_reciprocal.c b/lib/librte_sched/rte_reciprocal.c
index 652f0237..385109cd 100644
--- a/lib/librte_sched/rte_reciprocal.c
+++ b/lib/librte_sched/rte_reciprocal.c
@@ -38,28 +38,13 @@
#include "rte_reciprocal.h"
-/* find largest set bit.
- * portable and slow but does not matter for this usage.
- */
-static inline int fls(uint32_t x)
-{
- int b;
-
- for (b = 31; b >= 0; --b) {
- if (x & (1u << b))
- return b + 1;
- }
-
- return 0;
-}
-
struct rte_reciprocal rte_reciprocal_value(uint32_t d)
{
struct rte_reciprocal R;
uint64_t m;
int l;
- l = fls(d - 1);
+ l = rte_fls_u32(d - 1);
m = ((1ULL << 32) * ((1ULL << l) - d));
m /= d;