summaryrefslogtreecommitdiffstats
path: root/src/vnet/udp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-04-19 13:00:05 -0700
committerDave Barach <openvpp@barachs.net>2017-04-24 12:02:14 +0000
commita5464817522c7a7dc760af4612f1d6a68ed0afc8 (patch)
treec173b6d4e0fac69394d3c1b61a842dc582b2a218 /src/vnet/udp
parentbc66a9122f73b97ca1ae60f1df47b39c141be3ae (diff)
Session layer improvements
Among others: - Moved app event queue to shared memory segment - Use private memory segment for builtin apps - Remove pid from svm fifo - Protect session fifo (de)allocation - Use fifo event for session disconnects - Have session queue node poll in all wk threads Change-Id: I89dbf7fdfebef12f5ef2b34ba3ef3c2c07f49ff2 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/udp')
-rw-r--r--src/vnet/udp/builtin_server.c8
-rw-r--r--src/vnet/udp/udp_input.c5
2 files changed, 7 insertions, 6 deletions
diff --git a/src/vnet/udp/builtin_server.c b/src/vnet/udp/builtin_server.c
index 8565f04c725..18684d54d83 100644
--- a/src/vnet/udp/builtin_server.c
+++ b/src/vnet/udp/builtin_server.c
@@ -59,10 +59,10 @@ builtin_server_rx_callback (stream_session_t * s)
vec_validate (my_copy_buffer, this_transfer - 1);
_vec_len (my_copy_buffer) = this_transfer;
- actual_transfer = svm_fifo_dequeue_nowait (rx_fifo, 0, this_transfer,
+ actual_transfer = svm_fifo_dequeue_nowait (rx_fifo, this_transfer,
my_copy_buffer);
ASSERT (actual_transfer == this_transfer);
- actual_transfer = svm_fifo_enqueue_nowait (tx_fifo, 0, this_transfer,
+ actual_transfer = svm_fifo_enqueue_nowait (tx_fifo, this_transfer,
my_copy_buffer);
ASSERT (actual_transfer == this_transfer);
@@ -72,7 +72,7 @@ builtin_server_rx_callback (stream_session_t * s)
{
/* Fabricate TX event, send to ourselves */
evt.fifo = tx_fifo;
- evt.event_type = FIFO_EVENT_SERVER_TX;
+ evt.event_type = FIFO_EVENT_APP_TX;
evt.event_id = 0;
q = session_manager_get_vpp_event_queue (s->thread_index);
unix_shared_memory_queue_add (q, (u8 *) & evt,
@@ -110,6 +110,8 @@ attach_builtin_uri_server ()
options[SESSION_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
options[SESSION_OPTIONS_SEGMENT_SIZE] = (2 << 30); /*$$$$ config / arg */
+ options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_BUILTIN_APP;
+
a->options = options;
return vnet_application_attach (a);
diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c
index 810278e618f..e6b4f8fcdcb 100644
--- a/src/vnet/udp/udp_input.c
+++ b/src/vnet/udp/udp_input.c
@@ -145,8 +145,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
goto trace0;
}
- svm_fifo_enqueue_nowait (f0, 0 /* pid */ ,
- udp_len0 - sizeof (*udp0),
+ svm_fifo_enqueue_nowait (f0, udp_len0 - sizeof (*udp0),
(u8 *) (udp0 + 1));
b0->error = node->errors[SESSION_ERROR_ENQUEUED];
@@ -255,7 +254,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
{
/* Fabricate event */
evt.fifo = s0->server_rx_fifo;
- evt.event_type = FIFO_EVENT_SERVER_RX;
+ evt.event_type = FIFO_EVENT_APP_RX;
evt.event_id = serial_number++;
/* Add event to server's event queue */