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

Function bpf_zerocopy_buffull

freebsd/net/bpf_zerocopy.c:356–372  ·  view source on GitHub ↗

* Notification from the BPF framework that a buffer in the store position is * rejecting packets and may be considered full. We mark the buffer as * immutable and assign to userspace so that it is immediately available for * the user process to access. */

Source from the content-addressed store, hash-verified

354 * the user process to access.
355 */
356void
357bpf_zerocopy_buffull(struct bpf_d *d)
358{
359 struct zbuf *zb;
360
361 KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF,
362 ("bpf_zerocopy_buffull: not in zbuf mode"));
363
364 zb = (struct zbuf *)d->bd_sbuf;
365 KASSERT(zb != NULL, ("bpf_zerocopy_buffull: zb == NULL"));
366
367 if ((zb->zb_flags & ZBUF_FLAG_ASSIGNED) == 0) {
368 zb->zb_flags |= ZBUF_FLAG_ASSIGNED;
369 zb->zb_header->bzh_kernel_len = d->bd_slen;
370 atomic_add_rel_int(&zb->zb_header->bzh_kernel_gen, 1);
371 }
372}
373
374/*
375 * Notification from the BPF framework that a buffer has moved into the held

Callers 1

bpf_buffullFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected