Commit Graph

1208 Commits

Author SHA1 Message Date
Avi Kivity
d0ec99317d net: move some device and qp methods out-of-line 2015-01-22 09:44:44 +02:00
Avi Kivity
5678a0995e net: use a redirection table to forward packets to proxy queues
Build a 128-entry redirection table to select which cpu services which
packet, when we have more cores than queues (and thus need to dispatch
internally).

Add a --hw-queue-weight to control the relative weight of the hardware queue.
With a weight of 0, the core that services the hardware queue will not
process any packets; with a weight of 1 (default) it will process an equal
share of packets, compared to proxy queues.
2015-01-22 09:36:04 +02:00
Avi Kivity
285d4af077 memory: adjust pagemap parsing
The pfn is in bits 0:54 inclusive, we missed the high bit.

Should have no effect in systems with less than a few exabytes of memory.
2015-01-21 19:06:30 +02:00
Asias He
71ac2b5b24 tcp: Rename tcp::send()
Unlike tcp::tcb::send() and tcp::connection::send() which send tcp
packets associated with tcb, tcp::send() only send packets associated
without tcb. We have a bunch of send() functions, rename it to make the
code more readable.
2015-01-21 13:22:40 +02:00
Asias He
917247455c tcp: Use set_exception instead of set_value to notify user on rst 2015-01-21 11:20:06 +02:00
Asias He
8ce7cfd64b tcp: Fix listener port
It is supposed to zero the origin's port.
2015-01-21 11:20:05 +02:00
Avi Kivity
0af3af9d8d Merge branch 'asias/syn_fin_retransmit' of github.com:cloudius-systems/seastar-dev
TCP fixes from Asias, adding SYN/FIN retransmits and handling timeouts around
them.
2015-01-21 10:30:09 +02:00
Asias He
0c09a6bd7a tcp: Return a future for tcp::connect() 2015-01-21 16:20:39 +08:00
Asias He
d6d7e6cb47 tcp: Support syn fin retransmit and timeout
Tested with tcp_server + client.go using iptables dropping <SYN,ACK> or
<FIN,ACK> on client side.

I verified that the SYN or FIN packet is retransmitted and the
connection is closed after N (currently 5) retries.
2015-01-21 16:20:39 +08:00
Asias He
602c7c9c98 tcp: Free packets to be sent on RST 2015-01-21 16:20:39 +08:00
Avi Kivity
fff2920c55 tests: disable address sanitizer alloc/dealloc mismatch test
Generates false positive with new (with_alignment(...)) ...
2015-01-20 12:21:41 +02:00
Avi Kivity
88067922a0 Merge branch 'semaphore'
Add semaphore::broken()
2015-01-20 12:06:53 +02:00
Avi Kivity
2e4122ddd7 futures_test: add broken semaphore test 2015-01-20 11:30:56 +02:00
Avi Kivity
90e77cc3a0 semaphore: support for breaking a semaphore
Tell all waiters that something bad happened and they should all go away.

Can be used only once; waiters should clean up and there must not be any
new waiters.
2015-01-20 11:29:48 +02:00
Avi Kivity
a6dea57f5b semaphore: add missing include 2015-01-20 11:29:26 +02:00
Avi Kivity
4c86eab910 Merge branch 'docker'
Improve docker builds.
2015-01-19 20:16:15 +02:00
Avi Kivity
811fba9bc1 Merge branch 'align'
Aligned allocation facility.
2015-01-19 20:15:51 +02:00
Avi Kivity
b452e33bd1 README: simplify docker build instructions
Run the build command directly in docker, using a shell function, instead
of opening a shell.  Forward the user/group IDs so the build artifacts belong
to the user, not root.
2015-01-19 20:13:32 +02:00
Avi Kivity
1a29177d78 build: add cryptopp, libpciaccess, zlib, and libxml2 to docker installation 2015-01-19 20:13:15 +02:00
Avi Kivity
6e9d4f367d build: move Dockerfile to docker/dev
'docker build' transfers the directory containing Dockerfile to the
container, which can take quite a while with a pre-built environment.
2015-01-19 19:50:15 +02:00
Avi Kivity
93ae11cf63 resource: fix off-by-type getting number of processing units
Effect was to lose hyperthreads on NUMA machines.
2015-01-19 16:11:11 +02:00
Avi Kivity
e0d5bd2fb8 collectd: improve default hostname 2015-01-19 15:58:24 +02:00
Asias He
56f8ba3303 tcp: Clear more when tear down a connection 2015-01-19 13:32:53 +02:00
Avi Kivity
555be6f4bc tests: test aligned allocator 2015-01-19 09:49:32 +02:00
Avi Kivity
45f9c86943 memory: provide C++ facilities for aligned allocation
new (with_alignment(64)) foo(...)   // cache aligned foo
  std::vector<foo, aligned_allocator<foo, 64>> // cached aligned foo vector
2015-01-19 09:49:32 +02:00
Avi Kivity
b22186e623 memory: fix small aligned allocations
When size > align, we simply call the small allocator with the provided size,
but that does not guarantee any alignment above the default.

