179458d0bSYaroslav Tykhiy.\" 279458d0bSYaroslav Tykhiy.\" Copyright (c) 2001 Yar Tikhiy 379458d0bSYaroslav Tykhiy.\" All rights reserved. 479458d0bSYaroslav Tykhiy.\" 579458d0bSYaroslav Tykhiy.\" Redistribution and use in source and binary forms, with or without 679458d0bSYaroslav Tykhiy.\" modification, are permitted provided that the following conditions 779458d0bSYaroslav Tykhiy.\" are met: 879458d0bSYaroslav Tykhiy.\" 1. Redistributions of source code must retain the above copyright 979458d0bSYaroslav Tykhiy.\" notice, this list of conditions and the following disclaimer. 1079458d0bSYaroslav Tykhiy.\" 2. Redistributions in binary form must reproduce the above copyright 1179458d0bSYaroslav Tykhiy.\" notice, this list of conditions and the following disclaimer in the 1279458d0bSYaroslav Tykhiy.\" documentation and/or other materials provided with the distribution. 1379458d0bSYaroslav Tykhiy.\" 1479458d0bSYaroslav Tykhiy.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1579458d0bSYaroslav Tykhiy.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1679458d0bSYaroslav Tykhiy.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1779458d0bSYaroslav Tykhiy.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1879458d0bSYaroslav Tykhiy.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1979458d0bSYaroslav Tykhiy.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2079458d0bSYaroslav Tykhiy.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2179458d0bSYaroslav Tykhiy.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2279458d0bSYaroslav Tykhiy.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2379458d0bSYaroslav Tykhiy.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2479458d0bSYaroslav Tykhiy.\" SUCH DAMAGE. 2579458d0bSYaroslav Tykhiy.\" 2679458d0bSYaroslav Tykhiy.\" $FreeBSD$ 2779458d0bSYaroslav Tykhiy.\" 2820d0f922SMarius Strobl.Dd August 28, 2005 2979458d0bSYaroslav Tykhiy.Dt VLAN 4 3079458d0bSYaroslav Tykhiy.Os 3179458d0bSYaroslav Tykhiy.Sh NAME 3279458d0bSYaroslav Tykhiy.Nm vlan 3386e3186eSTom Rhodes.Nd "IEEE 802.1Q VLAN network interface" 3479458d0bSYaroslav Tykhiy.Sh SYNOPSIS 3516d78bb8STom RhodesTo compile this driver into the kernel, 3616d78bb8STom Rhodesplace the following lines in your 3790296834STom Rhodeskernel configuration file: 3886e3186eSTom Rhodes.Bd -ragged -offset indent 3986e3186eSTom Rhodes.Cd "device miibus" 4086e3186eSTom Rhodes.Cd "device vlan" 4186e3186eSTom Rhodes.Ed 4286e3186eSTom Rhodes.Pp 4316d78bb8STom RhodesAlternatively, to load the driver as a 4416d78bb8STom Rhodesmodule at boot time, place the following line in 4586e3186eSTom Rhodes.Xr loader.conf 5 : 4686e3186eSTom Rhodes.Bd -literal -offset indent 4786e3186eSTom Rhodesif_vlan_load="YES" 4886e3186eSTom Rhodes.Ed 4979458d0bSYaroslav Tykhiy.Sh DESCRIPTION 5079458d0bSYaroslav TykhiyThe 5179458d0bSYaroslav Tykhiy.Nm 5279458d0bSYaroslav Tykhiydriver demultiplexes frames tagged according to 5379458d0bSYaroslav Tykhiythe IEEE 802.1Q standard into logical 5479458d0bSYaroslav Tykhiy.Nm 5579458d0bSYaroslav Tykhiynetwork interfaces, which allows routing/bridging between 5679458d0bSYaroslav Tykhiymultiple VLANs through a single switch trunk port. 5779458d0bSYaroslav Tykhiy.Pp 580d35b35aSBrooks DavisEach 590d35b35aSBrooks Davis.Nm 600d35b35aSBrooks Davisinterface is created at runtime using interface cloning. 610d35b35aSBrooks DavisThis is 620d35b35aSBrooks Davismost easily done with the 630d35b35aSBrooks Davis.Xr ifconfig 8 640d35b35aSBrooks Davis.Cm create 650d35b35aSBrooks Daviscommand or using the 660d35b35aSBrooks Davis.Va cloned_interfaces 670d35b35aSBrooks Davisvariable in 680d35b35aSBrooks Davis.Xr rc.conf 5 . 690d35b35aSBrooks Davis.Pp 7079458d0bSYaroslav TykhiyTo function, a 7179458d0bSYaroslav Tykhiy.Nm 7279458d0bSYaroslav Tykhiyinterface must be assigned a parent interface and 7379458d0bSYaroslav Tykhiynumeric VLAN tag using 7479458d0bSYaroslav Tykhiy.Xr ifconfig 8 . 7579458d0bSYaroslav TykhiyA single parent can be assigned to multiple 7679458d0bSYaroslav Tykhiy.Nm 7779458d0bSYaroslav Tykhiyinterfaces provided they have different tags. 78c5f116aaSChristian BruefferThe parent interface is likely to be an Ethernet card connected 7979458d0bSYaroslav Tykhiyto a properly configured switch port. 8079458d0bSYaroslav TykhiyThe VLAN tag should match one of those set up in the switched 8179458d0bSYaroslav Tykhiynetwork. 82f41b145cSYaroslav Tykhiy.Sh HARDWARE 8379458d0bSYaroslav TykhiyThe 8479458d0bSYaroslav Tykhiy.Nm 85f41b145cSYaroslav Tykhiydriver supports efficient operation over parent interfaces that can provide 86f41b145cSYaroslav Tykhiyhelp in processing VLANs. 87f41b145cSYaroslav TykhiySuch interfaces are automatically recognized by their capabilities. 88f41b145cSYaroslav TykhiyDepending on the level of sophistication found in a physical 89f41b145cSYaroslav Tykhiyinterface, it may do full VLAN processing or just be able to 90f41b145cSYaroslav Tykhiyreceive and transmit frames exceeding the maximum Ethernet frame size 91f41b145cSYaroslav Tykhiyby the length of a 802.1Q header. 92f41b145cSYaroslav TykhiyThe capabilities may be user-controlled by the respective parameters to 93f41b145cSYaroslav Tykhiy.Xr ifconfig 8 , 94f41b145cSYaroslav Tykhiy.Cm vlanhwtag 95f41b145cSYaroslav Tykhiyand 96f41b145cSYaroslav Tykhiy.Cm vlanmtu . 97f41b145cSYaroslav TykhiyHowever, a physical interface is not obliged to react to them: 98f41b145cSYaroslav TykhiyIt may have either capability enabled permanently without 99f41b145cSYaroslav Tykhiya way to turn it off. 100f41b145cSYaroslav TykhiyThe whole issue is very specific to a particular device and its driver. 101f41b145cSYaroslav Tykhiy.Pp 102f41b145cSYaroslav TykhiyBy now, the list of physical interfaces able of full VLAN processing 103f41b145cSYaroslav Tykhiyin the hardware is limited to the following devices: 1042ba5fff2SYaroslav Tykhiy.Xr bge 4 , 105a5a8905cSYaroslav Tykhiy.Xr em 4 , 106317bb722SYaroslav Tykhiy.Xr ixgb 4 , 10779458d0bSYaroslav Tykhiy.Xr nge 4 , 108d57916b1SYaroslav Tykhiy.Xr re 4 , 10979458d0bSYaroslav Tykhiy.Xr ti 4 , 110317bb722SYaroslav Tykhiy.Xr txp 4 , 11179458d0bSYaroslav Tykhiyand 112317bb722SYaroslav Tykhiy.Xr vge 4 . 11379458d0bSYaroslav Tykhiy.Pp 114f41b145cSYaroslav TykhiyThe rest of the Ethernet interfaces can run 115dd4dc0a9SYaroslav TykhiyVLANs using software emulation in the 11679458d0bSYaroslav Tykhiy.Nm 11779458d0bSYaroslav Tykhiydriver. 11879458d0bSYaroslav TykhiyHowever, most of them lack the capability 119f41b145cSYaroslav Tykhiyof transmitting and receiving oversized frames. 120f41b145cSYaroslav TykhiyAssigning such an interface as the parent to 121f41b145cSYaroslav Tykhiy.Nm 122f41b145cSYaroslav Tykhiywill result in a reduced MTU on the corresponding 12379458d0bSYaroslav Tykhiy.Nm 12479458d0bSYaroslav Tykhiyinterfaces. 12579458d0bSYaroslav TykhiyIn the modern Internet, this is likely to cause 12679458d0bSYaroslav Tykhiy.Xr tcp 4 12779458d0bSYaroslav Tykhiyconnectivity problems due to massive, inadequate 12879458d0bSYaroslav Tykhiy.Xr icmp 4 12979458d0bSYaroslav Tykhiyfiltering that breaks the Path MTU Discovery mechanism. 13079458d0bSYaroslav Tykhiy.Pp 131f41b145cSYaroslav TykhiyThe interfaces that support oversized frames are as follows: 13272ddf849SRuslan Ermilov.Bl -tag -width ".Xr fxp 4 " -offset indent 133d57916b1SYaroslav Tykhiy.It Xr bfe 4 134d57916b1SYaroslav Tykhiysupports long frames for 135d57916b1SYaroslav Tykhiy.Nm 136d57916b1SYaroslav Tykhiynatively. 137db40c1aeSDoug Ambrisko.It Xr dc 4 138dd4dc0a9SYaroslav Tykhiysupports long frames for 139db40c1aeSDoug Ambrisko.Nm 140db40c1aeSDoug Ambriskonatively. 14179458d0bSYaroslav Tykhiy.It Xr de 4 14279458d0bSYaroslav Tykhiyrequires defining 14379458d0bSYaroslav Tykhiy.Dv BIG_PACKET 14479458d0bSYaroslav Tykhiyin the 14579458d0bSYaroslav Tykhiy.Pa /usr/src/sys/pci/if_de.c 14679458d0bSYaroslav Tykhiysource file and rebuilding the kernel 14779458d0bSYaroslav Tykhiyor module. 14879458d0bSYaroslav TykhiyThe hack works only for the 21041, 21140, and 21140A chips. 14979458d0bSYaroslav Tykhiy.It Xr fxp 4 150dd4dc0a9SYaroslav Tykhiysupports long frames for 15179458d0bSYaroslav Tykhiy.Nm 15279458d0bSYaroslav Tykhiynatively. 15320d0f922SMarius Strobl.It Xr gem 4 15420d0f922SMarius Stroblsupports long frames for 15520d0f922SMarius Strobl.Nm 15620d0f922SMarius Stroblnatively. 157469873caSJoerg Wunsch.It Xr hme 4 158469873caSJoerg Wunschsupports long frames for 159469873caSJoerg Wunsch.Nm 160469873caSJoerg Wunschnatively. 161d57916b1SYaroslav Tykhiy.It Xr rl 4 162d57916b1SYaroslav Tykhiysupports long frames for 163d57916b1SYaroslav Tykhiy.Nm 164d57916b1SYaroslav Tykhiynatively. 1658c992b7fSJohn Hay.It Xr sis 4 166dd4dc0a9SYaroslav Tykhiysupports long frames for 1678c992b7fSJohn Hay.Nm 1688c992b7fSJohn Haynatively. 169a5a8905cSYaroslav Tykhiy.It Xr ste 4 170dd4dc0a9SYaroslav Tykhiysupports long frames for 171a5a8905cSYaroslav Tykhiy.Nm 172a5a8905cSYaroslav Tykhiynatively. 17379458d0bSYaroslav Tykhiy.It Xr tl 4 174dd4dc0a9SYaroslav Tykhiyhas support for long frames. 17579458d0bSYaroslav Tykhiy.It Xr tx 4 176dd4dc0a9SYaroslav Tykhiysupports long frames for 177dd4dc0a9SYaroslav Tykhiy.Nm 178dd4dc0a9SYaroslav Tykhiynatively. 17979458d0bSYaroslav Tykhiy.It Xr xl 4 18079458d0bSYaroslav Tykhiysupports long frames only if the card is built on a newer chip 18172ddf849SRuslan Ermilov(Cyclone and above). 18279458d0bSYaroslav Tykhiy.El 18372ddf849SRuslan Ermilov.Pp 184a5eb8d53SSam LefflerThe 18579458d0bSYaroslav Tykhiy.Nm 186f41b145cSYaroslav Tykhiydriver automatically recognizes devices that natively support oversized frames 187a5eb8d53SSam Lefflerfor 18879458d0bSYaroslav Tykhiy.Nm 189a5eb8d53SSam Leffleruse and calculates the appropriate frame MTU based on the 190a5eb8d53SSam Lefflercapabilities of the parent interface. 191f41b145cSYaroslav TykhiyThe other interfaces listed above can handle oversized frames, 192f41b145cSYaroslav Tykhiybut they do not advertise this ability of theirs. 193f41b145cSYaroslav TykhiyThe MTU setting on 194f41b145cSYaroslav Tykhiy.Nm 195f41b145cSYaroslav Tykhiycan be corrected manually if used in conjunction with such parent interface. 19619e1bfc7SYaroslav Tykhiy.Sh SEE ALSO 19719e1bfc7SYaroslav Tykhiy.Xr kqueue 2 , 19819e1bfc7SYaroslav Tykhiy.Xr miibus 4 , 19919e1bfc7SYaroslav Tykhiy.Xr ifconfig 8 20079458d0bSYaroslav Tykhiy.Sh BUGS 20179458d0bSYaroslav TykhiyNo 802.1Q features except VLAN tagging are implemented. 202cb7d015eSYaroslav Tykhiy.Pp 203cb7d015eSYaroslav Tykhiy.Dv EVFILT_NETDEV 204cb7d015eSYaroslav Tykhiyevents on a 205cb7d015eSYaroslav Tykhiy.Nm 206cb7d015eSYaroslav Tykhiyinterface will be sent through 207cb7d015eSYaroslav Tykhiy.Xr kqueue 2 208cb7d015eSYaroslav Tykhiyonly if the parent interface uses 209cb7d015eSYaroslav Tykhiy.Xr miibus 4 210cb7d015eSYaroslav Tykhiyfor link state notification. 211