diff options
author | Florin Coras <fcoras@cisco.com> | 2021-04-02 18:32:00 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-04-05 21:07:22 +0000 |
commit | 8f10b9050dc6318d7ccb3982eec2ed742752c6ea (patch) | |
tree | 64123a2faaf179db0558023a1a6de8c147528714 /src/vnet/session | |
parent | e2daada1d58368b7e77c2990e680bf58e4d94f2e (diff) |
tcp: time infra improvements
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I998c0686f9f7dc556dda8b28e23bbed127d0aafc
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session.h | 7 | ||||
-rw-r--r-- | src/vnet/session/session_node.c | 3 | ||||
-rw-r--r-- | src/vnet/session/transport.c | 6 | ||||
-rw-r--r-- | src/vnet/session/transport.h | 8 |
4 files changed, 22 insertions, 2 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index aba8a1c3fd1..55863163a89 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -684,6 +684,13 @@ session_add_pending_tx_buffer (u32 thread_index, u32 bi, u32 next_node) vec_add1 (wrk->pending_tx_nexts, next_node); } +always_inline void +session_wrk_update_time (session_worker_t *wrk, f64 now) +{ + wrk->last_vlib_time = now; + wrk->last_vlib_us_time = wrk->last_vlib_time * CLIB_US_TIME_FREQ; +} + fifo_segment_t *session_main_get_evt_q_segment (void); void session_node_enable_disable (u8 is_en); clib_error_t *vnet_session_enable_disable (vlib_main_t * vm, u8 is_en); diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index f3713d00cd1..f8157cc6214 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -1431,8 +1431,7 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, SESSION_EVT (SESSION_EVT_DISPATCH_START, wrk); - wrk->last_vlib_time = vlib_time_now (vm); - wrk->last_vlib_us_time = wrk->last_vlib_time * CLIB_US_TIME_FREQ; + session_wrk_update_time (wrk, vlib_time_now (vm)); /* * Update transport time diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c index 7cc2a8e04c5..4f6ac8b1c48 100644 --- a/src/vnet/session/transport.c +++ b/src/vnet/session/transport.c @@ -763,6 +763,12 @@ transport_connection_tx_pacer_update_bytes (transport_connection_t * tc, } void +transport_update_pacer_time (u32 thread_index, clib_time_type_t now) +{ + session_wrk_update_time (session_main_get_worker (thread_index), now); +} + +void transport_connection_reschedule (transport_connection_t * tc) { tc->flags &= ~TRANSPORT_CONNECTION_F_DESCHED; diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h index 9a9b89fc9fd..efd2507ed4c 100644 --- a/src/vnet/session/transport.h +++ b/src/vnet/session/transport.h @@ -339,6 +339,14 @@ void transport_connection_tx_pacer_update_bytes (transport_connection_t * tc, u32 bytes); +/** + * Request pacer time update + * + * @param thread_index thread for which time is updated + * @param now time now + */ +void transport_update_pacer_time (u32 thread_index, clib_time_type_t now); + #endif /* SRC_VNET_SESSION_TRANSPORT_H_ */ /* |