diff options
author | Florin Coras <fcoras@cisco.com> | 2021-01-15 13:49:33 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-03-29 20:20:03 +0000 |
commit | 41d5f541d37dc564565b3b29eb370b65bb5a9036 (patch) | |
tree | 49c80b5c140c0693c37a037ef513c62d92c74a7e /src/vnet/session/application.h | |
parent | a840db21e8cce5f27f2a41bd245d59e6aeb8a932 (diff) |
svm session vcl: per app rx message queues
Add option to use per app private segments for app to vpp message
queues, as opposed to exposing internal message queues segment.
When so configured, internal message queues are still polled by the
session queue node but external app message queues are handled by a new
input node (appsl-rx-mqs-input) that runs in interrupt state. Signaling
of the node, when mqs receive new messages, is done through eventfds
epolled by worker epoll input nodes.
Type: feature
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Iffe8ce5a9944a56a14e6d0f492a850cb9e392d16
Diffstat (limited to 'src/vnet/session/application.h')
-rw-r--r-- | src/vnet/session/application.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h index b6f957ab871..0bfd4d1d813 100644 --- a/src/vnet/session/application.h +++ b/src/vnet/session/application.h @@ -92,6 +92,22 @@ typedef struct app_listener_ the app listener */ } app_listener_t; +typedef enum app_rx_mq_flags_ +{ + APP_RX_MQ_F_PENDING = 1 << 0, + APP_RX_MQ_F_POSTPONED = 1 << 1, +} app_rx_mq_flags_t; + +typedef struct app_rx_mq_elt_ +{ + struct app_rx_mq_elt_ *next; + struct app_rx_mq_elt_ *prev; + svm_msg_q_t *mq; + uword file_index; + u32 app_index; + u8 flags; +} app_rx_mq_elt_t; + typedef struct application_ { /** App index in app pool */ @@ -127,8 +143,38 @@ typedef struct application_ char quic_iv[17]; u8 quic_iv_set; + /** Segment where rx mqs were allocated */ + fifo_segment_t rx_mqs_segment; + + /** + * Fixed vector of rx mqs that can be a part of pending_rx_mqs + * linked list maintained by the app sublayer for each worker + */ + app_rx_mq_elt_t *rx_mqs; } application_t; +typedef struct app_rx_mq_handle_ +{ + union + { + struct + { + u32 app_index; + u32 thread_index; + }; + u64 as_u64; + }; +} __attribute__ ((aligned (sizeof (u64)))) app_rx_mq_handle_t; + +/** + * App sublayer per vpp worker state + */ +typedef struct asl_wrk_ +{ + /** Linked list of mqs with pending messages */ + app_rx_mq_elt_t *pending_rx_mqs; +} appsl_wrk_t; + typedef struct app_main_ { /** @@ -155,6 +201,11 @@ typedef struct app_main_ * Last registered crypto engine type */ crypto_engine_type_t last_crypto_engine; + + /** + * App sublayer per-worker state + */ + appsl_wrk_t *wrk; } app_main_t; typedef struct app_init_args_ @@ -239,6 +290,11 @@ segment_manager_props_t *application_get_segment_manager_properties (u32 segment_manager_props_t * application_segment_manager_properties (application_t * app); +svm_msg_q_t *application_rx_mq_get (application_t *app, u32 mq_index); +u8 application_use_private_rx_mqs (void); +fifo_segment_t *application_get_rx_mqs_segment (application_t *app); +void application_enable_rx_mqs_nodes (u8 is_en); + /* * App worker */ |