summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-20 15:53:16 -0700
committerDave Wallace <dwallacelf@gmail.com>2019-07-23 17:37:30 +0000
commit60183db3a8b25714539882cca05ba3b9e9e54489 (patch)
tree401b275c491a43a061076f74afc4878c2b0e1de9 /src/vnet/session/session.h
parent687c9021fda009caa2b7eb17bea2eaa51d275bde (diff)
session: reorganize dispatch logic
Type:refactor Change-Id: Id796d0103e61e15c35a586d8cbd3d8916487b84d Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.h')
-rw-r--r--src/vnet/session/session.h29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 1e3229171da..a3f2a01929b 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -78,12 +78,12 @@ typedef struct session_worker_
/** vpp event message queue for worker */
svm_msg_q_t *vpp_event_queue;
- /** Our approximation of a "complete" dispatch loop period */
- f64 dispatch_period;
-
/** vlib_time_now last time around the track */
f64 last_vlib_time;
+ /** Convenience pointer to this worker's vlib_main */
+ vlib_main_t *vm;
+
/** Per-proto vector of sessions to enqueue */
u32 *session_to_enqueue[TRANSPORT_N_PROTO];
@@ -100,7 +100,7 @@ typedef struct session_worker_
clib_llist_index_t new_head;
/** Head of list of pending events */
- clib_llist_index_t pending_head;
+ clib_llist_index_t old_head;
/** Head of list of postponed events */
clib_llist_index_t postponed_head;
@@ -111,18 +111,15 @@ typedef struct session_worker_
/** Peekers rw lock */
clib_rwlock_t peekers_rw_locks;
- u32 last_tx_packets;
-
#if SESSION_DEBUG
/** last event poll time by thread */
f64 last_event_poll;
#endif
} session_worker_t;
-typedef int (session_fifo_rx_fn) (vlib_main_t * vm,
+typedef int (session_fifo_rx_fn) (session_worker_t * wrk,
vlib_node_runtime_t * node,
- session_worker_t * wrk,
- session_evt_elt_t * e, int *n_tx_pkts);
+ session_evt_elt_t * e, int *n_tx_packets);
extern session_fifo_rx_fn session_tx_fifo_peek_and_snd;
extern session_fifo_rx_fn session_tx_fifo_dequeue_and_snd;
@@ -207,9 +204,9 @@ session_evt_elt_free (session_worker_t * wrk, session_evt_elt_t * elt)
}
static inline session_evt_elt_t *
-session_evt_pending_head (session_worker_t * wrk)
+session_evt_old_head (session_worker_t * wrk)
{
- return pool_elt_at_index (wrk->event_elts, wrk->pending_head);
+ return pool_elt_at_index (wrk->event_elts, wrk->old_head);
}
static inline session_evt_elt_t *
@@ -225,10 +222,10 @@ session_evt_pending_disconnects_head (session_worker_t * wrk)
}
static inline void
-session_evt_add_pending (session_worker_t * wrk, session_evt_elt_t * elt)
+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_pending_head (wrk));
+ session_evt_old_head (wrk));
}
static inline void
@@ -478,12 +475,6 @@ transport_rx_fifo_has_ooo_data (transport_connection_t * tc)
}
always_inline f64
-transport_dispatch_period (u32 thread_index)
-{
- return session_main.wrk[thread_index].dispatch_period;
-}
-
-always_inline f64
transport_time_now (u32 thread_index)
{
return session_main.wrk[thread_index].last_vlib_time;