From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 15 23:13:52 2014 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53FBB5CE; Sat, 15 Mar 2014 23:13:52 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24A83F98; Sat, 15 Mar 2014 23:13:51 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WOxm2-000PBc-SV; Sat, 15 Mar 2014 23:13:51 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s2FNDm1O065578; Sat, 15 Mar 2014 17:13:48 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+EB8Bs795G1dlRHIYWuERh Subject: Re: mbuf question From: Ian Lepore To: Hooman Fazaeli In-Reply-To: <5324DAC0.9020508@gmail.com> References: <53230214.7010501@gmail.com> <532405B7.2020007@gmail.com> <96659837-1FDC-421D-A339-87104A0075C7@FreeBSD.org> <5324D669.804@gmail.com> <5324DAC0.9020508@gmail.com> Content-Type: text/plain; charset="us-ascii" Date: Sat, 15 Mar 2014 17:13:48 -0600 Message-ID: <1394925228.1149.558.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers , Rui Paulo X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 23:13:52 -0000 On Sun, 2014-03-16 at 03:27 +0430, Hooman Fazaeli wrote: > On 3/16/2014 3:08 AM, Hooman Fazaeli wrote: > > On 3/15/2014 9:09 PM, Rui Paulo wrote: > >> On 15 Mar 2014, at 00:48, Hooman Fazaeli wrote: > >>> What about the area started at (m->m_ext + 1) whose size is (MHLEN - sizeof(struct m_ext))? > >>> Is there any known uses of this area in the stack? > >> I'm not sure what you mean by m_ext + 1, but what are you trying to do? If you need to tag an mbuf, use mbuf tags. > >> > >> -- > >> Rui Paulo > > > > (m->m_ext+ 1) points to the (unused?) area in m->m_dat.MHright after the space occupied by m_ext. > > I am well aware of mbuf tags. I was just thinking toavoid the overhead of m_tag allocation/de-allocation > > and store my little piece of data directly in mbufs. > > > sorry for my mistake. (m->m_ext + 1) is a totally wrong notation as m_ext is a struct. > The area I was talking about is (m->m_pktdat + sizeof(m->m_ext)). > Is this part of mbuf+cluster has any known uses? can we use it to store some > data about the packet (instead of using mbuf tags)? It sounds dangerous to put data there and assume that there will never be kernel changes in the future that starts using that area. How about an optimization that puts tags in that area when it's available to avoid the allocation overhead? I don't know much about the network code, so maybe that's not a sensible idea. -- Ian