Skip to content

Commit

Permalink
Implement a tCP CUBIC-specific after idle reaction.
Browse files Browse the repository at this point in the history
This patch addresses a very common case of frequent application stalls,
where TCP runs idle and looses the state of the network.

Submitted by:		Richard Scheffenegger
Reviewed by:		Cheng Cui
Differential Revision:	https://reviews.freebsd.org/D18954
  • Loading branch information
tuexen committed Nov 16, 2019
1 parent a8e5b7d commit 18a1c72
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions sys/netinet/cc/cc_cubic.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static int cubic_mod_init(void);
static void cubic_post_recovery(struct cc_var *ccv);
static void cubic_record_rtt(struct cc_var *ccv);
static void cubic_ssthresh_update(struct cc_var *ccv);
static void cubic_after_idle(struct cc_var *ccv);

struct cubic {
/* Cubic K in fixed point form with CUBIC_SHIFT worth of precision. */
Expand Down Expand Up @@ -112,6 +113,7 @@ struct cc_algo cubic_cc_algo = {
.conn_init = cubic_conn_init,
.mod_init = cubic_mod_init,
.post_recovery = cubic_post_recovery,
.after_idle = cubic_after_idle,
};

static void
Expand Down Expand Up @@ -192,6 +194,23 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type)
}
}

/*
* This is a Cubic specific implementation of after_idle.
* - Reset cwnd by calling New Reno implementation of after_idle.
* - Reset t_last_cong.
*/
static void
cubic_after_idle(struct cc_var *ccv)
{
struct cubic *cubic_data;

cubic_data = ccv->cc_data;

newreno_cc_algo.after_idle(ccv);
cubic_data->t_last_cong = ticks;
}


static void
cubic_cb_destroy(struct cc_var *ccv)
{
Expand Down Expand Up @@ -287,9 +306,6 @@ cubic_conn_init(struct cc_var *ccv)
static int
cubic_mod_init(void)
{

cubic_cc_algo.after_idle = newreno_cc_algo.after_idle;

return (0);
}

Expand Down

0 comments on commit 18a1c72

Please sign in to comment.