From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 6 13:22:45 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 0306F16A4CE for ; Tue, 6 Jul 2004 13:22:45 +0000 (GMT) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 765B643D5A for ; Tue, 6 Jul 2004 13:22:44 +0000 (GMT) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2657.72) id <312YZ7QC>; Tue, 6 Jul 2004 09:22:43 -0400 Message-ID: From: Don Bowman To: 'thefly' , freebsd-hackers@freebsd.org Date: Tue, 6 Jul 2004 09:22:39 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" 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:22:45 -0000 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: > > int * pointer; > > ioctl(dev, MY_COMMAND, pointer); > > after this pointer points to the right memory area. The array > 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. > The question is: what's the actual API to do that, if there's any, in > freebsd 5? We did a device, and 'mmap' some shared memory between the two. The user space has read-only access.