diff options
author | Florin Coras <fcoras@cisco.com> | 2018-05-21 17:47:40 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-25 10:13:18 +0000 |
commit | d67f112063e6c57160a3d0260537b9dcfe23d217 (patch) | |
tree | c2d5251e7896290cc0a968fb2b4d6d9ba87aef17 /src/vnet/session/transport.h | |
parent | 2fab01ee0f9b406584272968863eee16a3bb1fb9 (diff) |
tcp/session: add tx pacer
Adds tx pacing infrastructure for transport protocols that want to use
it. Particularly useful for connections with non-negligible rtt and
constrained network throughput as it avoids large tx bursts that lead to
local interface tx or network drops.
By default the pacer is disabled. To enabled it for tcp, add tx-pacing
to tcp's startup conf. We are still slightly inefficient in the handling
of incoming packets in established state so the pacer slightly affect
maximum throughput in low lacency scenarios.
Change-Id: Id445b2ffcd64cce015f75b773f7d722faa0f7ca9
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/transport.h')
-rw-r--r-- | src/vnet/session/transport.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h index e29f3ca9557..07366692c3e 100644 --- a/src/vnet/session/transport.h +++ b/src/vnet/session/transport.h @@ -23,6 +23,19 @@ /* * Protocol independent transport properties associated to a session */ +typedef struct _transport_stats +{ + u64 tx_bytes; +} transport_stats_t; + +typedef struct _spacer +{ + u64 bucket; + u32 max_burst_size; + f32 tokens_per_period; + u64 last_update; +} spacer_t; + typedef struct _transport_connection { /** Connection ID */ @@ -54,6 +67,10 @@ typedef struct _transport_connection /*fib_node_index_t rmt_fei; dpo_id_t rmt_dpo; */ + u8 flags; /**< Transport specific flags */ + transport_stats_t stats; /**< Transport connection stats */ + spacer_t pacer; /**< Simple transport pacer */ + #if TRANSPORT_DEBUG elog_track_t elog_track; /**< Event logging */ u32 cc_stat_tstamp; /**< CC stats timestamp */ @@ -79,8 +96,13 @@ typedef struct _transport_connection #define c_rmt_fei connection.rmt_fei #define c_rmt_dpo connection.rmt_dpo #define c_opaque_id connection.opaque_conn_id +#define c_stats connection.stats +#define c_pacer connection.pacer +#define c_flags connection.flags } transport_connection_t; +#define TRANSPORT_CONNECTION_F_IS_TX_PACED 1 << 0 + typedef enum _transport_proto { TRANSPORT_PROTO_TCP, |