tcp: allow cc algos to set pacing rate
Type: feature Change-Id: Ie7f0f5d2a476d401ede567e422abb953b2bb4a78 Signed-off-by: Florin Coras <fcoras@cisco.com>
This commit is contained in:

committed by
Damjan Marion

parent
14bea1bb65
commit
d206724e78
@ -1263,17 +1263,11 @@ const static transport_proto_vft_t tcp_proto = {
|
|||||||
void
|
void
|
||||||
tcp_connection_tx_pacer_update (tcp_connection_t * tc)
|
tcp_connection_tx_pacer_update (tcp_connection_t * tc)
|
||||||
{
|
{
|
||||||
f64 srtt;
|
|
||||||
u64 rate;
|
|
||||||
|
|
||||||
if (!transport_connection_is_tx_paced (&tc->connection))
|
if (!transport_connection_is_tx_paced (&tc->connection))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
srtt = clib_min ((f64) tc->srtt * TCP_TICK, tc->mrtt_us);
|
transport_connection_tx_pacer_update (&tc->connection,
|
||||||
/* TODO should constrain to interface's max throughput but
|
tcp_cc_get_pacing_rate (tc));
|
||||||
* we don't have link speeds for sw ifs ..*/
|
|
||||||
rate = tc->cwnd / srtt;
|
|
||||||
transport_connection_tx_pacer_update (&tc->connection, rate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -417,6 +417,7 @@ struct _tcp_cc_algorithm
|
|||||||
void (*recovered) (tcp_connection_t * tc);
|
void (*recovered) (tcp_connection_t * tc);
|
||||||
void (*undo_recovery) (tcp_connection_t * tc);
|
void (*undo_recovery) (tcp_connection_t * tc);
|
||||||
void (*event) (tcp_connection_t *tc, tcp_cc_event_t evt);
|
void (*event) (tcp_connection_t *tc, tcp_cc_event_t evt);
|
||||||
|
u64 (*get_pacing_rate) (tcp_connection_t *tc);
|
||||||
};
|
};
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
@ -1053,6 +1054,18 @@ tcp_cc_event (tcp_connection_t * tc, tcp_cc_event_t evt)
|
|||||||
tc->cc_algo->event (tc, evt);
|
tc->cc_algo->event (tc, evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline u64
|
||||||
|
tcp_cc_get_pacing_rate (tcp_connection_t * tc)
|
||||||
|
{
|
||||||
|
if (tc->cc_algo->get_pacing_rate)
|
||||||
|
return tc->cc_algo->get_pacing_rate (tc);
|
||||||
|
|
||||||
|
f64 srtt = clib_min ((f64) tc->srtt * TCP_TICK, tc->mrtt_us);
|
||||||
|
/* TODO should constrain to interface's max throughput but
|
||||||
|
* we don't have link speeds for sw ifs ..*/
|
||||||
|
return (tc->cwnd / srtt);
|
||||||
|
}
|
||||||
|
|
||||||
always_inline void
|
always_inline void
|
||||||
tcp_timer_set (tcp_connection_t * tc, u8 timer_id, u32 interval)
|
tcp_timer_set (tcp_connection_t * tc, u8 timer_id, u32 interval)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user