Round the allocation size to the nearest power of two in that case, to
guarantee alignment.
2015-01-19 09:49:32 +02:00
Gleb Natapov
23b9605fc4 net: fix virtio bulk sending
Zero net_hdr_mrg for each packet, otherwise wrong flags may be used.
2015-01-18 16:23:01 +02:00
Gleb Natapov
4920f309e8 net: fix dpdk bulk sending
_tx_burst_idx may be zero, but _tx_burst still holds packets from the top
of circular_buffer, so avoid refilling in this case.
2015-01-18 16:23:00 +02:00
Vlad Zolotarov
b8185d5afe DPDK: Set rss_bits to correct value if reta_size is not available
rss_bits should be equal to the number of bits HW used in its RSS calculation.
Use dev_info.max_rx_queues if dev_info.reta_size is not available.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-01-18 12:37:19 +02:00
Gleb Natapov
e3915cfcf8 reactor: call pause instruction in idle loop 2015-01-18 12:37:05 +02:00
Gleb Natapov
2ff006da4a core: calculate system load and report it via collectd 2015-01-18 12:37:05 +02:00
Gleb Natapov
1ef2808750 reactor: return proper value from pollers
Currently most of them return true no matter if any work was actually
done. Fix it to return true only if poll did any work.
2015-01-18 12:37:05 +02:00
Avi Kivity
201a9617bf Merge branch 'v2p'
Virtual-to-physical translation, for DMA.  Requires hugetlbfs backed memory.
2015-01-18 10:43:22 +02:00
Don Marti
69a39dbb6c build: Install all RPMs in one command in Dockerfile
Save one intermediate container and a little time.

Signed-off-by: Don Marti <dmarti@cloudius-systems.com>
2015-01-18 10:03:16 +02:00
Gleb Natapov
57bcec15c7 memcached: flush cache during destruction.
Also add assert to item's cancel() function. It cannot be called after
cache is flushed.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
2015-01-15 18:25:30 +02:00
Avi Kivity
80bcf3f973 memory: provide virt-to-phys translation API
Convert virtual addresses to physical addresses.  Only works when
--hugepages is in effect.
2015-01-15 18:23:19 +02:00
Avi Kivity
d77d0cddca posix: implement pread() interface 2015-01-15 18:22:07 +02:00
Takuya ASADA
bbe4d3b7d6 net: implemented SO_REUSEPORT support on UDP
Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-01-15 17:38:06 +02:00
Avi Kivity
ae64fe7d6c Merge branch 'cross-cpu-alloc'
Library-imposed smart pointers, such as std::exception_ptr, may free on
a cpu other than the one they were allocated on.  Unfortunately it is
impossible to wrap std::exception_ptr, since it interacts directly with the
stack unwinder.

Fix by allowing cross-cpu frees.  It's a slow path, so do not abuse.
2015-01-15 15:42:26 +02:00
Avi Kivity
4c3eb49aaf tests: add smp test
Test calling a function, and calling a function that returns an exception.

The second test verifies that cross cpu free works.
2015-01-15 15:19:02 +02:00
Avi Kivity
e746eb7f84 future: fix make_exception_future build error
Add missing std::.
2015-01-15 15:19:02 +02:00
Avi Kivity
311e1c834e future: fix future::then_wrapped() in exception case
Calling state.get() will throw the exception instead of calling the function,
thus denying the called function the chance to deal with the exception.

Fix by constructing the future directly from state.
2015-01-15 15:19:02 +02:00
Avi Kivity
809c6edee2 reactor: periodically call into allocator to drain cross-cpu free items 2015-01-15 15:19:02 +02:00
Avi Kivity
e57be410b5 memory: support cross-cpu freeing
Currently we require that memory be freed on the same cpu it was allocated.
This does not impose difficulties on the user code, since our code is already
smp-unsafe, and so must use message-passing to run the destructor on the
origin cpu, so memory is naturally freed there as well.

However, library code does not run under our assumptions, specifically
std::exception_ptr, which we do transport across cores.

To support this use case, add low-performance support for cross-cpu frees,
using an atomic singly linked list per core.
2015-01-15 15:19:00 +02:00
Avi Kivity
30aa81819a app: handle command line parsing errors 2015-01-15 10:46:44 +02:00
Asias He
f004db89cf tcp: Make tcp_option get_size and fill more readable 2015-01-15 10:31:46 +02:00
Asias He
8ed3584a5e app: Allow -h to show help message
It only supports -help at the moment. It is quite annoying to see:

   $ ./httpd -h
   terminate called after throwing an instance of
   'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::unknown_option> >'
     what():  unrecognised option '-h'
   Aborted

Support both -h and --help.
2015-01-15 10:31:31 +02:00
Gleb Natapov
c6c6c6055d core: add various statistics about smp communication 2015-01-14 16:50:49 +02:00
Gleb Natapov
354280fd7c core: scollectd: use move instead of forward on rvalue reference 2015-01-14 16:50:48 +02:00
Gleb Natapov
340a871a98 core: use seastar shared ptr in scollectd 2015-01-14 16:50:48 +02:00