wrapper to allocate a sendmap entry, subject to a specific limit */
| 3327 | |
| 3328 | /* wrapper to allocate a sendmap entry, subject to a specific limit */ |
| 3329 | static struct bbr_sendmap * |
| 3330 | bbr_alloc_limit(struct tcp_bbr *bbr, uint8_t limit_type) |
| 3331 | { |
| 3332 | struct bbr_sendmap *rsm; |
| 3333 | |
| 3334 | if (limit_type) { |
| 3335 | /* currently there is only one limit type */ |
| 3336 | if (V_tcp_map_split_limit > 0 && |
| 3337 | bbr->r_ctl.rc_num_split_allocs >= V_tcp_map_split_limit) { |
| 3338 | BBR_STAT_INC(bbr_split_limited); |
| 3339 | if (!bbr->alloc_limit_reported) { |
| 3340 | bbr->alloc_limit_reported = 1; |
| 3341 | BBR_STAT_INC(bbr_alloc_limited_conns); |
| 3342 | } |
| 3343 | return (NULL); |
| 3344 | } |
| 3345 | } |
| 3346 | |
| 3347 | /* allocate and mark in the limit type, if set */ |
| 3348 | rsm = bbr_alloc(bbr); |
| 3349 | if (rsm != NULL && limit_type) { |
| 3350 | rsm->r_limit_type = limit_type; |
| 3351 | bbr->r_ctl.rc_num_split_allocs++; |
| 3352 | } |
| 3353 | return (rsm); |
| 3354 | } |
| 3355 | |
| 3356 | static void |
| 3357 | bbr_free(struct tcp_bbr *bbr, struct bbr_sendmap *rsm) |
no test coverage detected