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

Function bbr_fini

freebsd/netinet/tcp_stacks/bbr.c:10303–10349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10301}
10302
10303static void
10304bbr_fini(struct tcpcb *tp, int32_t tcb_is_purged)
10305{
10306 if (tp->t_fb_ptr) {
10307 uint32_t calc;
10308 struct tcp_bbr *bbr;
10309 struct bbr_sendmap *rsm;
10310
10311 bbr = (struct tcp_bbr *)tp->t_fb_ptr;
10312 if (bbr->r_ctl.crte)
10313 tcp_rel_pacing_rate(bbr->r_ctl.crte, bbr->rc_tp);
10314 bbr_log_flowend(bbr);
10315 bbr->rc_tp = NULL;
10316 if (tp->t_inpcb) {
10317 /* Backout any flags2 we applied */
10318 tp->t_inpcb->inp_flags2 &= ~INP_CANNOT_DO_ECN;
10319 tp->t_inpcb->inp_flags2 &= ~INP_SUPPORTS_MBUFQ;
10320 tp->t_inpcb->inp_flags2 &= ~INP_MBUF_QUEUE_READY;
10321 }
10322 if (bbr->bbr_hdrw_pacing)
10323 counter_u64_add(bbr_flows_whdwr_pacing, -1);
10324 else
10325 counter_u64_add(bbr_flows_nohdwr_pacing, -1);
10326 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map);
10327 while (rsm) {
10328 TAILQ_REMOVE(&bbr->r_ctl.rc_map, rsm, r_next);
10329 uma_zfree(bbr_zone, rsm);
10330 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_map);
10331 }
10332 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_free);
10333 while (rsm) {
10334 TAILQ_REMOVE(&bbr->r_ctl.rc_free, rsm, r_next);
10335 uma_zfree(bbr_zone, rsm);
10336 rsm = TAILQ_FIRST(&bbr->r_ctl.rc_free);
10337 }
10338 calc = bbr->r_ctl.rc_high_rwnd - bbr->r_ctl.rc_init_rwnd;
10339 if (calc > (bbr->r_ctl.rc_init_rwnd / 10))
10340 BBR_STAT_INC(bbr_dynamic_rwnd);
10341 else
10342 BBR_STAT_INC(bbr_static_rwnd);
10343 bbr->r_ctl.rc_free_cnt = 0;
10344 uma_zfree(bbr_pcb_zone, tp->t_fb_ptr);
10345 tp->t_fb_ptr = NULL;
10346 }
10347 /* Make sure snd_nxt is correctly set */
10348 tp->snd_nxt = tp->snd_max;
10349}
10350
10351static void
10352bbr_set_state(struct tcpcb *tp, struct tcp_bbr *bbr, uint32_t win)

Callers

nothing calls this directly

Calls 4

bbr_log_flowendFunction · 0.85
tcp_rel_pacing_rateFunction · 0.50
counter_u64_addFunction · 0.50
uma_zfreeFunction · 0.50

Tested by

no test coverage detected