MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cubic_cong_signal

Function cubic_cong_signal

freebsd/netinet/cc/cc_cubic.c:279–333  ·  view source on GitHub ↗

* Perform any necessary tasks before we enter congestion recovery. */

Source from the content-addressed store, hash-verified

277 * Perform any necessary tasks before we enter congestion recovery.
278 */
279static void
280cubic_cong_signal(struct cc_var *ccv, uint32_t type)
281{
282 struct cubic *cubic_data;
283 u_int mss;
284
285 cubic_data = ccv->cc_data;
286 mss = tcp_maxseg(ccv->ccvc.tcp);
287
288 switch (type) {
289 case CC_NDUPACK:
290 if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) {
291 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
292 cubic_ssthresh_update(ccv, mss);
293 cubic_data->flags |= CUBICFLAG_CONG_EVENT;
294 cubic_data->t_last_cong = ticks;
295 cubic_data->K = cubic_k(cubic_data->max_cwnd / mss);
296 }
297 ENTER_RECOVERY(CCV(ccv, t_flags));
298 }
299 break;
300
301 case CC_ECN:
302 if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
303 cubic_ssthresh_update(ccv, mss);
304 cubic_data->flags |= CUBICFLAG_CONG_EVENT;
305 cubic_data->t_last_cong = ticks;
306 cubic_data->K = cubic_k(cubic_data->max_cwnd / mss);
307 CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
308 ENTER_CONGRECOVERY(CCV(ccv, t_flags));
309 }
310 break;
311
312 case CC_RTO:
313 /* RFC8312 Section 4.7 */
314 if (CCV(ccv, t_rxtshift) == 1) {
315 cubic_data->t_last_cong_prev = cubic_data->t_last_cong;
316 cubic_data->prev_max_cwnd_cp = cubic_data->prev_max_cwnd;
317 }
318 cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT;
319 cubic_data->prev_max_cwnd = cubic_data->max_cwnd;
320 CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_cwnd) *
321 CUBIC_BETA) >> CUBIC_SHIFT;
322 CCV(ccv, snd_cwnd) = mss;
323 break;
324
325 case CC_RTO_ERR:
326 cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT);
327 cubic_data->max_cwnd = cubic_data->prev_max_cwnd;
328 cubic_data->prev_max_cwnd = cubic_data->prev_max_cwnd_cp;
329 cubic_data->t_last_cong = cubic_data->t_last_cong_prev;
330 cubic_data->K = cubic_k(cubic_data->max_cwnd / mss);
331 break;
332 }
333}
334
335static void
336cubic_conn_init(struct cc_var *ccv)

Callers

nothing calls this directly

Calls 3

tcp_maxsegFunction · 0.85
cubic_ssthresh_updateFunction · 0.85
cubic_kFunction · 0.85

Tested by

no test coverage detected