diff options
author | Florin Coras <fcoras@cisco.com> | 2019-11-13 19:09:47 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-11-20 18:34:07 +0000 |
commit | 11e9e351046d8f4ab61b8aaf975046215fba7c5d (patch) | |
tree | 950838b8740b5b7e56a5157df8ac748b3868c920 /src/vnet/session/transport.h | |
parent | d28437cdf2133533c9092b881ce0e4c243d6c1f6 (diff) |
session tcp: support pacer idle timeouts
Type: feature
To avoid excessive bursts, pacer must be provided with an estimated rtt
for the connection. That's used to compute an idle timeout, i.e., time
after which the bucket is reset to 1 mtu due to inactivity. For now,
idle timeout is computed as 5% of the rtt.
Change-Id: Ia0b752fe7b4ad0ce97b477fb886b0133a2321541
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/transport.h')
-rw-r--r-- | src/vnet/session/transport.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h index df246a9b305..adc695f5e5a 100644 --- a/src/vnet/session/transport.h +++ b/src/vnet/session/transport.h @@ -22,6 +22,8 @@ #define TRANSPORT_PACER_MIN_MSS 1460 #define TRANSPORT_PACER_MIN_BURST TRANSPORT_PACER_MIN_MSS #define TRANSPORT_PACER_MAX_BURST (43 * TRANSPORT_PACER_MIN_MSS) +#define TRANSPORT_PACER_MIN_IDLE 100 +#define TRANSPORT_PACER_IDLE_FACTOR 0.05 typedef struct _transport_options_t { @@ -148,6 +150,17 @@ transport_app_rx_evt (transport_proto_t tp, u32 conn_index, u32 thread_index) return tp_vfts[tp].app_rx_evt (tc); } +/** + * Get maximum tx burst allowed for transport connection + * + * @param tc transport connection + */ +static inline u32 +transport_connection_snd_space (transport_connection_t * tc) +{ + return tp_vfts[tc->proto].send_space (tc); +} + void transport_register_protocol (transport_proto_t transport_proto, const transport_proto_vft_t * vft, fib_protocol_t fib_proto, u32 output_node); @@ -174,7 +187,8 @@ transport_elog_track_index (transport_connection_t * tc) void transport_connection_tx_pacer_reset (transport_connection_t * tc, u64 rate_bytes_per_sec, - u32 initial_bucket); + u32 initial_bucket, + clib_us_time_t rtt); /** * Initialize tx pacer for connection * @@ -191,18 +205,13 @@ void transport_connection_tx_pacer_init (transport_connection_t * tc, * * @param tc transport connection * @param bytes_per_sec new pacing rate + * @param rtt connection rtt that is used to compute + * inactivity time after which pacer bucket is + * reset to 1 mtu */ void transport_connection_tx_pacer_update (transport_connection_t * tc, - u64 bytes_per_sec); - -/** - * Get maximum tx burst allowed for transport connection - * - * @param tc transport connection - * @param time_now current cpu time as returned by @ref clib_cpu_time_now - * @param mss transport's mss - */ -u32 transport_connection_snd_space (transport_connection_t * tc, u16 mss); + u64 bytes_per_sec, + clib_us_time_t rtt); /** * Get tx pacer max burst @@ -225,9 +234,10 @@ u64 transport_connection_tx_pacer_rate (transport_connection_t * tc); * Reset tx pacer bucket * * @param tc transport connection - * @param time_now current cpu time + * @param bucket value the bucket will be reset to */ -void transport_connection_tx_pacer_reset_bucket (transport_connection_t * tc); +void transport_connection_tx_pacer_reset_bucket (transport_connection_t * tc, + u32 bucket); /** * Check if transport connection is paced |