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

Function bbr_alloc_limit

freebsd/netinet/tcp_stacks/bbr.c:3329–3354  ·  view source on GitHub ↗

wrapper to allocate a sendmap entry, subject to a specific limit */

Source from the content-addressed store, hash-verified

3327
3328/* wrapper to allocate a sendmap entry, subject to a specific limit */
3329static struct bbr_sendmap *
3330bbr_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
3356static void
3357bbr_free(struct tcp_bbr *bbr, struct bbr_sendmap *rsm)

Callers 2

bbr_proc_sack_blkFunction · 0.85
bbr_collapsed_windowFunction · 0.85

Calls 1

bbr_allocFunction · 0.85

Tested by

no test coverage detected