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

Function rack_free

freebsd/netinet/tcp_stacks/rack.c:2249–2291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2247}
2248
2249static void
2250rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm)
2251{
2252 if (rsm->r_flags & RACK_APP_LIMITED) {
2253 if (rack->r_ctl.rc_app_limited_cnt > 0) {
2254 rack->r_ctl.rc_app_limited_cnt--;
2255 }
2256 }
2257 if (rsm->r_limit_type) {
2258 /* currently there is only one limit type */
2259 rack->r_ctl.rc_num_split_allocs--;
2260 }
2261 if (rsm == rack->r_ctl.rc_first_appl) {
2262 if (rack->r_ctl.rc_app_limited_cnt == 0)
2263 rack->r_ctl.rc_first_appl = NULL;
2264 else {
2265 /* Follow the next one out */
2266 struct rack_sendmap fe;
2267
2268 fe.r_start = rsm->r_nseq_appl;
2269 rack->r_ctl.rc_first_appl = RB_FIND(rack_rb_tree_head, &rack->r_ctl.rc_mtree, &fe);
2270 }
2271 }
2272 if (rsm == rack->r_ctl.rc_resend)
2273 rack->r_ctl.rc_resend = NULL;
2274 if (rsm == rack->r_ctl.rc_rsm_at_retran)
2275 rack->r_ctl.rc_rsm_at_retran = NULL;
2276 if (rsm == rack->r_ctl.rc_end_appl)
2277 rack->r_ctl.rc_end_appl = NULL;
2278 if (rack->r_ctl.rc_tlpsend == rsm)
2279 rack->r_ctl.rc_tlpsend = NULL;
2280 if (rack->r_ctl.rc_sacklast == rsm)
2281 rack->r_ctl.rc_sacklast = NULL;
2282 if (rack->rc_free_cnt < rack_free_cache) {
2283 memset(rsm, 0, sizeof(struct rack_sendmap));
2284 TAILQ_INSERT_TAIL(&rack->r_ctl.rc_free, rsm, r_tnext);
2285 rsm->r_limit_type = 0;
2286 rack->rc_free_cnt++;
2287 return;
2288 }
2289 rack->r_ctl.rc_num_maps_alloced--;
2290 uma_zfree(rack_zone, rsm);
2291}
2292
2293static uint32_t
2294rack_get_measure_window(struct tcpcb *tp, struct tcp_rack *rack)

Callers 2

rack_merge_rsmFunction · 0.85
rack_log_ackFunction · 0.85

Calls 2

memsetFunction · 0.85
uma_zfreeFunction · 0.50

Tested by

no test coverage detected