Avi Kivity
e43299463f
Fix github-flavored markdown
2014-09-11 20:20:27 +03:00
Avi Kivity
2310354c24
Convert to github-flavored markdown
2014-09-11 20:19:06 +03:00
Avi Kivity
178aa39d32
Add README
2014-09-11 20:12:27 +03:00
Avi Kivity
cbcfbf86ca
tcp: don't respond to RST packets
2014-09-11 17:37:34 +03:00
Avi Kivity
b68aa3080e
tcp: send RST packets in network byte order
2014-09-11 17:35:59 +03:00
Avi Kivity
42843b0286
tcp: RST packets not received by any connection
2014-09-11 17:35:24 +03:00
Avi Kivity
663ba971ba
tcp: drop acknowledged packets from send queue
...
Or we keep resending them again and again. That's find for an http server
that keep resending the same reply, but not much else.
2014-09-11 14:46:56 +03:00
Avi Kivity
7c7eebbab4
virtio: fix overzealous vring completion
...
The complete() function loops around, waiting for notifications and
cleaning up the ring when they happen. However, we also call it
opportunistically from produce(), and each time this happens, it starts
another loop in the background, leaking memory.
Fix by splitting complete() into do_complete(), which doesn't loop, and
complete(), which does, and only call do_complete() from the produce() loop.
2014-09-11 13:03:59 +03:00
Avi Kivity
b39ab60a4f
core: allow ignoring SIGINT
...
The debugger doesn't work if we handle SIGINT, so provide a way of not
handling it.
2014-09-11 12:41:35 +03:00
Avi Kivity
8121741973
core: move startup code from reactor constructor to run() method
...
This lets us change things with parameters provided from configure().
2014-09-11 12:23:25 +03:00
Avi Kivity
28e457db92
build: only use tcmalloc in release mode
2014-09-11 12:08:04 +03:00
Avi Kivity
ef0c3dcc7d
arp: reduce console chatter
2014-09-11 11:51:16 +03:00
Avi Kivity
5af55ac975
virtio: fix descriptor leak
...
We only free the first descriptor in a descriptor chain, causing starvation.
Fix by freeing the entire chain.
2014-09-11 11:39:10 +03:00
Avi Kivity
d3fa5996f3
tcp: support local close
...
Queue a FIN and send it if possible.
2014-09-11 11:39:10 +03:00
Avi Kivity
67fc9dfe9a
net: fix eof reporting in native data_source adapter
...
An empty packet signals end-of-stream, which we ignored.
Note the empty packet and report it to the caller.
2014-09-11 11:39:10 +03:00
Avi Kivity
1623d928da
tcp: report foreign FINs to the upper layer
...
This lets the caller know there is no more data.
2014-09-11 11:39:10 +03:00
Avi Kivity
16731cbd39
tcp: fix data segment already fully acknowledged
...
In that case, we trim()med the packet by more than its length, which is bad.
2014-09-10 18:33:59 +03:00
Avi Kivity
8fe20173c2
tcp: improve FIN processing
...
- only accept FINs within the receive window (otherwise RST)
- only process in-order FINs (otherwise drop)
2014-09-10 18:15:54 +03:00
Avi Kivity
e28f87ec8a
tcp: add RST responses
2014-09-10 17:58:09 +03:00
Avi Kivity
b6d85fc6a6
s/the_reactor/engine/g
...
Things named "engine" are 20% faster.
2014-09-10 15:46:33 +03:00
Avi Kivity
e0d7b5f1f6
s/networking/network/
...
Just because.
2014-09-10 15:45:23 +03:00
Avi Kivity
c0f87bbf40
net: fix byte order confusion in listen()
...
posix sockaddr_in gives the port in network byte order.
2014-09-10 15:42:24 +03:00
Avi Kivity
430acf7109
net: set up native network stack correctly
...
Start the interface and set up an IP address.
2014-09-10 15:41:51 +03:00
Avi Kivity
bb26a0c08a
httpd: allow switching network stack
2014-09-10 13:46:54 +03:00
Avi Kivity
e1e85ca5ff
core: allow configuring the network stack
2014-09-10 13:46:25 +03:00
Avi Kivity
82cf2eff7c
sstring: add conversion from std::string
2014-09-10 13:45:54 +03:00
Avi Kivity
1fc5069503
core: add format_separated()
...
For producing nice comma-separated lists.
2014-09-10 13:44:46 +03:00
Avi Kivity
033f941a1c
core: add sprint(fmt, ...)
...
Similar to sprintf(), only type-safe.
2014-09-10 13:44:10 +03:00
Avi Kivity
9c2a31bf0f
core: add networking stack registry
...
The registry allows stacks to name themselves to the core, so that
a networking stack can be selected at startup.
2014-09-10 11:42:33 +03:00
Avi Kivity
5ad3648c4f
sstring: fix assignment operator missing return
2014-09-10 11:36:13 +03:00
Avi Kivity
5630f636cd
net: add protcol stack adapter for native stack
...
This defines adapter classes for converting from the tcp<> class to the
abstractions that applications use.
Still very inefficient due to impedance mismatch between the data types used.
2014-09-10 10:42:21 +03:00
Avi Kivity
509e4e2768
net: add packet move assignment operator
2014-09-10 10:42:05 +03:00
Avi Kivity
c443c2852e
core: add escape accessors from socket_address to posix types
2014-09-10 10:41:23 +03:00
Avi Kivity
96563bbf5b
core: abstract reactor::listen() as a virtual networking_stack method
...
Since every connection (thus far) is established via listen(), this allows
us to abstract the entire stack.
2014-09-09 13:10:03 +03:00
Avi Kivity
1385a5278e
core: get rid of embarassing while () loop in future_state::get()
2014-09-09 12:37:13 +03:00
Avi Kivity
b3b5e1964f
core: switch output_stream to use data_sink instead of pollable_fd
2014-09-09 11:39:39 +03:00
Avi Kivity
7acbae1e5a
core: implement data_sink for posix sockets
2014-09-09 11:38:58 +03:00
Avi Kivity
cdf11e69f9
core: add data_sink abstraction
...
A data_sink is somewhere to send chunks of data, with back-pressure provided
by a future<> that becomes ready when it is okay to push more data.
2014-09-09 11:37:34 +03:00
Avi Kivity
6565909722
s/bsd/posix/
...
"bsd" in this context refers to BSD sockets, but it will be a lot less
confusing to refer to it as a POSIX API.
2014-09-09 09:18:39 +03:00
Avi Kivity
d71ac705a6
core: reactor::run(): cosmetic rearrangement
2014-09-08 21:39:52 +03:00
Avi Kivity
014657eaff
core: switch input_stream to use data_source
...
With this change, input_stream can be used to either the hosted or the native
stack (when it is plugged in).
2014-09-08 21:31:43 +03:00
Avi Kivity
f9084a2085
core: add a few helpers to temporary_buffer
2014-09-08 21:31:11 +03:00
Avi Kivity
2847a1de65
core: add data_source abstraction
...
This is a stream of data arriving in chunks. With a native TCP stack,
it will serve individual buffers as arriving from the network interface and
queued by the TCP stack. With the hosted stack (bsd_data_source_impl),
we unfortunately have to allocate each chunk individually.
2014-09-08 21:29:08 +03:00
Avi Kivity
e5e59dc7c2
temporary_buffer: support for sharing
...
A shared buffer will be destroyed when the last clone is destroyed.
2014-09-08 21:27:07 +03:00
Avi Kivity
6f86186e6d
eclipse: support for lvalue references
2014-09-08 21:22:51 +03:00
Avi Kivity
c14daba9e6
core: exit program by breaking the loop rather than exit()
...
This gives more destructors the option to run, making an easier job for
leak detectors.
2014-09-08 21:21:00 +03:00
Avi Kivity
d06508927e
core: add a share() helper for deleter class
2014-09-08 21:20:25 +03:00
Avi Kivity
2cc4728325
core: fix shared_ptr memory leak
2014-09-08 21:20:00 +03:00
Avi Kivity
be5e75b6a6
core: disable shared_ptr assignments (until implemented)
2014-09-08 21:19:36 +03:00
Avi Kivity
12aba7e9cb
core: fix promise move assignment
...
Leaked if an object was assigned to itself.
2014-09-08 21:00:09 +03:00