* 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. */
| 354 | * the user process to access. |
| 355 | */ |
| 356 | void |
| 357 | bpf_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 |