From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 16 21:21:07 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 5DD23BC3; Sun, 16 Mar 2014 21:21:07 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B2F0696; Sun, 16 Mar 2014 21:21:06 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s2GLL6Q6090996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 16 Mar 2014 14:21:06 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s2GLL6hE090995; Sun, 16 Mar 2014 14:21:06 -0700 (PDT) (envelope-from jmg) Date: Sun, 16 Mar 2014 14:21:06 -0700 From: John-Mark Gurney To: Hooman Fazaeli Subject: Re: mbuf question Message-ID: <20140316212106.GF32089@funkthat.com> Mail-Followup-To: Hooman Fazaeli , Rui Paulo , FreeBSD Hackers , Ian Lepore References: <53230214.7010501@gmail.com> <532405B7.2020007@gmail.com> <96659837-1FDC-421D-A339-87104A0075C7@FreeBSD.org> <5324D669.804@gmail.com> <5324DAC0.9020508@gmail.com> <1394925228.1149.558.camel@revolution.hippie.lan> <5325BC99.2060703@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5325BC99.2060703@gmail.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 16 Mar 2014 14:21:06 -0700 (PDT) Cc: FreeBSD Hackers , Rui Paulo , Ian Lepore 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: Sun, 16 Mar 2014 21:21:07 -0000 Hooman Fazaeli wrote this message on Sun, Mar 16, 2014 at 19:30 +0430: > On 3/16/2014 9:01 AM, Rui Paulo wrote: > >On 15 Mar 2014, at 16:13, Ian Lepore wrote: > >>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. > >The problem with mbuf tags is that they are not fixed size, so they can't > >easily use UMA (although they use malloc which is backed by UMA, but the > >performance is lower). If tags are not an option, I suppose Hooman could > >use fields from struct pkthdr, but this might come with risks if the code > >is not in the tree. > > > >-- > >Rui Paulo > > pkthdrdoes not seem to have any spare area for custom use. > > I wanted to add L2 filtering capabilities to pf(4) firewall, and the first > problem > I faced was how to make L2 headers (src/dst ethernet addresses) available > to pf. > That (seemingly) unused part of mbuf+cluster seemed a good place to store > ethernet > headers. > > We already have vlan tag (a sort of L2 data) in pkthdr. What do you think > about the idea of having a dedicated area for L2 information in mbufs? Why do we need this info in another location? Isn't this already in the packet? How else did we get it then? Or are you dealing w/ the fact that the L2 information was stripped by an upper layer, and if that is the case, shouldn't you be getting the packet soon then? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."