Netmap ixgbe stripping Vlan tags

Andre Oppermann andre at freebsd.org
Fri Aug 23 07:02:16 UTC 2013


On 23.08.2013 00:36, Harika Tandra wrote:
> Hi all,
>
> I am running Netmap with "intel 10G 82598EB" card in promiscuous mode.
> While capturing packets via Netmap the driver is stripping off Vlan tags.
> I tested my setup, I am able to see Vlan tags when the same card is in promiscuous
> mode without Netmap.
>
> This maybe due to the netmap related changes to the device driver code.
> But I don't know much about drivers. I would appreciate any help or pointer
> regarding this.

This is standard behavior in FreeBSD drivers where the vlan header is removed
and the vlan tag is placed in an mbuf field.  Together with netmap it doesn't
make sense of course and the driver should disable it when switching to netmap
mode.

The general usefulness of hardware vlan tag stripping/insertion is debatable as
it doesn't gain much, if anything, and was intended for an entirely different
purpose, namely to help the windows kernel over its total lack of vlan awareness.
There an interface can be put into vlan mode where it simply listens to just one
vlan as if it was native.  The driver then delivers normal ethernet frames with
vlan tags removed to the kernel and the other way around on send.  It makes a
lot of sense when the kernel isn't vlan aware because inserting and removing the
vlan tag is painful then.

In FreeBSD we don't have that problem as the kernel is fully vlan aware and can
easily parse and insert the vlan tag itself at the same time it copies in the
normal ethernet header.  Packets coming down the stack have sufficient reserved
leading space to add a couple of (stacked) vlan tags.  Packets going up the stack
can just as easily be parsed for vlan tags as well.

It can be argued that in FreeBSD hardware vlan tag insert/removal is an unnecessary
misfeature and only complicates things.  Especially in the context of multi-vlan
stacking.  Doing it in software would be in fact just as fast remove a bit of code
from the drivers.

-- 
Andre



More information about the freebsd-net mailing list