summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/builtin_server.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-05-24 18:03:56 -0700
committerDave Barach <openvpp@barachs.net>2017-06-09 16:47:19 +0000
commit93992a9048cb6e5dcd22de5091e72de778122627 (patch)
treef295bb870ad1614d9327828dd036fb03f60e455e /src/vnet/tcp/builtin_server.c
parent583dc8d3e23a780c85ebe48ea59f0338aad4df17 (diff)
Implement sack based tcp loss recovery (RFC 6675)
- refactor existing congestion control code (RFC 6582/5681). Handling of ack feedback now consists of: ack parsing, cc event detection, event handling, congestion control update - extend sack scoreboard to support sack based retransmissions - basic implementation of Eifel detection algorithm (RFC 3522) for detecting spurious retransmissions - actually initialize the per-thread frame freelist hash tables - increase worker stack size to 2mb - fix session queue node out-of-buffer handling - ensure that the local buffer cache vec_len matches reality - avoid 2x spurious event requeues when short of buffers - count out-of-buffer events - make the builtin server thread-safe - fix bihash template threading issue: need to paint -1 across uninitialized working_copy_length vector elements (via rebase from master) Change-Id: I646cb9f1add9a67d08f4a87badbcb117980ebfc4 Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Dave Barach <dbarach@cisco.com>
Diffstat (limited to 'src/vnet/tcp/builtin_server.c')
-rw-r--r--src/vnet/tcp/builtin_server.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/vnet/tcp/builtin_server.c b/src/vnet/tcp/builtin_server.c
index 4f0e211c7be..8bd2f3605e6 100644
--- a/src/vnet/tcp/builtin_server.c
+++ b/src/vnet/tcp/builtin_server.c
@@ -39,7 +39,8 @@
typedef struct
{
- u8 *rx_buf;
+ /* Per-thread RX buffer */
+ u8 **rx_buf;
unix_shared_memory_queue_t **vpp_queue;
u64 byte_index;
@@ -117,13 +118,15 @@ void
test_bytes (builtin_server_main_t * bsm, int actual_transfer)
{
int i;
+ u32 my_thread_id = vlib_get_thread_index ();
for (i = 0; i < actual_transfer; i++)
{
- if (bsm->rx_buf[i] != ((bsm->byte_index + i) & 0xff))
+ if (bsm->rx_buf[my_thread_id][i] != ((bsm->byte_index + i) & 0xff))
{
clib_warning ("at %lld expected %d got %d", bsm->byte_index + i,
- (bsm->byte_index + i) & 0xff, bsm->rx_buf[i]);
+ (bsm->byte_index + i) & 0xff,
+ bsm->rx_buf[my_thread_id][i]);
}
}
bsm->byte_index += actual_transfer;
@@ -138,6 +141,7 @@ builtin_server_rx_callback (stream_session_t * s)
builtin_server_main_t *bsm = &builtin_server_main;
session_fifo_event_t evt;
static int serial_number = 0;
+ u32 my_thread_id = vlib_get_thread_index ();
tx_fifo = s->server_tx_fifo;
rx_fifo = s->server_rx_fifo;
@@ -171,11 +175,12 @@ builtin_server_rx_callback (stream_session_t * s)
return 0;
}
- vec_validate (bsm->rx_buf, max_transfer - 1);
- _vec_len (bsm->rx_buf) = max_transfer;
+ vec_validate (bsm->rx_buf, my_thread_id);
+ vec_validate (bsm->rx_buf[my_thread_id], max_transfer - 1);
+ _vec_len (bsm->rx_buf[my_thread_id]) = max_transfer;
actual_transfer = svm_fifo_dequeue_nowait (rx_fifo, max_transfer,
- bsm->rx_buf);
+ bsm->rx_buf[my_thread_id]);
ASSERT (actual_transfer == max_transfer);
// test_bytes (bsm, actual_transfer);
@@ -184,7 +189,8 @@ builtin_server_rx_callback (stream_session_t * s)
* Echo back
*/
- n_written = svm_fifo_enqueue_nowait (tx_fifo, actual_transfer, bsm->rx_buf);
+ n_written = svm_fifo_enqueue_nowait (tx_fifo, actual_transfer,
+ bsm->rx_buf[my_thread_id]);
if (n_written != max_transfer)
clib_warning ("short trout!");