Commit Graph

83 Commits

Author SHA1 Message Date
Pekka Enberg
4dd4fa67c1 configure.py: Fix error hadling when no rule is found
There's a typo in configure.py which causes the "no rule found" handler
to die.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-12 11:24:02 +02:00
Avi Kivity
65d4969504 build: limit link concurrency
The linker can easily overwhelm a desktop, limit linker concurrency to
preserve some interactiveness.
2015-01-08 11:21:04 +02:00
Avi Kivity
c95e452a3a Merge branch 'directory'
Directory listing support, using subscription<sstring> to represent the
stream of file names produced by the directory lister running in parallel
with the directory consumer.
2015-01-08 11:14:52 +02:00
Avi Kivity
4fd5ab936b tests: add directory_test
Lists the current directory, testing open_directory() / list_directory().
2015-01-08 11:09:27 +02:00
Takuya ASADA
46d8b24626 Add tcp_client test
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-08 01:26:36 +09:00
Avi Kivity
27955d47f6 Merge branch 'gleb/nopoll' of github.com:cloudius-systems/seastar-dev
Remove pre-poll-mode code, from Gleb:

"This series moves most of eventfd users to use other form of notification
which can be polled without entering the kernel and moving epoll in its own
poller which is enabled only if there is an fd that needs to be polled."

[avi: add -lrt to linker command line]
2014-12-28 15:34:36 +02:00
Vlad Zolotarov
7ec062e222 dpdk: Move dpdk_eal class into a separate file
- Make it's methods static.
 - Rename dpdk::dpdk_eal -> dpdk::eal

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-22 17:36:42 +02:00
Avi Kivity
ca2c7d8767 memory: abstract mmap() call
To support hugepages, we will need a different mmap() call, so abstract
it out.
2014-12-11 12:25:31 +02:00
Avi Kivity
5b7ebc0f6f build: disable string literal warnings when building with dpdk 2014-12-07 17:34:41 +02:00
Tomasz Grabiec
e831884c13 tests: add zero copy UDP test
It listens for requests on port 10000 and sends responses comprised of
three chunks of data in one packet. The chunk sizes are specified via
the --chunk-size argument.

The reqest can be anything, its content is ignored.

You can switch to equivalent copying version by passing --copy
argument.
2014-12-04 13:51:35 +01:00
Nadav Har'El
8827eb3b27 Clean up link line with DPDK (v2)
The command line linking with DPDK's libraries looked like a cross between
random character generator and black magic. Reading a bit on the DPDK
mailing list, it turns out there is method in this madness (flawed method,
but method nontheless):

1. Instead of using "-l..." they used "-Wl,-l..." everywhere. Turns out
   they did this ugliness to "hide" this option from libtool.

   We don't use libtool, and don't need to hide anything from it.

2. They used "--start-group ... --end-group" to avoid having to figure
   out the right link order.

   It was easy to figure out the right link order and avoid this option.

3. They used "--whole-archive" on all the DPDK libraries. Unfortunately,
   this option *is* needed, because the way DPDK is written, it is not
   suited to be compiled into an (non-shared) library: Each of the DPDK
   drivers ("librte_pmd_*") has a constructor function which needs to
   run to register itself. This works fine with shared libraries (whose
   constructors are run on load) but with a ".a" library, the whole
   library is left out because nothing from the outside refers to any
   of its symbols.

   So what we should do is to use --whole-archive only on the PMD drivers,
   and all will be fully compiled into the generated program. The rest of
   the DPDK libraries will be linked normally, and hopefully because we
   don't use large parts of DPDK, big chunks will not be compiled in.

   If we don't add this "--whole-archive", none of the drivers will be
   compiled into the program, the initialization will not be able to
   find any driver, and just complain there are no ethernet ports.

After this patch, Seastar with DPDK still compiles, and runs.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Reviewed-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-12-01 18:00:14 +02:00
Avi Kivity
78691fc72f app-template: move to a .cc file
Reduce compile loads.
2014-12-01 17:48:18 +02:00
Nadav Har'El
99e18901c1 Fix build with dpdk
With gcc 4.9.2, build with DPDK enabled breaks with error like:

../dpdk-1.7.1/x86_64-native-linuxapp-gcc/include/rte_pci.h:99:37:
warning: invalid suffix on literal; C++11 requires a space between literal
and string macro [-Wliteral-suffix]
 #define PCI_SHORT_PRI_FMT "%.2"PRIx8":%.2"PRIx8".%"PRIx8

