xref: /xnu-8796.101.5/bsd/skywalk/packet/pbufpool_kern.c (revision aca3beaa3dfbd42498b42c5e5ce20a938e6554e5)
1 /*
2  * Copyright (c) 2016-2022 Apple Inc. All rights reserved.
3  *
4  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5  *
6  * This file contains Original Code and/or Modifications of Original Code
7  * as defined in and that are subject to the Apple Public Source License
8  * Version 2.0 (the 'License'). You may not use this file except in
9  * compliance with the License. The rights granted to you under the License
10  * may not be used to create, or enable the creation or redistribution of,
11  * unlawful or unlicensed copies of an Apple operating system, or to
12  * circumvent, violate, or enable the circumvention or violation of, any
13  * terms of an Apple operating system software license agreement.
14  *
15  * Please obtain a copy of the License at
16  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17  *
18  * The Original Code and all software distributed under the License are
19  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23  * Please see the License for the specific language governing rights and
24  * limitations under the License.
25  *
26  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27  */
28 
29 #include <skywalk/os_skywalk_private.h>
30 #include <skywalk/packet/pbufpool_var.h>
31 
32 static errno_t kern_pbufpool_alloc_common(const kern_pbufpool_t,
33     const uint32_t, kern_packet_t *, uint32_t);
34 static errno_t kern_pbufpool_alloc_batch_common(const kern_pbufpool_t,
35     const uint32_t, kern_packet_t *, uint32_t *, alloc_cb_func_t,
36     const void *, uint32_t);
37 
38 #define KBI_INVALID_CB_PAIRS(cb1, cb2)                                  \
39 	(!(init->kbi_##cb1 == NULL && init->kbi_##cb2 == NULL) &&       \
40 	((init->kbi_##cb1 == NULL) ^ (init->kbi_##cb2 == NULL)))
41 
42 errno_t
kern_pbufpool_create(const struct kern_pbufpool_init * init,kern_pbufpool_t * ppp,struct kern_pbufpool_memory_info * pp_info)43 kern_pbufpool_create(const struct kern_pbufpool_init *init,
44     kern_pbufpool_t *ppp, struct kern_pbufpool_memory_info *pp_info)
45 {
46 	/* XXX: woodford_s - find a way to get 'srp' off the kernel stack */
47 	struct skmem_region_params srp[SKMEM_REGIONS];
48 	struct kern_pbufpool *pp = NULL;
49 	nexus_meta_type_t md_type;
50 	nexus_meta_subtype_t md_subtype;
51 	uint32_t buf_cnt;
52 	uint16_t max_frags;
53 	uint32_t ppcreatef = PPCREATEF_EXTERNAL;
54 	uint32_t pkt_cnt;
55 	uint32_t pp_region_flags = 0;
56 	int err = 0;
57 	bool kernel_only;
58 	bool tx_pool = true;
59 
60 	if (ppp == NULL || init == NULL ||
61 	    init->kbi_version != KERN_PBUFPOOL_CURRENT_VERSION ||
62 	    init->kbi_packets == 0 || (init->kbi_buflets != 0 &&
63 	    init->kbi_buflets < init->kbi_packets &&
64 	    !(init->kbi_flags & KBIF_BUFFER_ON_DEMAND)) ||
65 	    init->kbi_bufsize == 0 || init->kbi_max_frags == 0 ||
66 	    ((init->kbi_flags & KBIF_QUANTUM) &&
67 	    (init->kbi_flags & KBIF_BUFFER_ON_DEMAND)) ||
68 	    KBI_INVALID_CB_PAIRS(buf_seg_ctor, buf_seg_dtor)) {
69 		err = EINVAL;
70 		goto done;
71 	}
72 
73 	*ppp = NULL;
74 
75 	md_type = ((init->kbi_flags & KBIF_QUANTUM) ?
76 	    NEXUS_META_TYPE_QUANTUM : NEXUS_META_TYPE_PACKET);
77 
78 	/*
79 	 * If packet, we assume this is for a driver handling raw frames.
80 	 * This also implies that at present, we do not create mirrored
81 	 * regions for user space to conserve memory (since those regions
82 	 * aren't going to be used anyway.)
83 	 *
84 	 * XXX: [email protected] - to allow for "direct" channels from
85 	 * user process to driver, we will need to revisit this.
86 	 */
87 	md_subtype = ((md_type == NEXUS_META_TYPE_QUANTUM) ?
88 	    NEXUS_META_SUBTYPE_PAYLOAD : NEXUS_META_SUBTYPE_RAW);
89 	kernel_only = (md_type == NEXUS_META_TYPE_PACKET) &&
90 #if (DEVELOPMENT || DEBUG)
91 	    !skywalk_netif_direct_enabled() &&
92 #endif /* (DEVELOPMENT || DEBUG) */
93 	    ((init->kbi_flags & KBIF_USER_ACCESS) == 0);
94 
95 	VERIFY((init->kbi_max_frags != 0) &&
96 	    (init->kbi_max_frags <= UINT16_MAX));
97 	max_frags = (uint16_t)init->kbi_max_frags;
98 	if (md_type == NEXUS_META_TYPE_QUANTUM && max_frags > 1) {
99 		err = EINVAL;
100 		goto done;
101 	}
102 	if ((max_frags > 1) && !(init->kbi_flags & KBIF_BUFFER_ON_DEMAND)) {
103 		err = EINVAL;
104 		goto done;
105 	}
106 
107 	bzero(&srp, sizeof(srp));
108 	for (int i = 0; i < SKMEM_REGIONS; i++) {
109 		srp[i] = *skmem_get_default(i);
110 	}
111 
112 	switch (init->kbi_flags & (KBIF_IODIR_IN | KBIF_IODIR_OUT)) {
113 	case KBIF_IODIR_IN:
114 		pp_region_flags |= PP_REGION_CONFIG_BUF_IODIR_IN;
115 		tx_pool = false;
116 		break;
117 	case KBIF_IODIR_OUT:
118 		pp_region_flags |= PP_REGION_CONFIG_BUF_IODIR_OUT;
119 		break;
120 	case (KBIF_IODIR_IN | KBIF_IODIR_OUT):
121 	default:
122 		pp_region_flags |= PP_REGION_CONFIG_BUF_IODIR_BIDIR;
123 		break;
124 	}
125 
126 	if (init->kbi_flags & KBIF_BUFFER_ON_DEMAND) {
127 		pp_region_flags |= PP_REGION_CONFIG_BUFLET;
128 		if (init->kbi_flags & KBIF_RAW_BFLT) {
129 			pp_region_flags |= PP_REGION_CONFIG_RAW_BUFLET;
130 		}
131 	}
132 	if (kernel_only) {
133 		pp_region_flags |= PP_REGION_CONFIG_KERNEL_ONLY;
134 	}
135 	if (init->kbi_flags & KBIF_KERNEL_READONLY) {
136 		pp_region_flags |= PP_REGION_CONFIG_BUF_KREADONLY;
137 	}
138 	if (init->kbi_flags & KBIF_THREADSAFE) {
139 		pp_region_flags |= PP_REGION_CONFIG_BUF_THREADSAFE;
140 	}
141 	/*
142 	 * Enable magazine layer for metadata.
143 	 */
144 	if (!(init->kbi_flags & KBIF_NO_MAGAZINES)) {
145 		pp_region_flags |= PP_REGION_CONFIG_MD_MAGAZINE_ENABLE;
146 	}
147 	pp_region_flags |= PP_REGION_CONFIG_MD_PERSISTENT;
148 
149 	pkt_cnt = init->kbi_packets;
150 	/*
151 	 * For TCP to be able to send a 4MB window worth of data, packet pool
152 	 * must have at least 4MB/MTU packets. On devices which are not
153 	 * memory constrained, we can increase the pool to be atleast
154 	 * 4K packets.
155 	 */
156 	if (tx_pool && !SKMEM_MEM_CONSTRAINED_DEVICE() &&
157 #if (DEVELOPMENT || DEBUG)
158 	    !skmem_test_enabled() &&
159 #endif /* (DEVELOPMENT || DEBUG) */
160 	    !(init->kbi_flags & KBIF_MONOLITHIC) &&
161 	    !(init->kbi_flags & KBIF_VIRTUAL_DEVICE) &&
162 	    !(init->kbi_flags & KBIF_PHYS_CONTIGUOUS) &&
163 	    !(init->kbi_flags & KBIF_KERNEL_READONLY) &&
164 	    !(init->kbi_flags & KBIF_QUANTUM)) {
165 		pkt_cnt = MAX((4 * 1024), pkt_cnt);
166 	}
167 #if (DEVELOPMENT || DEBUG)
168 	if (sk_min_pool_size != 0) {
169 		pkt_cnt = MAX(pkt_cnt, sk_min_pool_size);
170 	}
171 #endif /* (DEVELOPMENT || DEBUG) */
172 	/* make sure # of buffers is >= # of packets */
173 	buf_cnt = MAX(pkt_cnt, init->kbi_buflets);
174 
175 	/*
176 	 * Apply same logic as in nxprov_create_common().
177 	 */
178 	if (init->kbi_flags &
179 	    (KBIF_PERSISTENT | KBIF_MONOLITHIC | KBIF_INHIBIT_CACHE |
180 	    KBIF_PHYS_CONTIGUOUS)) {
181 		if (init->kbi_flags & KBIF_PERSISTENT) {
182 			pp_region_flags |= PP_REGION_CONFIG_BUF_PERSISTENT;
183 		}
184 		if (init->kbi_flags & KBIF_MONOLITHIC) {
185 			pp_region_flags |= PP_REGION_CONFIG_BUF_MONOLITHIC;
186 		}
187 		if (init->kbi_flags & KBIF_INHIBIT_CACHE) {
188 			pp_region_flags |= PP_REGION_CONFIG_BUF_NOCACHE;
189 		}
190 		if (init->kbi_flags & KBIF_PHYS_CONTIGUOUS) {
191 			pp_region_flags |= PP_REGION_CONFIG_BUF_SEGPHYSCONTIG;
192 		}
193 	}
194 
195 	/* adjust region params */
196 	pp_regions_params_adjust(srp, md_type, md_subtype, pkt_cnt, max_frags,
197 	    init->kbi_bufsize, 0, buf_cnt, init->kbi_buf_seg_size,
198 	    pp_region_flags);
199 
200 	/*
201 	 * Create packet pool.
202 	 */
203 	ASSERT(ppcreatef & PPCREATEF_EXTERNAL);
204 	if (kernel_only) {
205 		ppcreatef |= PPCREATEF_KERNEL_ONLY;
206 	}
207 	if (init->kbi_flags & KBIF_BUFFER_ON_DEMAND) {
208 		ppcreatef |= PPCREATEF_ONDEMAND_BUF;
209 		if (init->kbi_flags & KBIF_RAW_BFLT) {
210 			ppcreatef |= PPCREATEF_RAW_BFLT;
211 		}
212 	}
213 	/*
214 	 * Enable CPU-layer magazine resizing if this is a long-lived
215 	 * pbufpool, e.g. one that's allocated by a device driver.
216 	 */
217 	if (!(init->kbi_flags & KBIF_VIRTUAL_DEVICE)) {
218 		ppcreatef |= PPCREATEF_DYNAMIC;
219 	}
220 	if ((pp = pp_create((const char *)init->kbi_name, srp,
221 	    init->kbi_buf_seg_ctor, init->kbi_buf_seg_dtor,
222 	    init->kbi_ctx, init->kbi_ctx_retain, init->kbi_ctx_release,
223 	    ppcreatef)) == NULL) {
224 		err = ENOMEM;
225 		goto done;
226 	}
227 
228 	*ppp = pp;
229 
230 	if (pp_info != NULL) {
231 		err = kern_pbufpool_get_memory_info(pp, pp_info);
232 		VERIFY(err == 0);
233 	}
234 
235 done:
236 	if (err != 0 && pp != NULL) {
237 		/* callee drops reference */
238 		pp_close(pp);
239 		pp = NULL;
240 	}
241 
242 	return err;
243 }
244 
245 void *
kern_pbufpool_get_context(const kern_pbufpool_t pp)246 kern_pbufpool_get_context(const kern_pbufpool_t pp)
247 {
248 	void *ctx = (pp->pp_flags & PPF_EXTERNAL) ? pp->pp_ctx : NULL;
249 	if (ctx != NULL) {
250 		pp->pp_ctx_retain(ctx);
251 	}
252 	return ctx;
253 }
254 
255 errno_t
kern_pbufpool_get_memory_info(const kern_pbufpool_t pp,struct kern_pbufpool_memory_info * pp_info)256 kern_pbufpool_get_memory_info(const kern_pbufpool_t pp,
257     struct kern_pbufpool_memory_info *pp_info)
258 {
259 	if (pp_info == NULL) {
260 		return EINVAL;
261 	}
262 
263 	bzero(pp_info, sizeof(*pp_info));
264 	if (pp->pp_flags & PPF_EXTERNAL) {
265 		pp_info->kpm_flags |= KPMF_EXTERNAL;
266 	}
267 	pp_info->kpm_packets      = pp->pp_kmd_region->skr_c_obj_cnt;
268 	pp_info->kpm_max_frags    = pp->pp_max_frags;
269 	pp_info->kpm_buflets      = PP_BUF_REGION_DEF(pp)->skr_c_obj_cnt;
270 	pp_info->kpm_bufsize      = PP_BUF_SIZE_DEF(pp);
271 	pp_info->kpm_buf_obj_size = PP_BUF_OBJ_SIZE_DEF(pp);
272 	pp_info->kpm_bufsegs      = PP_BUF_REGION_DEF(pp)->skr_seg_max_cnt;
273 	pp_info->kpm_buf_seg_size = PP_BUF_REGION_DEF(pp)->skr_seg_size;
274 
275 	return 0;
276 }
277 
278 kern_segment_idx_t
kern_segment_get_index(const kern_segment_t seg)279 kern_segment_get_index(const kern_segment_t seg)
280 {
281 	return seg->sg_index;
282 }
283 
284 static errno_t
kern_pbufpool_alloc_common(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * pph,uint32_t skmflag)285 kern_pbufpool_alloc_common(const kern_pbufpool_t pp, const uint32_t bufcnt,
286     kern_packet_t *pph, uint32_t skmflag)
287 {
288 	struct __kern_quantum *kqum;
289 
290 	*pph = 0;
291 
292 	if (__improbable(bufcnt > pp->pp_max_frags)) {
293 		return EINVAL;
294 	}
295 
296 	if (__improbable((bufcnt != pp->pp_max_frags) &&
297 	    !PP_HAS_BUFFER_ON_DEMAND(pp))) {
298 		return EINVAL;
299 	}
300 
301 	kqum = SK_PTR_ADDR_KQUM(pp_alloc_packet(pp, (uint16_t)bufcnt, skmflag));
302 	if (__probable(kqum != NULL)) {
303 		*pph = SK_PTR_ENCODE(kqum, METADATA_TYPE(kqum),
304 		    METADATA_SUBTYPE(kqum));
305 	}
306 
307 	return (kqum != NULL) ? 0 : ENOMEM;
308 }
309 
310 errno_t
kern_pbufpool_alloc(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * pph)311 kern_pbufpool_alloc(const kern_pbufpool_t pp, const uint32_t bufcnt,
312     kern_packet_t *pph)
313 {
314 	return kern_pbufpool_alloc_common(pp, bufcnt, pph, SKMEM_SLEEP);
315 }
316 
317 errno_t
kern_pbufpool_alloc_nosleep(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * pph)318 kern_pbufpool_alloc_nosleep(const kern_pbufpool_t pp, const uint32_t bufcnt,
319     kern_packet_t *pph)
320 {
321 	return kern_pbufpool_alloc_common(pp, bufcnt, pph, SKMEM_NOSLEEP);
322 }
323 
324 static errno_t
kern_pbufpool_alloc_batch_common(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * array,uint32_t * size,alloc_cb_func_t cb,const void * ctx,uint32_t skmflag)325 kern_pbufpool_alloc_batch_common(const kern_pbufpool_t pp,
326     const uint32_t bufcnt, kern_packet_t *array, uint32_t *size,
327     alloc_cb_func_t cb, const void *ctx, uint32_t skmflag)
328 {
329 	if (__improbable(array == NULL || size == NULL || *size == 0 ||
330 	    bufcnt > pp->pp_max_frags || (cb == NULL && ctx != NULL))) {
331 		return EINVAL;
332 	}
333 
334 	if (__improbable((bufcnt != pp->pp_max_frags) &&
335 	    !PP_HAS_BUFFER_ON_DEMAND(pp))) {
336 		return EINVAL;
337 	}
338 
339 	return pp_alloc_packet_batch(pp, (uint16_t)bufcnt, array, size, TRUE,
340 	           cb, ctx, skmflag);
341 }
342 
343 errno_t
kern_pbufpool_alloc_batch(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * array,uint32_t * size)344 kern_pbufpool_alloc_batch(const kern_pbufpool_t pp, const uint32_t bufcnt,
345     kern_packet_t *array, uint32_t *size)
346 {
347 	return kern_pbufpool_alloc_batch_common(pp, bufcnt, array,
348 	           size, NULL, NULL, SKMEM_SLEEP);
349 }
350 
351 errno_t
kern_pbufpool_alloc_batch_callback(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * array,uint32_t * size,alloc_cb_func_t cb,const void * ctx)352 kern_pbufpool_alloc_batch_callback(const kern_pbufpool_t pp,
353     const uint32_t bufcnt, kern_packet_t *array, uint32_t *size,
354     alloc_cb_func_t cb, const void *ctx)
355 {
356 	return kern_pbufpool_alloc_batch_common(pp, bufcnt, array,
357 	           size, cb, ctx, SKMEM_SLEEP);
358 }
359 
360 errno_t
kern_pbufpool_alloc_batch_nosleep(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * array,uint32_t * size)361 kern_pbufpool_alloc_batch_nosleep(const kern_pbufpool_t pp,
362     const uint32_t bufcnt, kern_packet_t *array, uint32_t *size)
363 {
364 	return kern_pbufpool_alloc_batch_common(pp, bufcnt, array,
365 	           size, NULL, NULL, SKMEM_NOSLEEP);
366 }
367 
368 errno_t
kern_pbufpool_alloc_batch_nosleep_callback(const kern_pbufpool_t pp,const uint32_t bufcnt,kern_packet_t * array,uint32_t * size,alloc_cb_func_t cb,const void * ctx)369 kern_pbufpool_alloc_batch_nosleep_callback(const kern_pbufpool_t pp,
370     const uint32_t bufcnt, kern_packet_t *array, uint32_t *size,
371     alloc_cb_func_t cb, const void *ctx)
372 {
373 	return kern_pbufpool_alloc_batch_common(pp, bufcnt, array,
374 	           size, cb, ctx, SKMEM_NOSLEEP);
375 }
376 
377 void
kern_pbufpool_free(const kern_pbufpool_t pp,kern_packet_t ph)378 kern_pbufpool_free(const kern_pbufpool_t pp, kern_packet_t ph)
379 {
380 	pp_free_packet(pp, SK_PTR_ADDR(ph));
381 }
382 
383 void
kern_pbufpool_free_batch(const kern_pbufpool_t pp,kern_packet_t * array,uint32_t size)384 kern_pbufpool_free_batch(const kern_pbufpool_t pp, kern_packet_t *array,
385     uint32_t size)
386 {
387 	if (__improbable(array == NULL || size == 0)) {
388 		return;
389 	}
390 
391 	pp_free_packet_batch(pp, array, size);
392 }
393 
394 void
kern_pbufpool_free_chain(const kern_pbufpool_t pp,kern_packet_t chain)395 kern_pbufpool_free_chain(const kern_pbufpool_t pp, kern_packet_t chain)
396 {
397 	struct __kern_packet *pkt_chain = SK_PTR_ADDR_KPKT(chain);
398 
399 	VERIFY(pp == pkt_chain->pkt_qum.qum_pp);
400 	pp_free_packet_chain(pkt_chain, NULL);
401 }
402 
403 errno_t
kern_pbufpool_alloc_buffer(const kern_pbufpool_t pp,mach_vm_address_t * buf,kern_segment_t * sg,kern_obj_idx_seg_t * sg_idx)404 kern_pbufpool_alloc_buffer(const kern_pbufpool_t pp, mach_vm_address_t *buf,
405     kern_segment_t *sg, kern_obj_idx_seg_t *sg_idx)
406 {
407 	return pp_alloc_buffer(pp, buf, sg, sg_idx, 0);
408 }
409 
410 
411 errno_t
kern_pbufpool_alloc_buffer_nosleep(const kern_pbufpool_t pp,mach_vm_address_t * buf,kern_segment_t * sg,kern_obj_idx_seg_t * sg_idx)412 kern_pbufpool_alloc_buffer_nosleep(const kern_pbufpool_t pp,
413     mach_vm_address_t *buf, kern_segment_t *sg, kern_obj_idx_seg_t *sg_idx)
414 {
415 	return pp_alloc_buffer(pp, buf, sg, sg_idx, SKMEM_NOSLEEP);
416 }
417 
418 void
kern_pbufpool_free_buffer(const kern_pbufpool_t pp,mach_vm_address_t baddr)419 kern_pbufpool_free_buffer(const kern_pbufpool_t pp, mach_vm_address_t baddr)
420 {
421 	pp_free_buffer(pp, baddr);
422 }
423 
424 void
kern_pbufpool_destroy(kern_pbufpool_t pp)425 kern_pbufpool_destroy(kern_pbufpool_t pp)
426 {
427 	VERIFY(pp->pp_flags & PPF_EXTERNAL);
428 	pp_close(pp);
429 }
430 
431 errno_t
kern_pbufpool_alloc_buflet(const kern_pbufpool_t pp,kern_buflet_t * pbuf,bool attach_buffer)432 kern_pbufpool_alloc_buflet(const kern_pbufpool_t pp, kern_buflet_t *pbuf,
433     bool attach_buffer)
434 {
435 	return pp_alloc_buflet(pp, pbuf, SKMEM_SLEEP,
436 	           attach_buffer ? PP_ALLOC_BFT_ATTACH_BUFFER : 0);
437 }
438 
439 errno_t
kern_pbufpool_alloc_buflet_nosleep(const kern_pbufpool_t pp,kern_buflet_t * pbuf,bool attach_buffer)440 kern_pbufpool_alloc_buflet_nosleep(const kern_pbufpool_t pp,
441     kern_buflet_t *pbuf, bool attach_buffer)
442 {
443 	return pp_alloc_buflet(pp, pbuf, SKMEM_NOSLEEP,
444 	           attach_buffer ? PP_ALLOC_BFT_ATTACH_BUFFER : 0);
445 }
446 
447 errno_t
kern_pbufpool_alloc_batch_buflet(const kern_pbufpool_t pp,kern_buflet_t * pbuf_array,uint32_t * size,bool attach_buffer)448 kern_pbufpool_alloc_batch_buflet(const kern_pbufpool_t pp,
449     kern_buflet_t *pbuf_array, uint32_t *size, bool attach_buffer)
450 {
451 	return pp_alloc_buflet_batch(pp, (uint64_t *)pbuf_array, size, SKMEM_SLEEP,
452 	           attach_buffer ? PP_ALLOC_BFT_ATTACH_BUFFER : 0);
453 }
454 
455 errno_t
kern_pbufpool_alloc_batch_buflet_nosleep(const kern_pbufpool_t pp,kern_buflet_t * pbuf_array,uint32_t * size,bool attach_buffer)456 kern_pbufpool_alloc_batch_buflet_nosleep(const kern_pbufpool_t pp,
457     kern_buflet_t *pbuf_array, uint32_t *size, bool attach_buffer)
458 {
459 	return pp_alloc_buflet_batch(pp, (uint64_t *)pbuf_array, size, SKMEM_NOSLEEP,
460 	           attach_buffer ? PP_ALLOC_BFT_ATTACH_BUFFER : 0);
461 }
462 
463 void
kern_pbufpool_free_buflet(const kern_pbufpool_t pp,kern_buflet_t pbuf)464 kern_pbufpool_free_buflet(const kern_pbufpool_t pp, kern_buflet_t pbuf)
465 {
466 	return pp_free_buflet(pp, pbuf);
467 }
468