Commit Graph

43077 Commits

Author SHA1 Message Date
Avi Kivity
4f83aab5f0 ragel: remove unused variable 2014-09-30 10:43:01 +03:00
Avi Kivity
9cbd099fe5 README, Dockerfile: update for ragel 2014-09-30 09:34:32 +03:00
Avi Kivity
3ea40b2848 core: get rid of input_stream::_scanned
With input_stream::read_until() gone, it's not really needed.
2014-09-29 17:53:04 +03:00
Avi Kivity
cd27c4342d core: drop input_stream::read_until()
Superceded by consume().
2014-09-29 17:41:56 +03:00
Avi Kivity
1472c24533 httpd: replace custom parser with Ragel based parser 2014-09-29 15:17:42 +03:00
Avi Kivity
9b2290228b core: add infrastructure for building Ragel parsers 2014-09-29 15:17:42 +03:00
Avi Kivity
7724a616fd core: add input_stream::consume()
This method, intended for request parsers, receives a stream of temporary
buffers until it determines that parsing is done, at which point it can
return any unconsumed partial buffer back to the input stream.

It is intended as a replacement for read_until(), since it can parse in a
single pass.
2014-09-29 15:17:42 +03:00
Avi Kivity
1f4c063c58 build: make --static option use full static linking (not just libstdc++)
Runing on pre-glibc2.18 hosts (like C7) is impossible without this. The
downside is that the developer has to download, build, and install static
versions of libtcmalloc and libaio.
2014-09-29 15:15:29 +03:00
Gleb Natapov
ca0a0b60e1 smp: Fix smp::submit_to to handle submission to a local cpu
Handle submission to a local cpu by executing a function immediately
and returning ready future.
2014-09-28 14:03:42 +03:00
Gleb Natapov
4c51d387d7 smp: remove debug output 2014-09-28 13:22:05 +03:00
Avi Kivity
9a0d0336b5 virtio: allow tuning the ring size 2014-09-28 11:04:30 +03:00
Asias He
cff8cb353a net: Add netmask option 2014-09-28 10:06:08 +03:00
Asias He
7ab735d3c7 net: Gateway support 2014-09-28 10:05:58 +03:00
Tomasz Grabiec
099c4cfcc2 core: get rid of reactor::_next_timeout
timer_set maintains next timeout so no need to duplicate it.

This also fixes a potential issue, if upon timer expiry no timer is
pending we did not update _next_timeout which will result in timer fd
not being updated upon next arm().
2014-09-25 20:51:57 +03:00
Avi Kivity
ac7b3921f8 README: fix typos in future introduction 2014-09-25 17:58:07 +03:00
Avi Kivity
5c7df1bebc README: update wrt the disappearance of Makefile 2014-09-25 17:57:08 +03:00
Tomasz Grabiec
ec616d7ae5 arp: add missing host-to-network conversion
Caused ARP requests from seastar to be dropped.
2014-09-25 17:54:29 +03:00
Asias He
c5d623265d net: Support ping 2014-09-25 17:49:38 +03:00
Avi Kivity
812fe7b0ae build: remove Makefile 2014-09-25 13:46:53 +03:00
Avi Kivity
24780a8a8a build: move cscope rules to ninja 2014-09-25 13:46:17 +03:00
Avi Kivity
a17d216d03 build: add 'debug' and 'release' targets
Build all artifacts for a build mode.
2014-09-25 13:24:20 +03:00
Asias He
eda11080cb virtio: Check tcp packet using ip_hdr->ip_proto
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2014-09-25 13:06:11 +03:00
Asias He
4bd9f4d49d net: Always check IP header checksum
virtio-net do tcp checksum offload not IP header checksum offload.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
2014-09-25 12:56:53 +03:00
Avi Kivity
8081c4fd18 build: add a way to insert additional compiler flags 2014-09-24 16:18:09 +03:00
Tomasz Grabiec
4f94fc46ce httpd: use app_template 2014-09-24 15:11:35 +03:00
Tomasz Grabiec
1c58e8e45b core: introduce application template 2014-09-24 15:11:35 +03:00
Tomasz Grabiec
1ac98c475f build: add a way to specify the list of build artifacts
If you don't want to build eveything, you can narrow down the list of
artifacts liek this:

 $ ./configure --with tests/test-reactor --with apps/httpd/httpd
2014-09-24 15:11:35 +03:00
Tomasz Grabiec
740e0d59bc build: convert file lists into lists
It's less awkward to concatenate lists than strings. Having files in a
list is less prone to merge conflicts. It also makes the split() call
unnecessary.
2014-09-24 15:11:35 +03:00
Tomasz Grabiec
630d57146c build: add --mode option to configure.py
By default both debug and release binaries are built. It makes the
build take longer than necessary, it's rarely needed to have both
versions during development. To build only one of them, do:

  $ ./configure --mode debug
  $ ninja
2014-09-24 15:11:34 +03:00
Tomasz Grabiec
0141171dae build: make ninja.build depend on configure.py 2014-09-24 15:11:34 +03:00
Gleb Natapov
736b07b2b6 Run http with smp
This patches shows what change is needed for http to run with multiple
event loops. This is not very useful still because actual work is not
yet distributed.
2014-09-24 13:12:38 +03:00
Gleb Natapov
074bc17c71 Stop all smp thread on SIGINT
Execute stop function on all threads on SIGINT. Join them all before
exit.
2014-09-24 13:12:37 +03:00
Gleb Natapov
6253166d0b Extend inter_thread_work_queue to support messaged without return value 2014-09-24 13:12:35 +03:00
Gleb Natapov
0a93385a4d Add smp support
This patch adds an ability to specify how much threads seastart should
spawn. Each thread run its own instance of event loop. Separate
communication channel is created between each pair of threads.
2014-09-24 13:12:33 +03:00
Gleb Natapov
0c7d511858 Allow creation of readable_eventfd from writeable_eventfd and vice-versa
It is needed for two seastart threads to get two sided of the same file
for communication.
2014-09-24 13:12:29 +03:00
Gleb Natapov
a452ede21e Remove unneeded friend declaration 2014-09-24 13:12:24 +03:00
Gleb Natapov
cfbfce3d6d Separate inter_thread_work_queue from thread_pool
Currently thread_pool implements cross-thread communication channel
 internally. Separate communication logic into its own class to
 reuse it for smp communication in later patches.
2014-09-24 13:12:16 +03:00
Asias He
236418d262 net: Support TCP checksum offload
It gives ~5% httpd improvements on monster.

csum-offload option is added, e.g., to disable:

./httpd --network-stack native --csum-offload off
2014-09-24 11:03:39 +03:00
Avi Kivity
0fb796a6c4 tcp: don't store empty packets on unacknowledged queue 2014-09-24 10:54:32 +03:00
Avi Kivity
d7737b34d7 tcp: optimize get_transmit_packets()
Simplify it for the many possible states of the unsent queue:

- empty: return an empty packet
- one small packet: dequeue and return
- one large packet at head: split and return
- many packets, starting with a small one: merge first, split last
2014-09-24 10:52:22 +03:00
Avi Kivity
a1f3708fab packet: optimize sharing
Move reference counting into the deleter core, instead of relegating it
to a shared_deleter (which has to be allocated) and an external reference
counted (also allocated).  This dramatically reduces dynamic allocations.
2014-09-23 18:57:11 +03:00
Avi Kivity
26d713e341 Remove internal_deleter 2014-09-23 18:10:10 +03:00
Avi Kivity
9994e09792 temporary_buffer: stop using internal_deleter
Not much point now since packet doesn't use it.
2014-09-23 18:08:46 +03:00
Avi Kivity
75f07adb69 packet: store header data inside packet itself
Instead of using internal_deleter, which is unwieldy, store the
header data inside packet::impl which we're allocating anyway.

This adds some complication when we need to reallocate impl (if
the number of fragments overflows), but usually saves two allocations:
one for the internal_deleter and one for the data itself.
2014-09-23 18:02:18 +03:00
Avi Kivity
e223f748ec core: great deleter rename
deleter::share() is causing massive amounts of allocation.  First,
since usually a packet's deleter is not a shared_deleter, we need to
allocate that shared_deleter.  Second, we need an external reference
count which requires yet another allocation.

Making reference counting part of the deleter class would solve both of
these problems, but we cannot easily do that, since users hold
std::unique_ptr<deleter> which is clearly not sharable.

We could do a massive s/unique_ptr/shared_ptr/ here, but that would have
the side effect of making sharing "too easy" - you simply copy the pointer.
We'd like to keep it explicit.

So to make the change easier, rename the existing unique_ptr<deleter> as
plain "deleter", whereas the old "deleter" becomes deleter::impl:

  old name              new name
  --------              --------
  deleter               deleter::impl
  unique_ptr<deleter>   deleter

with exactly the same semantics.  A later patch can then add explicit sharing.
2014-09-23 11:15:31 +03:00
Avi Kivity
c096787c8c net: specialize single-fragment data_sink::put() for native stack
Saves a vector allocation and some loops.
2014-09-23 10:37:56 +03:00
Avi Kivity
bca61c198f core: add non-vectored data_sink::put() specialization
Often the caller doesn't have a vector, just a single buffer, so allow
the implementation to optimize for that.
2014-09-23 10:37:56 +03:00
Avi Kivity
e76328b2c9 packet: add zero-copy single-fragment constructor
Useful for converting a temporary_buffer<> into a packet.
2014-09-23 10:37:56 +03:00
Avi Kivity
bddbb3d938 temporary_buffer: add release() method
This allows the caller to take responsibility for deleting the data.

Useful when different data structures use the deleter infrastructure.
2014-09-23 10:37:56 +03:00
Avi Kivity
96cc1440a8 build: disable lto
Too unstable.
2014-09-23 10:37:56 +03:00