From owner-svn-src-head@FreeBSD.ORG Fri Apr 13 18:12:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 599161065670; Fri, 13 Apr 2012 18:12:22 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 16ABD8FC0A; Fri, 13 Apr 2012 18:12:22 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 156DC7300B; Fri, 13 Apr 2012 20:31:38 +0200 (CEST) Date: Fri, 13 Apr 2012 20:31:38 +0200 From: Luigi Rizzo To: Adrian Chadd Message-ID: <20120413183138.GA88823@onelab2.iet.unipi.it> References: <201204131632.q3DGWXqj088240@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r234228 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 18:12:22 -0000 On Fri, Apr 13, 2012 at 10:59:59AM -0700, Adrian Chadd wrote: > On 13 April 2012 09:32, Luigi Rizzo wrote: > > Author: luigi > > Date: Fri Apr 13 16:32:33 2012 > > New Revision: 234228 > > URL: http://svn.freebsd.org/changeset/base/234228 > > > > Log: > > ?add the new memory allocator for netmap, which allocates memory > > ?in small clusters instead of one big contiguous chunk. > > ?This was already enabled in the previous commit. > > Hi, > > is there any scope to make this more generic? I can imagine other > parts of the system wanting to use this kind of ring buffer to > userland. well, it is already exported to userland through mmap. Perhaps you want to (a) have the buffers allocated on demand, and yes, this could also be done, either per-interface or globally. For instance the NIOCREGIF ioctl could specify how many buffers you want, and allocate them before you malloc. I still need to make up my mind on what is a good model for sharing buffers among different interfaces. cheers luigi