diff options
author | Steven Luong <sluong@cisco.com> | 2022-09-29 16:45:23 -0700 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2022-10-03 17:16:21 +0000 |
commit | 6161bba1ea52d4344964278f94f507c5c75d5e2b (patch) | |
tree | 2a89f8dd9da24e5af70c96872d8389af2dfc4072 | |
parent | 9503eb59c128ead48b9aca22f11e55b0804ed0bd (diff) |
tcp: replace tcp_time_now with tcp_time_now_us
It looks like tcp_time_now has been deprecated for a while and the
replacement is tcp_time_now_us
Type: fix
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ifaed2632baa49d489d4e03f2623d8cc9a6f36e64
-rw-r--r-- | src/vnet/session/transport_types.h | 2 | ||||
-rw-r--r-- | src/vnet/tcp/tcp_debug.h | 57 |
2 files changed, 30 insertions, 29 deletions
diff --git a/src/vnet/session/transport_types.h b/src/vnet/session/transport_types.h index adf5e59e6c0..6a223546dfe 100644 --- a/src/vnet/session/transport_types.h +++ b/src/vnet/session/transport_types.h @@ -113,7 +113,7 @@ typedef struct _transport_connection #if TRANSPORT_DEBUG elog_track_t elog_track; /**< Event logging */ - u32 cc_stat_tstamp; /**< CC stats timestamp */ + f64 cc_stat_tstamp; /**< CC stats timestamp */ #endif /** diff --git a/src/vnet/tcp/tcp_debug.h b/src/vnet/tcp/tcp_debug.h index 1202f7f44d3..03240c679eb 100644 --- a/src/vnet/tcp/tcp_debug.h +++ b/src/vnet/tcp/tcp_debug.h @@ -867,11 +867,12 @@ if (TCP_DEBUG_CC > 1) \ */ #if TCP_DEBUG_CS || TCP_DEBUG_ALWAYS -#define STATS_INTERVAL 1 +#define STATS_INTERVAL 0.001 -#define tcp_cc_time_to_print_stats(_tc) \ - _tc->c_cc_stat_tstamp + STATS_INTERVAL < tcp_time_now() \ - || tcp_in_fastrecovery (_tc) \ +#define tcp_cc_time_to_print_stats(_tc) \ + _tc->c_cc_stat_tstamp + STATS_INTERVAL < \ + tcp_time_now_us (_tc->c_thread_index) || \ + tcp_in_fastrecovery (_tc) #define TCP_EVT_CC_RTO_STAT_PRINT(_tc) \ { \ @@ -887,14 +888,14 @@ if (TCP_DEBUG_CC > 1) \ ed->data[3] = _tc->rttvar; \ } -#define TCP_EVT_CC_RTO_STAT_HANDLER(_tc, ...) \ -{ \ -if (tcp_cc_time_to_print_stats (_tc)) \ -{ \ - TCP_EVT_CC_RTO_STAT_PRINT (_tc); \ - _tc->c_cc_stat_tstamp = tcp_time_now (); \ -} \ -} +#define TCP_EVT_CC_RTO_STAT_HANDLER(_tc, ...) \ + { \ + if (tcp_cc_time_to_print_stats (_tc)) \ + { \ + TCP_EVT_CC_RTO_STAT_PRINT (_tc); \ + _tc->c_cc_stat_tstamp = tcp_time_now_us (_tc->c_thread_index); \ + } \ + } #define TCP_EVT_CC_SND_STAT_PRINT(_tc) \ { \ @@ -911,14 +912,14 @@ if (tcp_cc_time_to_print_stats (_tc)) \ ed->data[3] = _tc->snd_rxt_bytes; \ } -#define TCP_EVT_CC_SND_STAT_HANDLER(_tc, ...) \ -{ \ -if (tcp_cc_time_to_print_stats (_tc)) \ -{ \ - TCP_EVT_CC_SND_STAT_PRINT(_tc); \ - _tc->c_cc_stat_tstamp = tcp_time_now (); \ -} \ -} +#define TCP_EVT_CC_SND_STAT_HANDLER(_tc, ...) \ + { \ + if (tcp_cc_time_to_print_stats (_tc)) \ + { \ + TCP_EVT_CC_SND_STAT_PRINT (_tc); \ + _tc->c_cc_stat_tstamp = tcp_time_now_us (_tc->c_thread_index); \ + } \ + } #define TCP_EVT_CC_STAT_PRINT(_tc) \ { \ @@ -937,14 +938,14 @@ if (tcp_cc_time_to_print_stats (_tc)) \ TCP_EVT_CC_SND_STAT_PRINT (_tc); \ } -#define TCP_EVT_CC_STAT_HANDLER(_tc, ...) \ -{ \ -if (tcp_cc_time_to_print_stats (_tc)) \ -{ \ - TCP_EVT_CC_STAT_PRINT (_tc); \ - _tc->c_cc_stat_tstamp = tcp_time_now(); \ -} \ -} +#define TCP_EVT_CC_STAT_HANDLER(_tc, ...) \ + { \ + if (tcp_cc_time_to_print_stats (_tc)) \ + { \ + TCP_EVT_CC_STAT_PRINT (_tc); \ + _tc->c_cc_stat_tstamp = tcp_time_now_us (_tc->c_thread_index); \ + } \ + } #else #define TCP_EVT_CC_STAT_HANDLER(_tc, ...) #define TCP_EVT_CC_STAT_PRINT(_tc) |