wrapper to allocate a sendmap entry, subject to a specific limit */
| 2219 | |
| 2220 | /* wrapper to allocate a sendmap entry, subject to a specific limit */ |
| 2221 | static struct rack_sendmap * |
| 2222 | rack_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 | |
| 2249 | static void |
| 2250 | rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm) |
no test coverage detected