From owner-cvs-src@FreeBSD.ORG Mon Apr 7 02:51:01 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26F1F1065673; Mon, 7 Apr 2008 02:51:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 23D6E8FC1B; Mon, 7 Apr 2008 02:51:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m372p1Bm055614; Mon, 7 Apr 2008 02:51:01 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m372p02x055613; Mon, 7 Apr 2008 02:51:00 GMT (envelope-from rwatson) Message-Id: <200804070251.m372p02x055613@repoman.freebsd.org> From: Robert Watson Date: Mon, 7 Apr 2008 02:51:00 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/net bpf.c bpf_zerocopy.c bpf_zerocopy.h src/share/man/man4 bpf.4 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2008 02:51:01 -0000 rwatson 2008-04-07 02:51:00 UTC FreeBSD src repository Modified files: sys/net bpf.c bpf_zerocopy.c bpf_zerocopy.h share/man/man4 bpf.4 Log: Maintain and observe a ZBUF_FLAG_IMMUTABLE flag on zero-copy BPF buffer kernel descriptors, which is used to allow the buffer currently in the BPF "store" position to be assigned to userspace when it fills, even if userspace hasn't acknowledged the buffer in the "hold" position yet. To implement this, notify the buffer model when a buffer becomes full, and check that the store buffer is writable, not just for it being full, before trying to append new packet data. Shared memory buffers will be assigned to userspace at most once per fill, be it in the store or in the hold position. This removes the restriction that at most one shared memory can by owned by userspace, reducing the chances that userspace will need to call select() after acknowledging one buffer in order to wait for the next buffer when under high load. This more fully realizes the goal of zero system calls in order to process a high-speed packet stream from BPF. Update bpf.4 to reflect that both buffers may be owned by userspace at once; caution against assuming this. Revision Changes Path 1.50 +8 -8 src/share/man/man4/bpf.4 1.191 +50 -10 src/sys/net/bpf.c 1.4 +73 -4 src/sys/net/bpf_zerocopy.c 1.2 +2 -0 src/sys/net/bpf_zerocopy.h