| 3354 | } |
| 3355 | |
| 3356 | static void |
| 3357 | bbr_free(struct tcp_bbr *bbr, struct bbr_sendmap *rsm) |
| 3358 | { |
| 3359 | if (rsm->r_limit_type) { |
| 3360 | /* currently there is only one limit type */ |
| 3361 | bbr->r_ctl.rc_num_split_allocs--; |
| 3362 | } |
| 3363 | if (rsm->r_is_smallmap) |
| 3364 | bbr->r_ctl.rc_num_small_maps_alloced--; |
| 3365 | if (bbr->r_ctl.rc_tlp_send == rsm) |
| 3366 | bbr->r_ctl.rc_tlp_send = NULL; |
| 3367 | if (bbr->r_ctl.rc_resend == rsm) { |
| 3368 | bbr->r_ctl.rc_resend = NULL; |
| 3369 | } |
| 3370 | if (bbr->r_ctl.rc_next == rsm) |
| 3371 | bbr->r_ctl.rc_next = NULL; |
| 3372 | if (bbr->r_ctl.rc_sacklast == rsm) |
| 3373 | bbr->r_ctl.rc_sacklast = NULL; |
| 3374 | if (bbr->r_ctl.rc_free_cnt < bbr_min_req_free) { |
| 3375 | memset(rsm, 0, sizeof(struct bbr_sendmap)); |
| 3376 | TAILQ_INSERT_TAIL(&bbr->r_ctl.rc_free, rsm, r_next); |
| 3377 | rsm->r_limit_type = 0; |
| 3378 | bbr->r_ctl.rc_free_cnt++; |
| 3379 | return; |
| 3380 | } |
| 3381 | bbr->r_ctl.rc_num_maps_alloced--; |
| 3382 | uma_zfree(bbr_zone, rsm); |
| 3383 | } |
| 3384 | |
| 3385 | /* |
| 3386 | * Returns the BDP. |
no test coverage detected