aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-16 22:06:08 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-11-18 12:31:58 +0000
commit57997c8748efd9023759e7270cedbf2124cf8d6e (patch)
tree627573f2b61789ecab49a9418961f81201a0f95c /src/vnet/session/session_node.c
parentfd2f6f89e6610eac6110054b6c9cd190fa4c57e1 (diff)
session tcp: infra for transports to send buffers
Type: feature Add infra that allows transpors to enqueue pending buffers without the need to build and manage their own pending frames. An important benefit is the fact that buffer wire/tx ordering is ensured by session layer. Change-Id: I764fd1693d610b321a1d0c84b648a314f14583db Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit 2a7ea2ee92d6dc4800ee21323d3324a9e8449dcf)
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 824085aecb9..d4470e0b283 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1234,6 +1234,17 @@ session_evt_add_to_list (session_worker_t * wrk, session_event_t * evt)
}
}
+static void
+session_flush_pending_tx_buffers (session_worker_t * wrk,
+ vlib_node_runtime_t * node)
+{
+ vlib_buffer_enqueue_to_next (wrk->vm, node, wrk->pending_tx_buffers,
+ wrk->pending_tx_nexts,
+ vec_len (wrk->pending_tx_nexts));
+ vec_reset_length (wrk->pending_tx_buffers);
+ vec_reset_length (wrk->pending_tx_nexts);
+}
+
static uword
session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
@@ -1339,6 +1350,9 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
};
}
+ if (vec_len (wrk->pending_tx_buffers))
+ session_flush_pending_tx_buffers (wrk, node);
+
vlib_node_increment_counter (vm, session_queue_node.index,
SESSION_QUEUE_ERROR_TX, n_tx_packets);