summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf_zerocopy.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-03-26 21:29:13 +0000
committerrwatson <rwatson@FreeBSD.org>2008-03-26 21:29:13 +0000
commit61a4ef5ea0bcc4da917d0a30700a54cd94c5eca2 (patch)
tree6015914f18926b1ed2afa318448a6d2bb1929429 /sys/net/bpf_zerocopy.c
parent5b9ac353f2c83508c030e2788217442c195752f1 (diff)
downloadFreeBSD-src-61a4ef5ea0bcc4da917d0a30700a54cd94c5eca2.zip
FreeBSD-src-61a4ef5ea0bcc4da917d0a30700a54cd94c5eca2.tar.gz
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
Diffstat (limited to 'sys/net/bpf_zerocopy.c')
-rw-r--r--sys/net/bpf_zerocopy.c5
1 files changed, 5 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud