aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-15 01:08:33 -0800
committerDave Barach <openvpp@barachs.net>2018-01-25 23:53:35 +0000
commitb384b543313b6b47a277c903e9d4fcd4343054fa (patch)
tree1996e3a25eb3a32fe5bbc405d75f38dd041a5a40 /src/vnet/tcp
parent4e578068fc3fe8ba176d211123ddd88962dab315 (diff)
session: add support for memfd segments
- update segment manager and session api to work with both flavors of ssvm segments - added generic ssvm slave/master init and del functions - cleanup/refactor tcp_echo - fixed uses of svm fifo pool as vector Change-Id: Ieee8b163faa407da6e77e657a2322de213a9d2a0 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/builtin_client.c11
-rw-r--r--src/vnet/tcp/builtin_http_server.c6
-rw-r--r--src/vnet/tcp/builtin_proxy.c13
-rw-r--r--src/vnet/tcp/builtin_server.c6
-rwxr-xr-xsrc/vnet/tcp/tcp_debug.h2
-rw-r--r--src/vnet/tcp/tcp_input.c5
6 files changed, 10 insertions, 33 deletions
diff --git a/src/vnet/tcp/builtin_client.c b/src/vnet/tcp/builtin_client.c
index b073459c52e..2784591731e 100644
--- a/src/vnet/tcp/builtin_client.c
+++ b/src/vnet/tcp/builtin_client.c
@@ -296,8 +296,8 @@ create_api_loopback (tclient_main_t * tm)
shmem_hdr = am->shmem_hdr;
tm->vl_input_queue = shmem_hdr->vl_input_queue;
- tm->my_client_index =
- vl_api_memclnt_create_internal ("tcp_test_client", tm->vl_input_queue);
+ tm->my_client_index = vl_api_memclnt_create_internal ("tcp_test_client",
+ tm->vl_input_queue);
return 0;
}
@@ -429,21 +429,16 @@ static clib_error_t *
attach_builtin_test_clients_app (u8 * appns_id, u64 appns_flags,
u64 appns_secret)
{
- u32 segment_name_length, prealloc_fifos, segment_size = 2 << 20;
+ u32 prealloc_fifos, segment_size = 2 << 20;
tclient_main_t *tm = &tclient_main;
vnet_app_attach_args_t _a, *a = &_a;
- u8 segment_name[128];
u64 options[16];
clib_error_t *error = 0;
- segment_name_length = ARRAY_LEN (segment_name);
-
memset (a, 0, sizeof (*a));
memset (options, 0, sizeof (options));
a->api_client_index = tm->my_client_index;
- a->segment_name = segment_name;
- a->segment_name_length = segment_name_length;
a->session_cb_vft = &builtin_clients;
prealloc_fifos = tm->prealloc_fifos ? tm->expected_connections : 1;
diff --git a/src/vnet/tcp/builtin_http_server.c b/src/vnet/tcp/builtin_http_server.c
index 356cfd86b91..5510f8ad34c 100644
--- a/src/vnet/tcp/builtin_http_server.c
+++ b/src/vnet/tcp/builtin_http_server.c
@@ -466,8 +466,7 @@ builtin_session_connected_callback (u32 app_index, u32 api_context,
}
static int
-builtin_add_segment_callback (u32 client_index,
- const u8 * seg_name, u32 seg_size)
+builtin_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
{
clib_warning ("called...");
return -1;
@@ -509,7 +508,6 @@ static int
server_attach ()
{
http_server_main_t *hsm = &http_server_main;
- u8 segment_name[128];
u64 options[APP_OPTIONS_N_OPTIONS];
vnet_app_attach_args_t _a, *a = &_a;
u32 segment_size = 128 << 20;
@@ -530,8 +528,6 @@ server_attach ()
hsm->fifo_size ? hsm->fifo_size : 32 << 10;
a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = hsm->prealloc_fifos;
- a->segment_name = segment_name;
- a->segment_name_length = ARRAY_LEN (segment_name);
if (vnet_application_attach (a))
{
diff --git a/src/vnet/tcp/builtin_proxy.c b/src/vnet/tcp/builtin_proxy.c
index a0a41b91b31..a4827bff56d 100644
--- a/src/vnet/tcp/builtin_proxy.c
+++ b/src/vnet/tcp/builtin_proxy.c
@@ -139,8 +139,7 @@ server_connected_callback (u32 app_index, u32 api_context,
}
static int
-server_add_segment_callback (u32 client_index,
- const u8 * seg_name, u32 seg_size)
+server_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
{
clib_warning ("called...");
return -1;
@@ -382,7 +381,6 @@ static int
server_attach ()
{
builtin_proxy_main_t *bpm = &builtin_proxy_main;
- u8 segment_name[128];
u64 options[APP_OPTIONS_N_OPTIONS];
vnet_app_attach_args_t _a, *a = &_a;
u32 segment_size = 512 << 20;
@@ -404,9 +402,6 @@ server_attach ()
a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
- a->segment_name = segment_name;
- a->segment_name_length = ARRAY_LEN (segment_name);
-
if (vnet_application_attach (a))
{
clib_warning ("failed to attach server");
@@ -422,18 +417,12 @@ active_open_attach (void)
{
builtin_proxy_main_t *bpm = &builtin_proxy_main;
vnet_app_attach_args_t _a, *a = &_a;
- u8 segment_name[128];
- u32 segment_name_length;
u64 options[16];
- segment_name_length = ARRAY_LEN (segment_name);
-
memset (a, 0, sizeof (*a));
memset (options, 0, sizeof (options));
a->api_client_index = bpm->active_open_client_index;
- a->segment_name = segment_name;
- a->segment_name_length = segment_name_length;
a->session_cb_vft = &builtin_clients;
options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
diff --git a/src/vnet/tcp/builtin_server.c b/src/vnet/tcp/builtin_server.c
index eafef8227e2..2ea9068a597 100644
--- a/src/vnet/tcp/builtin_server.c
+++ b/src/vnet/tcp/builtin_server.c
@@ -95,8 +95,7 @@ builtin_session_connected_callback (u32 app_index, u32 api_context,
}
int
-builtin_add_segment_callback (u32 client_index,
- const u8 * seg_name, u32 seg_size)
+builtin_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
{
clib_warning ("called...");
return -1;
@@ -271,7 +270,6 @@ static int
server_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret)
{
builtin_server_main_t *bsm = &builtin_server_main;
- u8 segment_name[128];
u64 options[APP_OPTIONS_N_OPTIONS];
vnet_app_attach_args_t _a, *a = &_a;
u32 segment_size = 512 << 20;
@@ -306,8 +304,6 @@ server_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret)
a->options[APP_OPTIONS_FLAGS] |= appns_flags;
a->options[APP_OPTIONS_NAMESPACE_SECRET] = appns_secret;
}
- a->segment_name = segment_name;
- a->segment_name_length = ARRAY_LEN (segment_name);
if (vnet_application_attach (a))
{
diff --git a/src/vnet/tcp/tcp_debug.h b/src/vnet/tcp/tcp_debug.h
index 5d4f7d6879d..e0db7f4f0fa 100755
--- a/src/vnet/tcp/tcp_debug.h
+++ b/src/vnet/tcp/tcp_debug.h
@@ -19,7 +19,7 @@
#include <vlib/vlib.h>
#define TCP_DEBUG (1)
-#define TCP_DEBUG_SM (0)
+#define TCP_DEBUG_SM (1)
#define TCP_DEBUG_CC (0)
#define TCP_DEBUG_CC_STAT (1)
#define TCP_DEBUG_BUFFER_ALLOCATION (0)
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index b0ea24ff8ef..86bce4895b6 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -2382,6 +2382,7 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
/* Switch state to ESTABLISHED */
tc0->state = TCP_STATE_ESTABLISHED;
+ TCP_EVT_DBG (TCP_EVT_STATE_CHANGE, tc0);
/* Initialize session variables */
tc0->snd_una = vnet_buffer (b0)->tcp.ack_number;
@@ -2389,12 +2390,12 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
<< tc0->rcv_opts.wscale;
tc0->snd_wl1 = vnet_buffer (b0)->tcp.seq_number;
tc0->snd_wl2 = vnet_buffer (b0)->tcp.ack_number;
- stream_session_accept_notify (&tc0->connection);
/* Reset SYN-ACK retransmit and SYN_RCV establish timers */
tcp_retransmit_timer_reset (tc0);
tcp_timer_reset (tc0, TCP_TIMER_ESTABLISH);
- TCP_EVT_DBG (TCP_EVT_STATE_CHANGE, tc0);
+
+ stream_session_accept_notify (&tc0->connection);
break;
case TCP_STATE_ESTABLISHED:
/* We can get packets in established state here because they