summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-01 12:41:21 -0800
committerDave Barach <openvpp@barachs.net>2019-03-02 23:39:51 +0000
commitf6c4313b6aa7746fe97afd398ce68c2efbef0600 (patch)
tree72b551a33adf3ae6017ca792c2f4c3a5f05c2477 /src/vnet/session/session.c
parent5fd3210be3a043c12c598df3d75dbe0aa606bfe5 (diff)
session: cleanup session event types
Change-Id: I87bdf705341dd760f0be907a663aa64140977d39 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 36aadcb7c40..97636a7ac8e 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -59,17 +59,17 @@ session_send_evt_to_thread (void *data, void *args, u32 thread_index,
evt->event_type = evt_type;
switch (evt_type)
{
- case FIFO_EVENT_RPC:
+ case SESSION_CTRL_EVT_RPC:
evt->rpc_args.fp = data;
evt->rpc_args.arg = args;
break;
- case FIFO_EVENT_APP_TX:
+ case SESSION_IO_EVT_TX:
case SESSION_IO_EVT_TX_FLUSH:
- case FIFO_EVENT_BUILTIN_RX:
+ case SESSION_IO_EVT_BUILTIN_RX:
evt->fifo = data;
break;
- case FIFO_EVENT_BUILTIN_TX:
- case FIFO_EVENT_DISCONNECT:
+ case SESSION_IO_EVT_BUILTIN_TX:
+ case SESSION_CTRL_EVT_CLOSE:
evt->session_handle = session_handle ((session_t *) data);
break;
default:
@@ -99,16 +99,17 @@ int
session_send_ctrl_evt_to_thread (session_t * s, session_evt_type_t evt_type)
{
/* only event supported for now is disconnect */
- ASSERT (evt_type == FIFO_EVENT_DISCONNECT);
+ ASSERT (evt_type == SESSION_CTRL_EVT_CLOSE);
return session_send_evt_to_thread (s, 0, s->thread_index,
- FIFO_EVENT_DISCONNECT);
+ SESSION_CTRL_EVT_CLOSE);
}
void
session_send_rpc_evt_to_thread (u32 thread_index, void *fp, void *rpc_args)
{
if (thread_index != vlib_get_thread_index ())
- session_send_evt_to_thread (fp, rpc_args, thread_index, FIFO_EVENT_RPC);
+ session_send_evt_to_thread (fp, rpc_args, thread_index,
+ SESSION_CTRL_EVT_RPC);
else
{
void (*fnp) (void *) = fp;
@@ -138,10 +139,10 @@ session_program_transport_close (session_t * s)
vec_add2 (wrk->pending_disconnects, evt, 1);
clib_memset (evt, 0, sizeof (*evt));
evt->session_handle = session_handle (s);
- evt->event_type = FIFO_EVENT_DISCONNECT;
+ evt->event_type = SESSION_CTRL_EVT_CLOSE;
}
else
- session_send_ctrl_evt_to_thread (s, FIFO_EVENT_DISCONNECT);
+ session_send_ctrl_evt_to_thread (s, SESSION_CTRL_EVT_CLOSE);
}
session_t *
@@ -521,18 +522,18 @@ session_enqueue_notify (session_t * s)
/* *INDENT-OFF* */
SESSION_EVT_DBG(SESSION_EVT_ENQ, s, ({
- ed->data[0] = FIFO_EVENT_APP_RX;
+ ed->data[0] = SESSION_IO_EVT_RX;
ed->data[1] = svm_fifo_max_dequeue (s->rx_fifo);
}));
/* *INDENT-ON* */
if (PREDICT_FALSE (app_worker_lock_and_send_event (app_wrk, s,
- FIFO_EVENT_APP_RX)))
+ SESSION_IO_EVT_RX)))
return -1;
if (PREDICT_FALSE (svm_fifo_n_subscribers (s->rx_fifo)))
return session_notify_subscribers (app_wrk->app_index, s,
- s->rx_fifo, FIFO_EVENT_APP_RX);
+ s->rx_fifo, SESSION_IO_EVT_RX);
return 0;
}
@@ -547,12 +548,12 @@ session_dequeue_notify (session_t * s)
return -1;
if (PREDICT_FALSE (app_worker_lock_and_send_event (app_wrk, s,
- FIFO_EVENT_APP_TX)))
+ SESSION_IO_EVT_TX)))
return -1;
if (PREDICT_FALSE (s->tx_fifo->n_subscribers))
return session_notify_subscribers (app_wrk->app_index, s,
- s->tx_fifo, FIFO_EVENT_APP_TX);
+ s->tx_fifo, SESSION_IO_EVT_TX);
svm_fifo_clear_tx_ntf (s->tx_fifo);