From owner-p4-projects@FreeBSD.ORG Sun Dec 23 22:29:33 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5BE3316A41B; Sun, 23 Dec 2007 22:29:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBFC516A41A for ; Sun, 23 Dec 2007 22:29:32 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F2F2813C467 for ; Sun, 23 Dec 2007 22:29:32 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBNMTWNl055348 for ; Sun, 23 Dec 2007 22:29:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBNMTWmn055345 for perforce@freebsd.org; Sun, 23 Dec 2007 22:29:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 23 Dec 2007 22:29:32 GMT Message-Id: <200712232229.lBNMTWmn055345@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 131492 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2007 22:29:33 -0000 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_ */