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

Function rack_init

freebsd/netinet/tcp_stacks/rack.c:10339–10520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10337}
10338
10339static int
10340rack_init(struct tcpcb *tp)
10341{
10342 struct tcp_rack *rack = NULL;
10343 struct rack_sendmap *insret;
10344 uint32_t iwin, snt, us_cts;
10345
10346 tp->t_fb_ptr = uma_zalloc(rack_pcb_zone, M_NOWAIT);
10347 if (tp->t_fb_ptr == NULL) {
10348 /*
10349 * We need to allocate memory but cant. The INP and INP_INFO
10350 * locks and they are recusive (happens during setup. So a
10351 * scheme to drop the locks fails :(
10352 *
10353 */
10354 return (ENOMEM);
10355 }
10356 memset(tp->t_fb_ptr, 0, sizeof(struct tcp_rack));
10357
10358 rack = (struct tcp_rack *)tp->t_fb_ptr;
10359 RB_INIT(&rack->r_ctl.rc_mtree);
10360 TAILQ_INIT(&rack->r_ctl.rc_free);
10361 TAILQ_INIT(&rack->r_ctl.rc_tmap);
10362 rack->rc_tp = tp;
10363 if (tp->t_inpcb) {
10364 rack->rc_inp = tp->t_inpcb;
10365 }
10366 /* Probably not needed but lets be sure */
10367 rack_clear_rate_sample(rack);
10368 rack->r_ctl.rc_reorder_fade = rack_reorder_fade;
10369 rack->rc_allow_data_af_clo = rack_ignore_data_after_close;
10370 rack->r_ctl.rc_tlp_threshold = rack_tlp_thresh;
10371 if (use_rack_rr)
10372 rack->use_rack_rr = 1;
10373 if (V_tcp_delack_enabled)
10374 tp->t_delayed_ack = 1;
10375 else
10376 tp->t_delayed_ack = 0;
10377 if (rack_enable_shared_cwnd)
10378 rack->rack_enable_scwnd = 1;
10379 rack->rc_user_set_max_segs = rack_hptsi_segments;
10380 rack->rc_force_max_seg = 0;
10381 if (rack_use_imac_dack)
10382 rack->rc_dack_mode = 1;
10383 rack->r_ctl.rc_reorder_shift = rack_reorder_thresh;
10384 rack->r_ctl.rc_pkt_delay = rack_pkt_delay;
10385 rack->r_ctl.rc_prop_reduce = rack_use_proportional_reduce;
10386 rack->r_ctl.rc_prop_rate = rack_proportional_rate;
10387 rack->r_ctl.rc_tlp_cwnd_reduce = rack_lower_cwnd_at_tlp;
10388 rack->r_ctl.rc_early_recovery = rack_early_recovery;
10389 rack->r_ctl.rc_lowest_us_rtt = 0xffffffff;
10390 rack->r_ctl.rc_highest_us_rtt = 0;
10391 if (rack_disable_prr)
10392 rack->rack_no_prr = 1;
10393 if (rack_gp_no_rec_chg)
10394 rack->rc_gp_no_rec_chg = 1;
10395 rack->rc_always_pace = rack_pace_every_seg;
10396 if (rack_enable_mqueue_for_nonpaced)

Callers

nothing calls this directly

Calls 15

memsetFunction · 0.85
rack_clear_rate_sampleFunction · 0.85
rack_set_pace_segmentsFunction · 0.85
microuptimeFunction · 0.85
tcp_tv_to_mssectickFunction · 0.85
setup_time_filter_smallFunction · 0.85
tcp_tv_to_usectickFunction · 0.85
rack_allocFunction · 0.85
rc_init_windowFunction · 0.85
rack_stop_all_timersFunction · 0.85
rack_start_hpts_timerFunction · 0.85
rack_log_rtt_shrinksFunction · 0.85

Tested by

no test coverage detected