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

Function bbr_alloc

freebsd/netinet/tcp_stacks/bbr.c:3291–3311  ·  view source on GitHub ↗

* Allocate a sendmap from our zone. */

Source from the content-addressed store, hash-verified

3289 * Allocate a sendmap from our zone.
3290 */
3291static struct bbr_sendmap *
3292bbr_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
3313static struct bbr_sendmap *
3314bbr_alloc_full_limit(struct tcp_bbr *bbr)

Callers 5

bbr_alloc_full_limitFunction · 0.85
bbr_alloc_limitFunction · 0.85
bbr_log_outputFunction · 0.85
bbr_initFunction · 0.85
bbr.cFile · 0.85

Calls 1

uma_zallocFunction · 0.50

Tested by

no test coverage detected