From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 6 13:33:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66C1116A4D1 for ; Tue, 6 Jul 2004 13:33:03 +0000 (GMT) Received: from ms007msg.fastweb.it (ms007msg.fastweb.it [213.140.2.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id D248C43D5C for ; Tue, 6 Jul 2004 13:33:02 +0000 (GMT) (envelope-from thefly@acaro.org) Received: from tyler (1.10.185.81) by ms007msg.fastweb.it (7.0.028) id 40D059290024FF3A; Tue, 6 Jul 2004 15:33:00 +0200 Received: by tyler (Postfix, from userid 1000) id 527DF1AB494; Tue, 6 Jul 2004 15:36:40 +0200 (CEST) Date: Tue, 6 Jul 2004 15:36:40 +0200 From: thefly To: Don Bowman Message-ID: <20040706133640.GB5922@tyler> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: X-Editor: VIM - Vi IMproved 6.2 (2003 Jun 1, compiled May 20 2004 09:35:32) X-OS: Debian GNU/Linux 2.6.6 i686 User-Agent: Mutt/1.5.6+20040523i cc: freebsd-hackers@freebsd.org Subject: Re: ZEROCOPY between kernel and userland X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 13:33:03 -0000 --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable could you point me pls to some code of that? To me read-only access is ok, userspace doesn't need to write anything on it, kernelspace does. But what about locking issues between userspace read access and kernelspace write access? On Tue, Jul 06, 2004 at 09:22:39AM -0400, Don Bowman wrote: > From: thefly [mailto:thefly@acaro.org] > > Hello everybody, i'm writing a netgraph module to get some stats about > > the network traffic. Actually i have to pass all the data gathered all > > in one piece, to the process which asks me for it. The client should > > work like this in userland: > >=20 > > int * pointer; > >=20 > > ioctl(dev, MY_COMMAND, pointer); > >=20 > > after this pointer points to the right memory area. The array=20 > > to pass is > > about 500Kb, so copying with copyout() would be too expensive, moving > > the array from kernel's addrespace to process's address space would be > > fast.=20 > > The question is: what's the actual API to do that, if there's any, in > > freebsd 5? >=20 > We did a device, and 'mmap' some shared memory between the two. > The user space has read-only access. >=20 >=20 >=20 --=20 Claudio "thefly" Martella thefly@acaro.org GNU/PG keyid: 0x8EA95625 --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFA6qroygeBqo6pViURAtdaAJ9WrJ3u5dIyalWizEudAhi5DewxnQCgr6N1 EWf16pdNTjDW0aBUvtR/FXE= =iRUV -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--