* Allocate a sendmap from our zone. */
| 3289 | * Allocate a sendmap from our zone. |
| 3290 | */ |
| 3291 | static struct bbr_sendmap * |
| 3292 | bbr_alloc(struct tcp_bbr *bbr) |
| 3293 | { |
| 3294 | struct bbr_sendmap *rsm; |
| 3295 | |
| 3296 | BBR_STAT_INC(bbr_to_alloc); |
| 3297 | rsm = uma_zalloc(bbr_zone, (M_NOWAIT | M_ZERO)); |
| 3298 | if (rsm) { |
| 3299 | bbr->r_ctl.rc_num_maps_alloced++; |
| 3300 | return (rsm); |
| 3301 | } |
| 3302 | if (bbr->r_ctl.rc_free_cnt) { |
| 3303 | BBR_STAT_INC(bbr_to_alloc_emerg); |
| 3304 | rsm = TAILQ_FIRST(&bbr->r_ctl.rc_free); |
| 3305 | TAILQ_REMOVE(&bbr->r_ctl.rc_free, rsm, r_next); |
| 3306 | bbr->r_ctl.rc_free_cnt--; |
| 3307 | return (rsm); |
| 3308 | } |
| 3309 | BBR_STAT_INC(bbr_to_alloc_failed); |
| 3310 | return (NULL); |
| 3311 | } |
| 3312 | |
| 3313 | static struct bbr_sendmap * |
| 3314 | bbr_alloc_full_limit(struct tcp_bbr *bbr) |
no test coverage detected