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

Function rack_alloc_limit

freebsd/netinet/tcp_stacks/rack.c:2221–2247  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2219
2220/* wrapper to allocate a sendmap entry, subject to a specific limit */
2221static struct rack_sendmap *
2222rack_alloc_limit(struct tcp_rack *rack, uint8_t limit_type)
2223{
2224 struct rack_sendmap *rsm;
2225
2226 if (limit_type) {
2227 /* currently there is only one limit type */
2228 if (V_tcp_map_split_limit > 0 &&
2229 (rack->do_detection == 0) &&
2230 rack->r_ctl.rc_num_split_allocs >= V_tcp_map_split_limit) {
2231 counter_u64_add(rack_split_limited, 1);
2232 if (!rack->alloc_limit_reported) {
2233 rack->alloc_limit_reported = 1;
2234 counter_u64_add(rack_alloc_limited_conns, 1);
2235 }
2236 return (NULL);
2237 }
2238 }
2239
2240 /* allocate and mark in the limit type, if set */
2241 rsm = rack_alloc(rack);
2242 if (rsm != NULL && limit_type) {
2243 rsm->r_limit_type = limit_type;
2244 rack->r_ctl.rc_num_split_allocs++;
2245 }
2246 return (rsm);
2247}
2248
2249static void
2250rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm)

Callers 2

rack_proc_sack_blkFunction · 0.85
rack_collapsed_windowFunction · 0.85

Calls 2

rack_allocFunction · 0.85
counter_u64_addFunction · 0.50

Tested by

no test coverage detected