From owner-freebsd-net@FreeBSD.ORG Tue Aug 20 03:13:54 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5271FD3A; Tue, 20 Aug 2013 03:13:54 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06FEC2A67; Tue, 20 Aug 2013 03:13:53 +0000 (UTC) Received: from Julian-MBP3.local (etroy.elischer.org [121.45.226.51]) (authenticated bits=0) by vps1.elischer.org (8.14.7/8.14.6) with ESMTP id r7K3Dn7N003398 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 19 Aug 2013 20:13:51 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <5212DEE7.6060804@freebsd.org> Date: Tue, 20 Aug 2013 11:13:43 +0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Peter Grehan Subject: Re: M_NOFREE removal (was Re: svn commit: r254520 - in head/sys: kern sys) References: <201308191116.r7JBGsc6065793@svn.freebsd.org> <521256CE.6070706@FreeBSD.org> <5212587A.2080202@freebsd.org> <52128937.1010407@freebsd.org> <52129E55.30803@freebsd.org> In-Reply-To: <52129E55.30803@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, freebsd-net@freebsd.org, Andre Oppermann , Navdeep Parhar X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Aug 2013 03:13:54 -0000 On 8/20/13 6:38 AM, Peter Grehan wrote: > Hi Andre, > > (moving to the more appropriate freebsd-net) > >> I'm sorry for ambushing but this stuff has to be done. I have >> provided >> an alternative way of handling it and I'm happy to help you with your >> use case to make it good for you and to prevent the mbuf system from >> getting bloated and hackish again. > > Sure. I'm not really upset since my code wasn't too far along, but > with any API, you never know who consumers might be so it's always > worth being proactive about announcing it's removal. > >> Can you please describe your intended use of M_NOFREE to better >> understand >> the shortcomings of the current mbuf systems and the additional >> advantages >> of the M_NOFREE case? > > I was looking at something similar to Linux's vhost-net, where a > guest's virtio ring would be processed in-kernel. An mbuf chain with > external buffers would be used to pass guest tx buffer/len segments > directly into FreeBSD drivers. > > The intent of M_NOFREE was to avoid small mbuf allocations/frees in > what is a hot path. This code was intended to run at 10/40G. > > Note this code isn't really generic - it would require interfaces > to be 'owned' by the guest, except that direct PCI-level > pass-through wouldn't be needed. > > If there's an alternative to M_NOFREE, I'd be more than happy to > use that. I think an alternative would be a reference counted version. we used to have that and NetBSD had a quite sophisticated mbuf system where there were multiple owners of mbufs.. they wouldn't be freed until the last one freed it but I don't remember the details. > > later, > > Peter. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > >