From owner-p4-projects@FreeBSD.ORG Wed Feb 7 11:48:12 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD6E016A406; Wed, 7 Feb 2007 11:48:11 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E49E16A401 for ; Wed, 7 Feb 2007 11:48:04 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 2DA2B13C442 for ; Wed, 7 Feb 2007 11:48:04 +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.13.6/8.13.6) with ESMTP id l17Bm40O073851 for ; Wed, 7 Feb 2007 11:48:04 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l17Bm3Xk073839 for perforce@freebsd.org; Wed, 7 Feb 2007 11:48:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 7 Feb 2007 11:48:03 GMT Message-Id: <200702071148.l17Bm3Xk073839@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 114172 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: Wed, 07 Feb 2007 11:48:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=114172 Change 114172 by rwatson@rwatson_cinnamon on 2007/02/07 11:48:03 Update bpf(4) man page for BIOCROTZBUF ioctl, and improve the documentation about buffers a bit. The man page is not yet updated for the shared memory header and ACK model. Affected files ... .. //depot/projects/zcopybpf/src/share/man/man4/bpf.4#3 edit Differences ... ==== //depot/projects/zcopybpf/src/share/man/man4/bpf.4#3 (text+ko) ==== @@ -425,20 +425,37 @@ .Vt bz_buflen must be filled out. .It Dv BIOCGETZMAX -.Pq Li u_int +.Pq Li size_t Get the largest individual zero-copy buffer size allowed. As two buffers are used in zero-copy buffer mode, the limit (in practice) is -twice this size. +twice the returned size. As zero-copy buffers consume kernel address space, conservative selection of buffer size, especially when there are multiple .Nm descriptors in use on 32-bit systems. .It Dv BIOCGETZNEXT +.It Dv BIOCROTZBUF .Pq Li struct bpf_zbuf -Get the buffer pointer of the next completed zero-copy buffer and length of -pending data, or +Get the buffer pointer and length of the next zero-copy buffer buffer ready +for userspace use, or +.Dv NULL +if there is no pending buffer. +.Pp +.Dv BIOCGETZNEXT +queries for the next completely filled buffer ready for immediate use, +returning NULL if there are only empty or partially filled buffers available. +.Pp +.Dv BIOCROTZBUF +queries for a filled buffer, but in the event there is only a partially +filled buffer, will make that buffer available for userspace to use +immediately. +This allows consumers of zero-copy buffering to implement timeouts and +retrieve partially filled buffers. +.Dv BIOCROTZBUF +will return .Dv NULL -if there is no pending completed buffer. +only if no data is present in either of the zero-copy buffers. +.Pp Only the .Vt bz_bufa and