summaryrefslogtreecommitdiffstats
path: root/vppinfra
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-06-08 01:37:11 +0200
committerDave Barach <openvpp@barachs.net>2016-06-13 20:39:58 +0000
commit0247b4600235bc18e558a7c4267b59be897d714d (patch)
tree3a52c20a43b4c6eee1aaf829b493619106d865c4 /vppinfra
parentc424879b4c01f1a9d9dc3a210454a570178d31a2 (diff)
Add worker-handoff node
worker-handoff node is universal node which taakes packets from the input node and hands them over to worker threads. Currently it supports flow hashing based on ipv4, ipv6 and mpls headers. New cli: set interface handoff <intrerface-name> workers <list> e.g. set interface handoff TenGigabitEthernet2/0/0 workers 3-6,9-10 Change-Id: Iaf0df83e69bb0e84969865e0e1cdb000b0864cf5 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vppinfra')
-rw-r--r--vppinfra/vppinfra/bitmap.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/vppinfra/vppinfra/bitmap.h b/vppinfra/vppinfra/bitmap.h
index e69851b60be..986c322e86c 100644
--- a/vppinfra/vppinfra/bitmap.h
+++ b/vppinfra/vppinfra/bitmap.h
@@ -338,6 +338,26 @@ always_inline uword clib_bitmap_first_set (uword * ai)
return ~0;
}
+/* Return highest numbered set bit in bitmap.
+
+ Return infinity (~0) if bitmap is zero. */
+always_inline uword clib_bitmap_last_set (uword * ai)
+{
+ uword i;
+
+ for (i = vec_len (ai) - 1; i >= 0 ; i--)
+ {
+ uword x = ai[i];
+ if (x != 0)
+ {
+ uword first_bit;
+ count_leading_zeros (first_bit, x);
+ return (i + 1) * BITS (ai[0]) - first_bit - 1;
+ }
+ }
+ return ~0;
+}
+
/* Return lowest numbered clear bit in bitmap. */
always_inline uword
clib_bitmap_first_clear (uword * ai)