The problem is that C++11 outlawed, breaking decades of proud C-preprocessor
tradition, using a macro if stuck to the end of a string. But this used
in DPDK's header files, so we need to turn this error into a warning
(let's keep the warning, hopefully it will disappear in newer versions
of DPDK).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2014-11-30 19:02:10 +02:00
Vlad Zolotarov
93f7cc434d tests: rename virtiotest -> echotest
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-11-30 12:14:58 +02:00
Vlad Zolotarov
5cd984b5cc dpdk: Initial commit
- Currently only a single port and a single queue are supported.
    - All DPDK EAL configuration is hard-coded in the dpdk_net_device constructor instead
      of coming from the app parameters.
    - No offload features are enabled.
    - Tx: will spin in the dpdk_net_device::send() till there is a place in the HW ring to
          place a current packet.
    - Tx: copy data from the `packet` frags into the rte_mbuf's data.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2014-11-30 12:13:52 +02:00
Asias He
fecf47b50a tcp: Defending against sequence number attacks
This patch implements initial sequence number generation algorithm per
RFC6528.
2014-11-26 12:34:16 +02:00
Raphael S. Carvalho
35f37a4235 memcache: generate flashcache
flashcached.cc and memcached.cc files were created to generate
flashcached and memcached respectively through a template parameter.
2014-11-25 09:10:33 -02:00
Raphael S. Carvalho
300b310a27 memcache: move ./memcached.cc to ./memcache.cc
Actual purpose is explained by the subsequent commit.
2014-11-25 09:10:33 -02:00
Tomasz Grabiec
05d89f1ab9 tests: add output_stream_test 2014-11-15 12:11:11 -08:00
Avi Kivity
c52c56ce7b tests: add memory allocation test 2014-11-15 11:56:16 -08:00
Gleb Natapov
2ac24ced66 smp: smp queues idle polling
This patch adds "smp queue polling before going idle" to the reactor.
It allows to avoid signalfd overhead in case receiver thread is not idle
when message is sent. With this patch on top of two other patches from
me that are still waiting to be committed I see 450120 Requests/sec with
wrk and "httpd -c 2 --network-stack native" with native stack. With one
cpu the result is 316002, so we have around 40% scaling. The bottleneck
in this test is cpu 0 which takes 100% cpu time.
2014-11-09 16:26:27 +02:00
Pekka Enberg
86aa399482 net: Fix build when Xen support is disabled
Fixes the following link errors when Xen support is disabled:

build/release/net/native-stack.o: In function `net::add_native_net_options_description(boost::program_options::options_description&)':
/seastar/net/native-stack.cc:101: undefined reference to `get_xenfront_net_options_description()'
build/release/net/native-stack.o: In function `net::create_native_net_device(boost::program_options::variables_map)':
/seastar/net/native-stack.cc:93: undefined reference to `create_xenfront_net_device(boost::program_options::variables_map, bool)'
collect2: error: ld returned 1 exit status

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-11-06 10:24:03 +02:00
Avi Kivity
5052d34d23 Merge branch 'xen'
Partial Xen support.
2014-11-05 15:31:23 +02:00
Glauber Costa
72abe62c4e xenfront basic support
This is the basic support for xenfront. It can be used in domU, provided there
is a network interface to be hijacked.

The code that follows, is just the mechanics of managing the grants, event
channels, etc.

However, it does not yet work: I can't see netback injecting any data into it.
I am still debugging the protocol, but I wanted to flush the current state.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-05 15:09:03 +02:00
Glauber Costa
9fa8124ade xen: evtchn support
This patch enables xen event channels. It creates the placeholder for the
kernel evtchns when we move to OSv as well.

The main problem with this patch, is that evtchn::pending can return more than
one evtchn, so this that I am doing here is technically wrong. We should probably
call keep_doing() in pending() itself, and have that to store the references to
futures equivalent to the possible event channels, that would then be made ready.

I am, however, having a bit of a hard time coding this, since it's still
unclear how, once the future is consumed, we would generate the next.

Please note: All of this is moot if we disable "split event channels", which
can be done by masking that feature in case it is even available. In that case,
only one event channel will be notified, and when ready, we process both tx and
rx. This is yet another reason why I haven't insisted so much in fixing this properly

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-05 15:09:03 +02:00
Glauber Costa
891b40a2af xen: gntalloc device
This patch creates a seastar enabled version of the xen gntalloc device.

TODO: grow the table dynamically, and fix the index selection algorithm. Shouldn't
just always bump 1.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-05 15:09:03 +02:00
Calle Wilund
6d2095e12d net: DHCP
Simple discovery class + usage of it in the native stack init.

