aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-17 19:09:33 -0700
committerDamjan Marion <dmarion@me.com>2021-05-19 19:34:12 +0000
commit46b8b1a4c0743ef91d41db6dea582eb590f5f31b (patch)
treef1af283c36657fdf9a873cdeeb58fb04a61aeed4 /src/vnet/session/session.h
parent6e9964e6c0a5d2a7102f22695f796054fd8f2b95 (diff)
session: cleanup event llist usage
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I750c856ac81d951e8c0e62c710e0f35a0c80d6f9
Diffstat (limited to 'src/vnet/session/session.h')
-rw-r--r--src/vnet/session/session.h30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index b583c3ef0dd..db9220d8c3b 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -257,32 +257,18 @@ typedef enum session_q_process_evt_
#define TRANSPORT_PROTO_INVALID (session_main.last_transport_proto_type + 1)
#define TRANSPORT_N_PROTOS (session_main.last_transport_proto_type + 1)
-static inline session_evt_elt_t *
-session_evt_elt_alloc (session_worker_t * wrk)
-{
- session_evt_elt_t *elt;
- pool_get (wrk->event_elts, elt);
- return elt;
-}
-
-static inline void
-session_evt_elt_free (session_worker_t * wrk, session_evt_elt_t * elt)
-{
- pool_put (wrk->event_elts, elt);
-}
-
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,
- pool_elt_at_index (wrk->event_elts, wrk->old_head));
+ clib_llist_elt (wrk->event_elts, wrk->old_head));
}
static inline void
session_evt_add_head_old (session_worker_t * wrk, session_evt_elt_t * elt)
{
clib_llist_add (wrk->event_elts, evt_list, elt,
- pool_elt_at_index (wrk->event_elts, wrk->old_head));
+ clib_llist_elt (wrk->event_elts, wrk->old_head));
}
@@ -298,9 +284,9 @@ 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_get (wrk->event_elts, elt);
clib_llist_add_tail (wrk->event_elts, evt_list, elt,
- pool_elt_at_index (wrk->event_elts, wrk->ctrl_head));
+ clib_llist_elt (wrk->event_elts, wrk->ctrl_head));
return elt;
}
@@ -322,9 +308,9 @@ static inline session_evt_elt_t *
session_evt_alloc_new (session_worker_t * wrk)
{
session_evt_elt_t *elt;
- elt = session_evt_elt_alloc (wrk);
+ clib_llist_get (wrk->event_elts, elt);
clib_llist_add_tail (wrk->event_elts, evt_list, elt,
- pool_elt_at_index (wrk->event_elts, wrk->new_head));
+ clib_llist_elt (wrk->event_elts, wrk->new_head));
return elt;
}
@@ -332,9 +318,9 @@ static inline session_evt_elt_t *
session_evt_alloc_old (session_worker_t * wrk)
{
session_evt_elt_t *elt;
- elt = session_evt_elt_alloc (wrk);
+ clib_llist_get (wrk->event_elts, elt);
clib_llist_add_tail (wrk->event_elts, evt_list, elt,
- pool_elt_at_index (wrk->event_elts, wrk->old_head));
+ clib_llist_elt (wrk->event_elts, wrk->old_head));
return elt;
}