diff options
author | Florin Coras <fcoras@cisco.com> | 2019-07-21 19:23:46 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2019-07-26 16:18:50 -0700 |
commit | b0ffbee67bd17f6880a02184d18cd94156f2389e (patch) | |
tree | eab9dd3411306b963d891ad5ea40aaf49cf52139 /src/vnet/session/session.h | |
parent | 1f42101f2708452301c62ff2e07eaaad3bbcd31a (diff) |
session: separate ctrl, new and old events
Type: feature
Change-Id: I5e030b23943c012d8191ff657165055d33ec87a2
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.h')
-rw-r--r-- | src/vnet/session/session.h | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index 8f7bd6c999c..5af824ade60 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -96,18 +96,15 @@ typedef struct session_worker_ /** Pool of session event list elements */ session_evt_elt_t *event_elts; + /** Head of control events list */ + clib_llist_index_t ctrl_head; + /** Head of list of elements */ clib_llist_index_t new_head; /** Head of list of pending events */ clib_llist_index_t old_head; - /** Head of list of postponed events */ - clib_llist_index_t postponed_head; - - /** Head of list of disconnect events */ - clib_llist_index_t disconnects_head; - /** Peekers rw lock */ clib_rwlock_t peekers_rw_locks; @@ -203,44 +200,21 @@ session_evt_elt_free (session_worker_t * wrk, session_evt_elt_t * elt) pool_put (wrk->event_elts, elt); } -static inline session_evt_elt_t * -session_evt_old_head (session_worker_t * wrk) -{ - return pool_elt_at_index (wrk->event_elts, wrk->old_head); -} - -static inline session_evt_elt_t * -session_evt_postponed_head (session_worker_t * wrk) -{ - return pool_elt_at_index (wrk->event_elts, wrk->postponed_head); -} - -static inline session_evt_elt_t * -session_evt_pending_disconnects_head (session_worker_t * wrk) -{ - return pool_elt_at_index (wrk->event_elts, wrk->disconnects_head); -} - static inline void session_evt_add_old (session_worker_t * wrk, session_evt_elt_t * elt) { clib_llist_add_tail (wrk->event_elts, evt_list, elt, - session_evt_old_head (wrk)); -} - -static inline void -session_evt_add_postponed (session_worker_t * wrk, session_evt_elt_t * elt) -{ - clib_llist_add_tail (wrk->event_elts, evt_list, elt, - session_evt_postponed_head (wrk)); + pool_elt_at_index (wrk->event_elts, wrk->old_head)); } -static inline void -session_evt_add_pending_disconnects (session_worker_t * wrk, - session_evt_elt_t * elt) +static inline session_evt_elt_t * +session_evt_alloc_ctrl (session_worker_t * wrk) { + session_evt_elt_t *elt; + elt = session_evt_elt_alloc (wrk); clib_llist_add_tail (wrk->event_elts, evt_list, elt, - session_evt_pending_disconnects_head (wrk)); + pool_elt_at_index (wrk->event_elts, wrk->ctrl_head)); + return elt; } static inline session_evt_elt_t * |