aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/svm/svm_fifo.h6
-rw-r--r--src/vnet/session/session_node.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 90a49c03fc1..0d5a08b86ae 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -113,6 +113,12 @@ svm_fifo_max_enqueue (svm_fifo_t * f)
return f->nitems - svm_fifo_max_dequeue (f);
}
+static inline int
+svm_fifo_has_event (svm_fifo_t * f)
+{
+ return f->has_event;
+}
+
static inline u8
svm_fifo_has_ooo_data (svm_fifo_t * f)
{
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index aec353d3367..85fd28db7a9 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -653,6 +653,7 @@ skip_dequeue:
{
stream_session_t *s; /* $$$ prefetch 1 ahead maybe */
session_fifo_event_t *e;
+ u32 to_dequeue;
e = &fifo_events[i];
switch (e->event_type)
@@ -671,6 +672,7 @@ skip_dequeue:
clib_warning ("It's dead, Jim!");
continue;
}
+ to_dequeue = svm_fifo_max_dequeue (s->server_tx_fifo);
/* Spray packets in per session type frames, since they go to
* different nodes */
@@ -678,7 +680,10 @@ skip_dequeue:
&n_tx_packets);
if (PREDICT_TRUE (rv == SESSION_TX_OK))
{
- session_dequeue_notify (s);
+ /* Notify app there's tx space if not polling */
+ if (PREDICT_FALSE (to_dequeue == s->server_tx_fifo->nitems
+ && !svm_fifo_has_event (s->server_tx_fifo)))
+ session_dequeue_notify (s);
}
else if (PREDICT_FALSE (rv == SESSION_TX_NO_BUFFERS))
{