Index: sys/netinet/cc/cc_cubic.c =================================================================== --- sys/netinet/cc/cc_cubic.c +++ sys/netinet/cc/cc_cubic.c @@ -94,6 +94,7 @@ uint32_t flags; #define CUBICFLAG_cong_event 0x01 /* congestion expirienced */ #define CUBICFLAG_in_slowstart 0x02 /* in slow start */ +#define CUBICFLAG_in_applimit 0x04 /* application limited */ /* Minimum observed rtt in ticks. */ int min_rtt_ticks; /* Mean observed rtt between congestion epochs. */ @@ -154,8 +155,10 @@ cubic_data->t_last_cong = ticks - INT_MAX; } - if (cubic_data->flags & CUBICFLAG_in_slowstart) { - cubic_data->flags &= ~CUBICFLAG_in_slowstart; + if (cubic_data->flags & (CUBICFLAG_in_slowstart | + CUBICFLAG_in_applimit)) { + cubic_data->flags &= ~(CUBICFLAG_in_slowstart | + CUBICFLAG_in_applimit); cubic_data->t_last_cong = ticks; cubic_data->K = 0; } @@ -215,6 +218,10 @@ CCV(ccv, t_maxseg)); } } + } else if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && + !(ccv->flags & CCF_CWND_LIMITED)) { + if (!(cubic_data->flags & CUBICFLAG_in_applimit)) + cubic_data->flags |= CUBICFLAG_in_applimit; } }