aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-05-07 16:28:16 -0700
committerDave Barach <openvpp@barachs.net>2019-05-08 21:15:38 +0000
commit0e573f56dc4986b2f21ffedddb1c5a2424f88b0d (patch)
tree6469c3c3059ce6b55cd0c5f35557dbdaa68cba75 /src/vnet/session/session_node.c
parent1538824a30ab3bb4d651e34ebf077c6958aeb259 (diff)
session: send tx events when data is dequeued
Change-Id: Ib8cb19361c42e38e3f68d7147358378fff161eb1 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 1a04658cb41..067ab585e6f 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -792,6 +792,9 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
else if (svm_fifo_max_dequeue_cons (ctx->s->tx_fifo) > 0)
if (svm_fifo_set_event (ctx->s->tx_fifo))
vec_add1 (wrk->pending_event_vector, *e);
+
+ if (svm_fifo_needs_tx_ntf (ctx->s->tx_fifo, ctx->max_len_to_snd))
+ session_dequeue_notify (ctx->s);
}
return SESSION_TX_OK;
}
@@ -905,9 +908,8 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
for (i = 0; i < n_events; i++)
{
- session_t *s; /* $$$ prefetch 1 ahead maybe */
session_event_t *e;
- u8 need_tx_ntf;
+ session_t *s;
e = &fifo_events[i];
switch (e->event_type)
@@ -933,14 +935,7 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
* different nodes */
rv = (smm->session_tx_fns[s->session_type]) (vm, node, wrk, e,
&n_tx_packets);
- if (PREDICT_TRUE (rv == SESSION_TX_OK))
- {
- need_tx_ntf = svm_fifo_needs_tx_ntf (s->tx_fifo,
- wrk->ctx.max_len_to_snd);
- if (PREDICT_FALSE (need_tx_ntf))
- session_dequeue_notify (s);
- }
- else if (PREDICT_FALSE (rv == SESSION_TX_NO_BUFFERS))
+ if (PREDICT_FALSE (rv == SESSION_TX_NO_BUFFERS))
{
vlib_node_increment_counter (vm, node->node_index,
SESSION_QUEUE_ERROR_NO_BUFFER, 1);