Re: cvs commit: src/sys/dev/bge if_bge.c

From: Peter Jeremy <>
Date: Wed, 20 Sep 2006 17:26:26 +1000
On Tue, 2006-Sep-19 15:35:06 -0400, Jung-uk Kim wrote:
[VLAN tagging]
>Why don't we just fake it up from ether_input() and pass it to 
>BPF_MTAP() instead of 'teaching' bpf?  I think it is more logical 
>thing to do.

As Andre points out, this negates the benefit of IFCAP_VLAN_HWTAGGING.

In addition, the code necessary to correctly re-insert the VLAN tag
(to provide a fully valid mbuf chain for further processing) will be
larger and slower than the code necessary to kludge a mbuf that is
adequate for bpf_filter().  bpf_mtap2() provides an example of
kludging an mbuf header to allow data to be pre-pended.  The code to
kludge up the VLAN tag insertion would be similar (though somewhat
more complex).

Overall, I believe this approach is probably preferable to just
disabling hardware VLAN tagging if there is a bpf filter.

Peter Jeremy

Received on Wed Sep 20 2006 - 07:26:56 UTC