summaryrefslogtreecommitdiff
path: root/sys/net/if_vlan.c
AgeCommit message (Collapse)Author
2012-09-30There is no need to set IFF_OACTIVE in vlan, since there is no DMA ringClaudio Jeker
that can be filled. OK dlg@, mikeb@
2012-09-19defina an IFCAP_CSUM_MASK, covering IFCAP_CSUM_*, and use it in if_vlan.cHenning Brauer
to replace the list of them. this actually makes vlan inherit the IPv6 CSUM flags from it's parent, that had been commented out since this code was committed back in 2001. ok benno mpf
2011-11-27Kill old comment, we already do 802.1p tagging.Christiano F. Haesbaert
2011-11-26Tie the 802.1p (CoS) value in vlan(4) with the new prio scheme in pf.Christiano F. Haesbaert
When transmitting through vlan(4), it will now use the prio value in pf packet header. When receiving, we save the incoming Cos in the same place, this gives us the hability to preserve the CoS value across two different vlan interfaces. This kills the SIOC[GS]VLANPRIO ioctls and removes the corresponding buttons from ifconfig(8). ok henning@ claudio@ mcbride@
2011-09-18Fix various format string types to as a minimum match the width of theMiod Vallat
variables being processed. ok bluhm@ henning@
2011-08-20Fix packet accounting in error cases.Ryan Thomas McBride
From Christiano F. Haesbaert.
2011-02-18when changing the vlandev of a running vlan(4) interface, we also need toReyk Floeter
move the configured multicast addresses and preserve the promisc mode settings of the parent. this fixes an issue when carp stopped working on a vlan after the vlandev was manually changed. ok naddy@ phessler@
2011-01-03Allow to change vlan options of existing vlan(4)/svlan(4) devices atReyk Floeter
runtime instead of forcing the user to-recreate the interface with the changed options. The code now re-configures the interface instead of returning EBUSY. For example, it is now possible to run "ifconfig vlan1 vlandev em0; ifconfig vlan1 vlandev em1" in a sequence. ok claudio@ deraadt@
2010-07-02m_copyback can fail to allocate memory, but is a void fucntion so gymnasticsBret Lambert
are required to detect that. Change the function to take a wait argument (used in nfs server, but M_NOWAIT everywhere else for now) and to return an error ok claudio@ henning@ krw@
2010-06-03Add support for 802.1ad-style QinQ nested VLANs.Christian Weisgerber
QinQ-compliant svlan (service VLAN) interfaces are implemented as a new cloner type, use Ethernet type 0x88a8, and have a dedicated VLAN tag hash to avoid ID conflicts. vlan(4) interfaces can be stacked on top of svlan(4). Originally from reyk@, input from claudio@ and deraadt@ ok claudio@
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
2010-01-12set the length of the send queue to 1.David Gwynne
this prevents the ultimate length of the queue of the underlying interface from being artificially inflated while hte vlan/trunk queue is filled and then dumped wholesale on the underlying interface, which will dump its massive queue wholesale on the chip. tx mitigation is only triggered on real interfaces now (which is where the cost is) ok beck@ original diff ok kjc@ henning@
2009-11-18do not do setup that ether_ifattach() takes care of; ok jsgTheo de Raadt
2009-07-16Backout rev1.79 of if_vlan.c and rev1.66 of if_trunk.c;Thordur I. Bjornsson
Changes in those revision limited the send queue to one slot. This breaks NFS over vlan(4) has discovered by sthen@. "just plain back it out." deraadt@
2009-07-13make the send queue one slot long. this forces packets off the virtualDavid Gwynne
interfaces down to the queue on the physical interface immediately. this avoids having the tx mitigation code wasting cpu time dicking around with simply shuffling packets off virtual interface queues and lets it do its job of ammortising the cost of calling a real interfaces start routine. it also prevents an artificial inflation of the physical interfaces queue length where packets could hide on the virtual interfaces queues during softnet before being dumped en masse onto the hardware. this will smooth out the rate at which packets are submitted to the hardware. kjc@ says this has no impact on altq. ya henning@
2009-01-27include the VLAN priority for hardware tagging, too; ok claudio@Christian Weisgerber
2008-10-16Switch the existing TX VLAN hardware support over to having theChristian Weisgerber
tag in the header. Convert TX tagging in the drivers. Help and ok brad@
2008-10-16* Allow ether_input() and vlan_input() to handle incoming packetsChristian Weisgerber
where the tag is stored in the mbuf header. * Make bridge(4) handle interfaces with and without hardware tag support and forward packets inbetween. Help and ok claudio@
2008-10-16Drop promiscuously received packets if the vlan interface is not inChristian Weisgerber
promiscuous mode itself. Closes PR 5012. With claudio@. ok claudio@, henning@
2008-09-02remove dead stores and newly created unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok henning@ mpf@
2008-05-07enable tx mitigation when putting packets on the wire by switching fromDavid Gwynne
calls to ifp->if_start to if_start(). these are the obviously right cases where we can do that, the less obvious ones may follow as theyre figured out. deraadt@ said to go for it
2007-12-20return with ENOTTY instead of EINVAL for unknown ioctl requests.Brad Smith
ok claudio@ krw@ jason@ dlg@
2007-09-15malloc sweep:Henning Brauer
-remove useless casts -MALLOC/FREE -> malloc/free -use M_ZERO where appropriate instead of seperate bzero feedback & ok krw, hshoexer
2007-06-06vlan interfaces do not allow the parent interface and the vlan number to beHenning Brauer
reconfigured after they are set. so they bail out when you try to. so when you re-run netstart on a machine with vlans, it bails out with ifconfig: SIOCSETVLAN: Device busy and IP changes are not done. make vlan_config() notice when both parent interface and vlan number stay the same and just return success without doing anything in that case. allows the IP config thereafter to happen. ok markus jason
2007-05-26one extern seems to be better than 20 for ifqmaxlen; ok krwJason Wright
2006-05-22Check for NULL cookies before calling hook_disestablish(). Just in caseKenneth R Westerback
the establish calls were bypassed or failed. ok mpf@
2006-05-09Remove unnecessary check for the parent interface when settingMarco Pfatschbacher
the vlan priority. Relaxes the order of the vlanprio parameter in ifconfig. OK claudio, brad, norby
2006-04-11on link state changes, copy baudrate (negotiated link speed) from parentHenning Brauer
device. previously this was only done at config time, so vlan if's baudrate could easily get out of sync with parent's. ok camield brad
2006-03-25allow bpf(4) to ignore packets based on their direction (inbound orDamien Miller
outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
2006-03-04With the exception of two other small uncommited diffs this movesBrad Smith
the remainder of the network stack from splimp to splnet. ok miod@
2006-02-09add an interface detach hook and use it with the vlan(4) driver. thisReyk Floeter
fixes a possible crash if the parent interface has been destroyed (like vlan on trunk) before destroying the vlan interface. ok brad@
2006-01-05Make it possible to set a default vlan priority for vlan interfaces.Esben Norby
ok claudio@ brad@
2006-01-04Remove redundant calls to bpfdetach.Can Erkin Acar
ok brad@
2005-10-23Rework of multicast deletion code for vlan(4) and trunk(4).Marco Pfatschbacher
The previous code could wrongly delete multicast groups on the parent interface. Now we forward only remembered delete requests. OK mcbride, mickey.
2005-07-31Introduce bpf_mtap_af and bpf_mtap_hdr to be used when passing a mbuf chainChristopher Pascoe
to bpf with either an address family or other header added. These helpers only allocate a much smaller struct m_hdr on the stack when needed, rather than leaving 256 byte struct mbufs on the stack in deep call paths. Also removes a fair bit of duplicated code. commit now, tune after deraadt@
2005-07-19Remove vlan_input_tag() since all four drivers that used it have beenCamiel Dobbelaar
reworked to not strip vlan tags in hardware anymore. ok brad henning jason
2005-07-18Use M_PREPEND to take advantage of any slack leading space in the mbuf.Camiel Dobbelaar
ok markus jason henning brad
2005-06-07Run vlan_input before bridge_input, and change vlan_input to notCamiel Dobbelaar
consume vlan frames that no vlan interface wants, so they can still be bridged. This way, the bridge can bridge encapsulated frames _and_ bridge between vlan interfaces. ok henning markus
2005-05-27only access if_linkstatehooks inside splnet.Marco Pfatschbacher
with pascoe@
2005-04-25Use ETHERTYPE_VLAN.Brad Smith
2005-04-24Use the IANA assignment IFT_L2VLAN.Brad Smith
From FreeBSD/NetBSD Tested by camield@ and Alexey E. Suslikov <cruel at texnika dot com dot ua> ok camield@
2005-04-20Make vlan(4) aware of its physical interface link state.Marco Pfatschbacher
Changes are reported to userland and to other interfaces sitting on top of us. OK henning@, camield@ Tested by camield@ and Alexey E. Suslikov
2005-04-18If the parent interface is not IFF_RUNNING, do not call its start function.Brad Smith
This prevent a variety of fun panics. From NetBSD
2005-04-18revert a change in the previous commit to appease henning@ for the timeBrad Smith
being.. - Set the interface speed back to zero after ether_ifattach(). RFC 2863 says: "For a sub-layer which has no concept of bandwidth, [ifSpeed] should be zero."
2005-04-17- In vlan_input()/vlan_input_tag(), always mask off all but the VLIDBrad Smith
bits from tags extracted from received frames. (Some drivers may already do this masking internally, but doing it here doesn't hurt and insures consistency.) - In vlan_ioctl(), don't let the user set a VLAN ID value with anything besides the VLID bits set, otherwise we will have trouble matching an interface in vlan_input() later. - Set the interface speed back to zero after ether_ifattach(). RFC 2863 says: "For a sub-layer which has no concept of bandwidth, [ifSpeed] should be zero." - Do not call if_down() on a parent interface if it's already down. From FreeBSD Tested by camield@ and Alexey E. Suslikov <cruel at texnika dot com dot ua> ok camield@
2005-03-25increment the right counter on error.Brad Smith
2004-10-09sizeof(struct ether_header) -> ETHER_HDR_LENBrad Smith
ok mcbride@
2004-03-27wrap if_down() in splimp; tholo ran into splassert, miod tholo okTheo de Raadt
2004-02-12from camield:Henning Brauer
se hash instead of linked list to speed up tag to vlan interface mapping ok markus@ and myself
2003-12-16return error in ifc_destroy; ok deraadt, itojun, cedric, hshoexerMarkus Friedl