Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Sep 1998 12:23:11 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        hart@dotat.com
Cc:        freebsd-net@FreeBSD.ORG
Subject:   802.1Q VLAN support
Message-ID:  <199809301623.MAA16321@khavrinen.lcs.mit.edu>
In-Reply-To: <199809301459.AAA15771@at.dotat.com>
References:  <199809301459.AAA15771@at.dotat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 01 Oct 1998 00:29:32 +0930, Leigh Hart <hart@dotat.com> said:

[One list only, please!]

> I'm developing some single board computer applications that require
> 802.1Q vlan support (of the simplest kind) and in trawling through
> these list archives I found mention of if_vlan.c ...:

> This is about all I can find in the kernel-current source tree that
> relates to 802.1Q - there's little or no documentation I can find
> that tells me how to start using this code...(god help me if it's
> there and I havn't looked hard enough :[)

I don't even know whether it works at this point, because my 1Q switch
was an eval unit that I had to send back (and my PO for the real thing
has been held up by management).

The way you configure these things is by using the
SIOCSIFGENERIC-based ioctl interface defined in <net/if_vlan_var.h>.
I wrote a little hack which configures them, but I believe the
function should really be a part of ifconfig, which is why it's not
there in the source tree.  Beyond that, UTSL.

There is at present no support for multicast or promiscuous mode, both
of which would need to be fixed in order for this code to be really
useful.  (The particular application I had in mind doesn't require
those functions.)

> It should be noted that if FreeBSD is going to support this in
> any sensible manner, it should start including an option for
> changing ETHER_MAX_LEN in the kernel, either real time or at
> compile time...

Not all hardware and drivers are capable of supporting larger packets.
The correct thing is, for those drivers which are able, to so indicate
by setting their ifi_hdrlen to sizeof(struct ether_vlan_header) rather
than sizeof(struct ether_header).  You will note the following code
in vlan_config:

        if (p->if_data.ifi_hdrlen == sizeof(struct ether_vlan_header))
                ifv->ifv_if.if_mtu = p->if_mtu;
        else
                ifv->ifv_if.if_mtu = p->if_data.ifi_mtu - EVL_ENCAPLEN;

I had originally contemplated implementing this functionality with
subinterfaces (a la Slowaris), but expediency quickly won out, so I
did the thing which avoided any painful work or interface changes.

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message



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