summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-06-29 02:02:08 -0700
committerDave Barach <openvpp@barachs.net>2018-06-30 13:49:35 +0000
commit0d60a0f8280fa7c902230a38956b1653e1ec7f3e (patch)
tree4e64a7c57db1d1b65636befb421ce2dd2b6b6647 /src/vnet/session/session.c
parentfcd23686c4c5bed8066ea902e0bc1489c0a50daf (diff)
session: send tx notification to app
Does some session node cleanup as well Change-Id: Ifd52b07b28ba4dec1f6f729476decc76eb963837 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 6559e318ca8..e486c2b0326 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -503,6 +503,32 @@ session_enqueue_notify (stream_session_t * s, u8 block)
return 0;
}
+int
+session_dequeue_notify (stream_session_t * s)
+{
+ application_t *app;
+ svm_queue_t *q;
+
+ app = application_get (s->app_index);
+ if (application_is_builtin (app))
+ return 0;
+
+ q = app->event_queue;
+ if (PREDICT_TRUE (q->cursize < q->maxsize))
+ {
+ session_fifo_event_t evt = {
+ .event_type = FIFO_EVENT_APP_TX,
+ .fifo = s->server_tx_fifo
+ };
+ svm_queue_add (app->event_queue, (u8 *) & evt, SVM_Q_WAIT);
+ }
+ else
+ {
+ return -1;
+ }
+ return 0;
+}
+
/**
* Flushes queue of sessions that are to be notified of new data
* enqueued events.