diff options
author | Florin Coras <fcoras@cisco.com> | 2021-05-07 19:39:43 -0700 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-05-10 20:53:32 +0000 |
commit | ea72764204dac0a1ab6412bc27b758faead2ca10 (patch) | |
tree | d22e849e0e0a84b11c42373c1b97fb6b715d3098 /src/vnet/session/application.h | |
parent | e2272ac27c31b8cf7ecf0ff8d4244f90034a09f4 (diff) |
session: use half-open sessions for vc establishment
Use half-open sessions to track virtual circuit connection
establishment. These sesssions can only be allocated and freed by the
thread that allocates half-open connections (main). Consequently, they
can only be freed on half-open cleanup notifications from transports.
Goal is to simplify state tracking within the session layer but it's
also a first step towards allowing builtin apps to track and cleanup
outstanding connects.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I8a535906d13eb7f8966deb82333839de80f8049f
Diffstat (limited to 'src/vnet/session/application.h')
-rw-r--r-- | src/vnet/session/application.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h index a8ddfec07f5..5beb813655b 100644 --- a/src/vnet/session/application.h +++ b/src/vnet/session/application.h @@ -61,8 +61,8 @@ typedef struct app_worker_ u8 app_is_builtin; - /** Per transport proto hash tables of half-open connection handles */ - uword **half_open_table; + /** Pool of half-open session handles. Tracked in case worker detaches */ + session_handle_t *half_open_table; /** Protects detached seg managers */ clib_spinlock_t detached_seg_managers_lock; @@ -313,13 +313,8 @@ int app_worker_accept_notify (app_worker_t * app_wrk, session_t * s); int app_worker_init_connected (app_worker_t * app_wrk, session_t * s); int app_worker_connect_notify (app_worker_t * app_wrk, session_t * s, session_error_t err, u32 opaque); -int app_worker_add_half_open (app_worker_t * app_wrk, transport_proto_t tp, - session_handle_t ho_handle, - session_handle_t wrk_handle); -int app_worker_del_half_open (app_worker_t * app_wrk, transport_proto_t tp, - session_handle_t ho_handle); -u64 app_worker_lookup_half_open (app_worker_t * app_wrk, transport_proto_t tp, - session_handle_t ho_handle); +int app_worker_add_half_open (app_worker_t *app_wrk, session_handle_t sh); +int app_worker_del_half_open (app_worker_t *app_wrk, u32 ho_index); int app_worker_close_notify (app_worker_t * app_wrk, session_t * s); int app_worker_transport_closed_notify (app_worker_t * app_wrk, session_t * s); |