From owner-freebsd-net@FreeBSD.ORG Wed Aug 21 21:14:56 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 C9B13E7C; Wed, 21 Aug 2013 21:14:56 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8E5722B87; Wed, 21 Aug 2013 21:14:56 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id hz10so1253456pad.30 for ; Wed, 21 Aug 2013 14:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=DWm3Wh0YqbnMctRflqfwf5v/AnalrbJfsfITAs15KEw=; b=w8Zq1Fo/yspy0TXZoMlCC5gedchSSqwHgWa78w+Vec6eVOKnP1Bmxi2EDl+CkF4fPD +0QsOqSm0VrZa0JesqC9/EtHgtATuoMS6AnpESe5+WsOXtMz7nSimHRxTavv1qLn1WuX nIpK6uZ/D18LCa+P/PRwSuKh4LRULBLevZpYxK1YyvaZwcuUdFo0SGd7w6W9Y/wHo058 9B11iEnvNtNbaZOa/kbCpAMIpqJssamCOC76hjhTW/wxaqloNEkr2+TC9rfngKtczNPu NWmxf3yAmNkrDsT4wBUBqEfRn55CDY2NhlvwIsJ3D2xnHz2m2psz7dE3F4G3NYRGyJuI t8Bg== X-Received: by 10.66.254.194 with SMTP id ak2mr1700441pad.167.1377119695573; Wed, 21 Aug 2013 14:14:55 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id oj6sm12169445pab.9.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 14:14:54 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <52152D96.5000308@FreeBSD.org> Date: Wed, 21 Aug 2013 14:13:58 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130819 Thunderbird/17.0.8 MIME-Version: 1.0 To: Andre Oppermann 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> <5214D7E8.1080106@freebsd.org> <5214ED19.40907@FreeBSD.org> <5215047C.8080107@freebsd.org> <521505A3.4020103@FreeBSD.org> <52151368.40803@freebsd.org> <52151799.3020809@FreeBSD.org> <52152697.9070500@freebsd.org> <5215288E.6070708@FreeBSD.org> <52152A24.8030109@freebsd.org> In-Reply-To: <52152A24.8030109@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, freebsd-net@freebsd.org, Peter Grehan 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: Wed, 21 Aug 2013 21:14:56 -0000 On 08/21/13 13:59, Andre Oppermann wrote: > On 21.08.2013 22:52, Navdeep Parhar wrote: >> It is most flexible to let M_NOFREE work without any assumptions >> attached (must be M_EXT, etc.) So I still prefer my patch to this. If >> you don't have any strong preferences may I commit that one instead? > > I don't mind having your patch. Though I don't see how it possibly > can't leak > mbufs if they are not M_EXT. > Interfaces that are guaranteed to consume and free an mbuf (instead of potentially queueing it somewhere) can be handed M_NOFREE mbufs with inline data, and the caller knows that it is always safe to free the underlying storage after the call. Clearly, caution is required. But let's not completely prohibit use cases like these. Regards, Navdeep