gdb: fix 'osv runqueue' on python3

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
bsd: make hash.h includeable from both C and C++ code

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: extract get_clockcycles() declaration to a header

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: reorder fields of struct random_adaptor to match initialization order

This is needed to make initializers using field designators work when
randomdev_soft.c is converted to C++. gcc-4.8 produces an error when
such initializers are used in a different order than the one from
struct definition.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
bsd: C++'ify source files realted to entropy harvesting

These files need to be converted so that a constructor to struct
harvest can be added.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
lockfree: align ring_spsc.emplace() to the STL standard

In STL emplace() constructs an element in place, passing its arguments
to the constructor. This change makes ring_spsc.emplace() and
unordered_ring_mpsc.emplace() behave the same.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
core: move unordered_ring_mpsc.hh form osv/ to lockfree/

That's where all lock-free data structures are now.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
net: kill lltable_drain

It has been #if 0'd in freebsd too. It is dead code. Remove it.

Signed-off-by: Asias He <asias@cloudius-systems.com>
net: kill arp_ifinit2

It is used in sys/netinet/ip_carp.c by CARP[1][2] protocol which we do not
support it now and have very little chance to support it in the future.

[1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/carp.html
[2] http://www.freebsd.org/cgi/man.cgi?query=carp&sektion=4&n=1

Signed-off-by: Asias He <asias@cloudius-systems.com>
Route Cache patch #1

The first patch replaces the calls to the BSD functions in three places
by calls to a new function route_cache::lookup(). lookup() is a new
function which still does the slow lock-full lookup, but the point of
this patch is twofold: 1. To verify that indeed, these three places are
all the lookups done in the fast-path of the UDP memcached and tomcat
benchmarks (other benchmarks may involve more code paths, can be fixed
later).
2. Now lookup() takes care of the locking, and there is no need to
unlock a route after calling it - and the first patch verifies this
movement of the unlock code indeed works as a expected.

Note that this patch defines an invalidate() function but nothing
ever defines it, nor uses it. Once we're confident about the direction
of these two patches, I think it should be pretty straighforward to
implement and call invalidate() on route changes.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Route Cache patch #2

The second patch is starting to rewrite lookup() to have an RCU cache
so the route is first looked up in the cache, and only if it's not there,
look it up in the old slow way (as in the first patch) and add it to the
cache. Instead of using sophisticated radix tree (possibly even BSD's
super-convoluted implementation) for this cache, this patch uses a linear
search of netmasks. If we have a handful of routes (usually we'll just
have two or three), the linear search is fast enough.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
trace_in_lltable_lookup

Signed-off-by: Asias He <asias@cloudius-systems.com>
(cherry picked from commit 8159d6f5d5589705918191b87f8eb8ebd046d17e)
Add trace_arpresolve

Signed-off-by: Asias He <asias@cloudius-systems.com>
lla_lookup_fast

Signed-off-by: Asias He <asias@cloudius-systems.com>
ci