From 61a4ef5ea0bcc4da917d0a30700a54cd94c5eca2 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 26 Mar 2008 21:29:13 +0000 Subject: Add a comment explaining that we initialize the 'a' buffer for zero-copy to the store buffer position on the BPF descriptor, and the 'b' buffer as the free buffer in order to fill them in the order documented in bpf(4). MFC after: 4 months Suggested by: csjp --- sys/net/bpf_zerocopy.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/net/bpf_zerocopy.c') diff --git a/sys/net/bpf_zerocopy.c b/sys/net/bpf_zerocopy.c index 1fa07e2..d746bda 100644 --- a/sys/net/bpf_zerocopy.c +++ b/sys/net/bpf_zerocopy.c @@ -496,6 +496,11 @@ bpf_zerocopy_ioctl_setzbuf(struct thread *td, struct bpf_d *d, zbuf_free(zbb); return (EINVAL); } + + /* + * Point BPF descriptor at buffers; initialize sbuf as zba so that + * it is always filled first in the sequence, per bpf(4). + */ d->bd_fbuf = (caddr_t)zbb; d->bd_sbuf = (caddr_t)zba; d->bd_slen = 0; -- cgit v1.1