Date: Sun, 23 Dec 2007 22:29:32 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 131492 for review Message-ID: <200712232229.lBNMTWmn055345@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131492 Change 131492 by rwatson@rwatson_cinnamon on 2007/12/23 22:29:20 As is the case with some other per-buffer-model functions, don't enter the zerocopy code for the unsupported uiomove method. Affected files ... .. //depot/projects/zcopybpf/src/sys/net/bpf.c#28 edit .. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#22 edit .. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.h#9 edit Differences ... ==== //depot/projects/zcopybpf/src/sys/net/bpf.c#28 (text+ko) ==== @@ -265,18 +265,9 @@ bpf_uiomove(struct bpf_d *d, caddr_t buf, u_int len, struct uio *uio) { - switch (d->bd_bufmode) { - case BPF_BUFMODE_BUFFER: - return (bpf_buffer_uiomove(d, buf, len, uio)); - -#ifdef BPF_ZEROCOPY - case BPF_BUFMODE_ZBUF: - return (bpf_zerocopy_uiomove(d, buf, len, uio)); -#endif - - default: - panic("bpf_buf_uiomove"); - } + if (d->bd_bufmode != BPF_BUFMODE_BUFFER) + return (EOPNOTSUPP); + return (bpf_buffer_uiomove(d, buf, len, uio)); } static int ==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#22 (text+ko) ==== @@ -403,21 +403,6 @@ } /* - * read() is unimplemented for zero-copy BPF buffers, even though in - * principle you could combine the two semantics. - */ -int -bpf_zerocopy_uiomove(struct bpf_d *d, caddr_t buf, u_int len, - struct uio *uio) -{ - - KASSERT(d->bd_bufmode == BPF_BUFMODE_ZBUF, - ("bpf_zerocopy_uiomove: not in zbuf mode")); - - return (EOPNOTSUPP); -} - -/* * Acknowledge reading the buffer without performing read(). We accept an * argument primarily so that we can validate that user space has the right * idea, helping to catch application bugs faster if the application's sense ==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.h#9 (text+ko) ==== @@ -55,7 +55,5 @@ struct bpf_zbuf *bz); int bpf_zerocopy_ioctl_setzbuf(struct thread *td, struct bpf_d *d, struct bpf_zbuf *bz); -int bpf_zerocopy_uiomove(struct bpf_d *d, caddr_t buf, u_int len, - struct uio *uio); #endif /* !_NET_BPF_ZEROCOPY_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712232229.lBNMTWmn055345>