]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Currently, drivers that support hardware offload of VLAN tag
authorcsjp <csjp@FreeBSD.org>
Sat, 18 Nov 2006 23:17:22 +0000 (23:17 +0000)
committercsjp <csjp@FreeBSD.org>
Sat, 18 Nov 2006 23:17:22 +0000 (23:17 +0000)
commit5aa5d3eb87ef22b838901d976a898e7826d9032f
tree8daa14e003cb59b6b1fab70f6be511048b5bb81d
parentaee58e2da0c688785939850d85b12b57fbb12396
Currently, drivers that support hardware offload of VLAN tag
processing are forced to toggle this functionality when the card
is put in and out of promiscuous mode.  The main reason for this
is because the hardware strips the VLAN tag, making it impossible
for the tag information to show up in network diagnostic tools like
tcpdump(1).

This change introduces ether_vlan_mtap(), which is called if the
mbuf has M_VLANTAG set.  VLAN information is extracted from the
mbuf and inserted into a stack allocated ether vlan header which
is then inserted through the bpf machinery via bpf_mtap2(). The
original mbuf's data pointer and lengths are temporarily adjusted
to eliminate the original Ethernet header for the duration of the
tap operation. This should have no long term effects on the mbuf.

Also, define a new macro, ETHER_BPF_MTAP which should be used
by drivers which support hardware offload of VLAN tag processing.

The fixes for the relevant drivers will follow shortly.

Discussed with: rwatson, andre, jhb (and others)
Much feedback from: sam, ru
MFC after: 1 month [1]

[1] The version that is eventually MFCed will be somewhat
    different then this, as there has been significant work
    done to the VLAN code in HEAD.
sys/net/ethernet.h
sys/net/if_ethersubr.c