diff options
author | Florin Coras <fcoras@cisco.com> | 2019-02-20 19:48:31 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-02-21 12:27:11 +0000 |
commit | dfae9f938f81480995a7ef20a63d016e57dd2899 (patch) | |
tree | b54851bda6d1931b96c0d30f822bf5876b75bca9 /src/vcl/vcl_private.h | |
parent | 565115edf0d6689a3f362c69240c160b49807156 (diff) |
vcl/session: send unlisten over message queue
Change-Id: I68cd6c0e6be3e8088792df3885ae190bb00462b0
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vcl_private.h')
-rw-r--r-- | src/vcl/vcl_private.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h index f77d4479e41..28673bc7602 100644 --- a/src/vcl/vcl_private.h +++ b/src/vcl/vcl_private.h @@ -457,41 +457,35 @@ static inline void vcl_session_table_add_listener (vcl_worker_t * wrk, u64 listener_handle, u32 value) { - /* Session and listener handles have different formats. The latter has - * the thread index in the upper 32 bits while the former has the session - * type. Knowing that, for listeners we just flip the MSB to 1 */ - listener_handle |= 1ULL << 63; hash_set (wrk->session_index_by_vpp_handles, listener_handle, value); } static inline void vcl_session_table_del_listener (vcl_worker_t * wrk, u64 listener_handle) { - listener_handle |= 1ULL << 63; hash_unset (wrk->session_index_by_vpp_handles, listener_handle); } static inline vcl_session_t * -vcl_session_table_lookup_listener (vcl_worker_t * wrk, u64 listener_handle) +vcl_session_table_lookup_listener (vcl_worker_t * wrk, u64 handle) { uword *p; - u64 handle = listener_handle | (1ULL << 63); vcl_session_t *session; p = hash_get (wrk->session_index_by_vpp_handles, handle); if (!p) { - clib_warning ("VCL<%d>: couldn't find listen session: unknown vpp " - "listener handle %llx", getpid (), listener_handle); + VDBG (0, "could not find listen session: unknown vpp listener handle" + " %llx", handle); return 0; } - if (pool_is_free_index (wrk->sessions, p[0])) + session = vcl_session_get (wrk, p[0]); + if (!session) { - VDBG (1, "VCL<%d>: invalid listen session, sid (%u)", getpid (), p[0]); + VDBG (1, "invalid listen session index (%u)", p[0]); return 0; } - session = pool_elt_at_index (wrk->sessions, p[0]); ASSERT (session->session_state & (STATE_LISTEN | STATE_LISTEN_NO_MQ)); return session; } |