Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Sep 2006 12:03:53 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Andre Oppermann <andre@freebsd.org>
Cc:        freebsd-net@freebsd.org, yar@comp.chem.msu.su, freebsd-arch@freebsd.org
Subject:   Re: Moving ethernet VLAN tags into the mbuf packet header (from mtags)
Message-ID:  <45006D19.4040607@elischer.org>
In-Reply-To: <450035AD.3040600@freebsd.org>
References:  <450035AD.3040600@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Andre Oppermann wrote:

> With the recent addition of a 16bit field for TSO into the mbuf packet
> header we've got 16bits left over.  I've reserved these bits for the
> ethernet VLAN tagging of packet to do away with the allocated mbuf mtag.
>
> The change is rather mechanical.  Patch available here:
>
>  http://people.freebsd.org/~andre/vlan_pkthdr-20060907.diff
>
> The big advantage is that we don't have to do a UMA zalloc for very 
> incoming
> vlan tagged packet.  The m_pkthdr.ether_vlan field is always present 
> and its
> validity depends on the M_VLANTAG flag.
>
> Testing & reviews encouraged. :-)
>
You are adding these fields to the mbuf pktheader in an unconditional 
manner.
This means that even protocols that have no need or understanding of 
these fields are paying the price.
I understand that at this point in history 99.999% of packets are for 
protocols for which these make sense
but I wonder if we should consider whether mbufs should have some 
'protocol specific'  fields.

mbuf tags are one way of doing this but maybe we can work out some 
method of doing this that doesn't
require as much overhead (no extra allocations). Possibly by making some 
scheme whereby tags
are allocated as part of the mbuf. I would suggest that each protocol 
have its own mbuf allocator that
does preallocations according to what the active protocols might require.

just vague ideas.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45006D19.4040607>