session: send tx notification to app

Does some session node cleanup as well

Change-Id: Ifd52b07b28ba4dec1f6f729476decc76eb963837
Signed-off-by: Florin Coras <fcoras@cisco.com>
This commit is contained in:
Florin Coras
2018-06-29 02:02:08 -07:00
committed by Dave Barach
parent fcd23686c4
commit 0d60a0f828
3 changed files with 229 additions and 188 deletions

View File

@ -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.

View File

@ -517,6 +517,7 @@ int session_stream_connect_notify (transport_connection_t * tc, u8 is_fail);
int session_dgram_connect_notify (transport_connection_t * tc,
u32 old_thread_index,
stream_session_t ** new_session);
int session_dequeue_notify (stream_session_t * s);
void stream_session_init_fifos_pointers (transport_connection_t * tc,
u32 rx_pointer, u32 tx_pointer);

File diff suppressed because it is too large Load Diff