diff options
author | 2025-01-21 16:07:28 -0500 | |
---|---|---|
committer | 2025-01-22 20:38:06 +0000 | |
commit | 96b568a495114baccc391ca5030ad159cd082b74 (patch) | |
tree | 4e0c4826e3cadc83f3eb50a71e1cff8b42025089 /src/vnet/session | |
parent | b0761fd464936870a65f8d49eca8daa8215efdf2 (diff) |
session: cleanup io event functions
Program session events using session handles instead of fifos.
Type: improvement
Change-Id: I69063190598c2b4dc1104f2938f27c6cd057341a
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session.c | 10 | ||||
-rw-r--r-- | src/vnet/session/session.h | 6 | ||||
-rw-r--r-- | src/vnet/session/session_node.c | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 1b6e8ce6c6e..2a6ac283fb9 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -83,6 +83,7 @@ session_send_evt_to_thread (void *data, void *args, u32 thread_index, return 0; } +/* Deprecated, use session_program_* functions */ int session_send_io_evt_to_thread (svm_fifo_t * f, session_evt_type_t evt_type) { @@ -90,6 +91,7 @@ session_send_io_evt_to_thread (svm_fifo_t * f, session_evt_type_t evt_type) f->master_thread_index, evt_type); } +/* Deprecated, use session_program_* functions */ int session_send_io_evt_to_thread_custom (void *data, u32 thread_index, session_evt_type_t evt_type) @@ -121,6 +123,14 @@ session_program_rx_io_evt (session_handle_tu_t sh) } int +session_program_transport_io_evt (session_handle_tu_t sh, + session_evt_type_t evt_type) +{ + return session_send_evt_to_thread ((void *) &sh.session_index, 0, + (u32) sh.thread_index, evt_type); +} + +int session_send_ctrl_evt_to_thread (session_t * s, session_evt_type_t evt_type) { /* only events supported are disconnect, shutdown and reset */ diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index 823bdcb02af..daa3bf97f56 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -484,12 +484,16 @@ void session_transport_cleanup (session_t * s); int session_enqueue_notify (session_t *s); int session_dequeue_notify (session_t * s); int session_enqueue_notify_cl (session_t *s); +/* Deprecated, use session_program_* functions */ int session_send_io_evt_to_thread (svm_fifo_t *f, session_evt_type_t evt_type); +/* Deprecated, use session_program_* functions */ int session_send_io_evt_to_thread_custom (void *data, u32 thread_index, session_evt_type_t evt_type); int session_program_tx_io_evt (session_handle_tu_t sh, session_evt_type_t evt_type); int session_program_rx_io_evt (session_handle_tu_t sh); +int session_program_transport_io_evt (session_handle_tu_t sh, + session_evt_type_t evt_type); void session_send_rpc_evt_to_thread (u32 thread_index, void *fp, void *rpc_args); void session_send_rpc_evt_to_thread_force (u32 thread_index, void *fp, @@ -659,7 +663,7 @@ transport_add_tx_event (transport_connection_t * tc) session_t *s = session_get (tc->s_index, tc->thread_index); if (svm_fifo_has_event (s->tx_fifo)) return; - session_send_io_evt_to_thread (s->tx_fifo, SESSION_IO_EVT_TX); + session_program_tx_io_evt (s->handle, SESSION_IO_EVT_TX); } always_inline u32 diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index 1d4f45e073b..dd276cd7854 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -688,7 +688,7 @@ session_mq_worker_update_handler (void *data) * Retransmit messages that may have been lost */ if (s->tx_fifo && !svm_fifo_is_empty (s->tx_fifo)) - session_send_io_evt_to_thread (s->tx_fifo, SESSION_IO_EVT_TX); + session_program_tx_io_evt (s->handle, SESSION_IO_EVT_TX); if (s->rx_fifo && !svm_fifo_is_empty (s->rx_fifo)) app_worker_rx_notify (app_wrk, s); |