DHCP discovery will be default if no other ip options are set on command
line, and not explicitly turned off.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-11-05 14:50:56 +02:00
Asias He
52f2a2b35b tests: Add tcp_sever
Currently, it is a ping/pong sever. When the client sends a ping, the
server responds a pong. We can add more tests to extend.
This is useful for testing TCP_RR.
2014-11-03 09:53:32 +02:00
Glauber Costa
9a86af9543 xen: xenstore communication
This patch enables to interact with xenstore. Since now OSv now fakes the
presence of libxenstore, the code is the same for userspace and kernel.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-02 16:41:19 +02:00
Glauber Costa
5c5a5b8279 build: reorder configure.py
Reorder the file in a way, as to allow the usage of command line switches
in the construction of the compiled objects.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2014-11-02 16:41:19 +02:00
Nadav Har'El
b1964be121 build: add "--with-osv=..." configuration option
Add a "--with-osv=<path>" option to configure.py as a shortcut to
the long list of options needed to compile Seastar for OSv (as
explained in README-OSv)

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2014-10-30 16:47:24 +02:00
Asias He
4717d0bc48 net: Rename stack -> native-stack 2014-10-24 09:14:16 +08:00
Calle Wilund
40db2c0ba1 Collectd 'daemon' module
Per-cpu value list registry with polling -> udp send

- Allows registration of metric values associated with
  collectd id path (plugin/[plugin-inst/]type[/type-instance]).
- Values are broadcast/sent at periodic intervals. (config)
- Config through seastar.conf / app-template.
- Value registration can be revoked safely, either manually or
  through anchor.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2014-10-22 12:01:16 +03:00
Asias He
6561bde964 net: Add TCP option support
Maximum segment size and Window scale option are supported currently.
2014-10-22 10:28:06 +03:00
Pekka Enberg
6723c0cbdd apps/memcache => apps/memcached
The protocol is called the "memcache protocol" but the server should
follow the same naming convention as httpd does.

It should not be a big deal but it annoys the hell out of simple people
like myself who have their brain hard-wired to type the final "d"...

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-10-21 17:30:14 +03:00
Tomasz Grabiec
6a31f3762c tests: memcache: add test for ASCII parser 2014-10-15 15:59:42 +02:00
Tomasz Grabiec
88537320f3 memcache: initial version
Supports UDP and subset of ASCII protocol with the following commands:
get, set and delete.
2014-10-15 15:59:42 +02:00
Tomasz Grabiec
da10ab6443 tests: add sstring tests 2014-10-15 15:50:46 +02:00
Tomasz Grabiec
5f3352b7e3 tests: integrate with BOOST UTF
Asynchronous test cases can be delared using SEASTAR_TEST_CASE macro,
which is equivalent to BOOST_AUTO_TEST_CASE, but the function body is
run inside a reactor and can returns a future<> which resolves when
the test is done.
2014-10-15 15:50:28 +02:00
Raphael S. Carvalho
d7fe901005 tests: add blkdiscard_test
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2014-10-15 12:45:55 +03:00
Gleb Natapov
5b28d5455b build: add libm to the library list
Needed for static compilation with clang.
2014-10-14 10:21:09 +03:00
Avi Kivity
c85e269c99 build: move posix-stack to core
Otherwise, anything that's not linked with net/ has no network stack and
aborts.  net/ is meant for the native stack anyway.
2014-10-14 09:36:32 +03:00
Avi Kivity
7b4ea128fa build: fix default for tristate configs
Should be None, not False, so that notes are emitted if an optional package is
not installed.
2014-10-13 23:23:45 +03:00
Avi Kivity
07a3269809 build: fix warning detection on gcc
gcc ignores -Wno-mismatches-tags even though it is not supported.  Invert
the sense of the warning for the test.
2014-10-13 16:19:19 +03:00
Avi Kivity
e8e9177def build: configurable hwloc support
Allow requiring, disabling, or autodetecting hwloc support.
2014-10-13 15:40:17 +03:00
Avi Kivity
c630bd8171 Merge branch 'numa'
Add -m option for tuning memory size; and use mbind() and pinning so that
a cpu engine accesses local memory, if possible.
2014-10-13 13:07:46 +03:00
Avi Kivity
3397812551 build: disable debug information on clang do to missing support 2014-10-13 11:55:05 +03:00
Avi Kivity
51261a2ff1 build: disable mismatched tags warning 2014-10-13 11:18:06 +03:00
Asias He
d5c8155e00 net: Split posix stack related code to net/posix-stack.cc
NOTE: This patch makes pollable_fd::get_file_desc public in order to
access it in posix_server_socket_impl::accept(). Maybe there is a better
solution. But, fow now, this avoids a lot of including game.
2014-10-13 11:33:57 +08:00
Avi Kivity
2d85ac902f build: disable sanitizers for static builds
Fixes static debug builds.
2014-10-12 19:56:49 +03:00