From owner-p4-projects@FreeBSD.ORG Tue Mar 11 14:57:49 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 71CC51065697; Tue, 11 Mar 2008 14:57:49 +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 EDDB81065678 for ; Tue, 11 Mar 2008 14:57:48 +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 C203B8FC1B for ; Tue, 11 Mar 2008 14:57:48 +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 m2BEvmA3042005 for ; Tue, 11 Mar 2008 14:57:48 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 m2BEvmX5042003 for perforce@freebsd.org; Tue, 11 Mar 2008 14:57:48 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 11 Mar 2008 14:57:48 GMT Message-Id: <200803111457.m2BEvmX5042003@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 137403 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: Tue, 11 Mar 2008 14:57:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=137403 Change 137403 by rwatson@rwatson_cinnamon on 2008/03/11 14:57:12 Update README. Affected files ... .. //depot/projects/zcopybpf/README#5 edit Differences ... ==== //depot/projects/zcopybpf/README#5 (text+ko) ==== @@ -4,12 +4,12 @@ Reduce the number of system calls, copies, and even context switches in BPF by adding shared memory buffers between userspace and the kernel. Processes select zero-copy buffer mode, "donate" two buffers to the kernel, which are -used in place of the two kernel memory buffers in BPF. They can then use -BPF ioctls to query the state of the buffers, acknowledge/rotate them, -select on their being ready to read, etc. They can also use a solely shared -memory interface to check for new data and acknowledge buffers, so as load -increases, the number of system calls required to access the BPF stream -approaches zero. +used in place of the two kernel memory buffers in BPF. The process uses a +shared memory interface to check for new data and acknowledge buffers, but +can also use an ioctl to force early rotation of a buffer before it is full +(timeout), and select()/poll()/kevent() to wait for a buffer to fill. This +API allows the number of system calls used to access BPF data to go to zero +as the load increases. This implementation was created by Robert N. M. Watson under contract to Seccuris Inc., in collaboration with Christian S. J. Peron of Seccuris Inc, @@ -19,21 +19,20 @@ -------- Untar the tarball and drop the new src/ files into your src/ tree; this -should consist of two new .c files and two new .h files in src/sys/net/, and -two sample kernel config files that enable BPF_ZEROCOPY. +should consist of two new .c files and two new .h files in src/sys/net/. Apply the patch, which should modify a number of files in the kernel, especially src/sys/net and src/sys/conf, as well as in contrib/libpcap in order to teach the pcap library how to use zero-copy buffers. -Build a fresh kernel and install it, with options BPF_ZEROCOPY if you want -zero-copy buffer support. Build and install a fresh libpcap. +Build a fresh kernel and install it; build and install a fresh libpcap. -A new sysctl will be present, net.bpf.zerocopy_enable -- if it is set to 1 -(the default) then all new BPF sessions created by libpcap will use zero-copy -support. If set to 0, new sessions will use buffered reads. The -BPF_ZERO_COPY/BPF_ZEROCOPY environmental variables used in earlier prototypes -have now been removed in favour of this model. +A new sysctl will be present, net.bpf.zerocopy_enable -- when it is set to 1 +all new BPF sessions created by libpcap will use zero-copy support. If set +to 0, new sessions will use buffered reads. The BPF_ZEROCOPY kernel option +and BPF_ZERO_COPY/BPF_ZEROCOPY environmental variables used in earlier +prototypes have now been removed in favour of this run-time configuration +model. Notes -----