summaryrefslogtreecommitdiff
path: root/sys/net/if_trunk.c
AgeCommit message (Collapse)Author
2011-10-28Take more care to ensure all callbacks are initialized. In particularKenneth R Westerback
tr_linkstate() was not initialized in trunk_rr_attach(), and tr_init() and tr_stop() were missing in trunk_lb_attach(). Fixes crash triggered by changing trunkproto, reported by Anders Berggren on bugs@. ok mpf henning
2011-01-28Fix another memory leak by replacing m_free() with m_freem() in trunk'sReyk Floeter
broadcast mode. ok blambert@ mikeb@
2010-11-12avoid pointer arithmetic on void *David Hill
no change in .o ok claudio
2010-05-08Upon changing the MAC address of an if_trunk interface, all ports are switchedStefan Sperling
to the new MAC. But subsequently added ports were still being assigned the old MAC address because it was copied from the wrong place. Give newly added trunk ports the current MAC of the master port, rather than the saved MAC of the master port. The saved MAC should only be used to restore the original MAC address of the interface when it is removed from the trunk. ok claudio@
2010-04-23Use proper Queen's English in a comment. Drive-by fix, no functional change.Stefan Sperling
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-04-17use ifnewlladdr() for trunk lladdr changes, tooTheo de Raadt
ok stsp
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-09-17Add an splassert check trunk_enqueue() calling this function at anythingClaudio Jeker
below splnet() is a good recipe for doom. OK henning, reyk, mpf
2009-09-09remove inline functions and move some code from the trunk_lacp_input()Reyk Floeter
API function directly to lacp_input() to simplify the code path. ok mpf@
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-27handle HW VLAN tags being passed down; from BradChristian Weisgerber
2009-01-27make the hardware/no hardware tag stripping cases consistent and don'tChristian Weisgerber
hash the VLAN priority; ok henning@
2008-12-14Allow trunk_hashmbuf() to take HW VLAN tagging into consideration.Brad Smith
ok mpf@ naddy@
2008-12-14Since trunk_hashmbuf() and thus trunk_lb_gethdr() are no longer specificBrad Smith
to the loadbalance code rename trunk_lb_gethdr() to just trunk_gethr(). ok mpf@
2008-11-28Eliminate the redundant bits of code for MTU and multicast handlingBrad Smith
from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
2008-11-16Make sure to increment the the output error counter ifBrad Smith
not using TRUNK_PROTO_NONE and there are no member ports. ok mpf@
2008-11-08Take into account that our ether_input() already strips theMarco Pfatschbacher
ethernet header. This lets us actually process the incoming LACP-Packets. It should now work with a lot more switches. At least a Catalyst 3500 seems happy. OK brad@
2008-11-04Move the trunk port count check from trunk_lb_start() to trunk_start()Brad Smith
before the protocol start routine is called so as to cover all protocols with the same check. ok mpf@
2008-10-30Fix building with !INET6 kernels.Brad Smith
2008-10-28Remove return at the end of a void function.Brad Smith
2008-10-28In trunk_media_status() mark the interface as active if any ports areBrad Smith
active rather than just the primary being UP. From FreeBSD Ok mpf@
2008-10-28In trunk_lb_start() port % count will never be greater thanBrad Smith
TRUNK_MAX_PORTS so nuke the test. From FreeBSD Ok mpf@
2008-10-28Feed IPv6 flow label to hash calculation.Brad Smith
From FreeBSD Ok mpf@
2008-10-28Show the ACTIVE flag in ifconfig for the single interface that isBrad Smith
actually active in failover mode rather than all interfaces with a link. This makes it clear if the master interface is in use or one of the backup links. From FreeBSD Tested by jmc@ Ok mpf@
2008-10-02First step towards cleaning up the Ethernet driver ioctl handling.Brad Smith
Move calling ether_ioctl() from the top of the ioctl function, which at the moment does absolutely nothing, to the default switch case. Thus allowing drivers to define their own ioctl handlers and then falling back on ether_ioctl(). The only functional change this results in at the moment is having all Ethernet drivers returning the proper errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown ioctl's. Shrinks the i386 kernels by.. RAMDISK - 1024 bytes RAMDISKB - 1120 bytes RAMDISKC - 832 bytes Tested by martin@/jsing@/todd@/brad@ Build tested on almost all archs by todd@/brad@ ok jsing@
2008-09-17remove dead stores and newly created unused variables.Charles Longeau
fix potential use of uninitialized value in trunk_port_ioctl() function. Found by LLVM/Clang Static Analyzer. ok mpf@ henning@
2008-08-07do not touch m after IFQ_ENQUEUE()+if_start().Damien Bergamini
ok brad@, mpf@, henning@, reyk@
2008-08-06fix trunk breakage that sneaked in with the lacp diff:Reyk Floeter
- don't use in-kernel IFMEDIA ioctls in lacp and remove two KASSERTs that caused reliable panics - the lacp key can be locally assigned and we don't need to query the media subtype here. - unbreak failover/loadbalance/broadcast status handling. Reported by brad@ ok deraadt@
2008-07-30Prevent a divide by zero panic if trunkproto loadbalance isMarco Pfatschbacher
used w/out any trunkports. Patch from Dmitri Alenitchev. OK reyk@
2008-06-15Add 802.3ad LACP support for trunk(4).Marco Pfatschbacher
Implementation from NetBSD. Ported via FreeBSD's version in trunk^Wlagg(4). This is still work in progress. Tested with a HP ProCurve 3500. OK reyk@
2008-06-14Move bpf_mtap_hdr() above the trunk_*_input() routines.Marco Pfatschbacher
This makes it easier to add trunk protocols that consume some packets. Add a special case for the failover protocol, to prevent shoving duplicates to bpf. (Not beautiful, but it has to do for the moment). OK reyk@, claudio@
2008-06-13Move the responsibility to free received packets on trunked interfacesMarco Pfatschbacher
from ether_input() into trunk_input() where it can be handled in a smarter way. OK claudio@ and reyk@ on an earlier version.
2008-06-08Use m_freem() instead of m_free() in trunk_start() to ensure that theBrad Smith
full mbuf chain is being free'd. ok reyk@
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
2008-01-10return with ENOTTY instead of EINVAL for unknown ioctl requests to trunkBrad Smith
ports. ok reyk@ dlg@
2007-11-26typos; ok jmc@Martynas Venckus
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@ sys/dev/pci/bktr/* ok jakemsr@
2007-11-20Fix possible mbuf leak on error. ok reyk@Can Erkin Acar
2007-10-22use the input mbuf for the first active port instead of copying it inReyk Floeter
the broadcast start routing. ok pyr@
2007-10-22Add a broadcast mode to trunk(4). This mode sends frames on allPierre-Yves Ritschard
ports and receives frame on any port. This allows interaction with some L2 configurations. with input and ok reyk@
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-09-07use M_ZEROReyk Floeter
2007-09-06bump the copyright while touching these filesReyk Floeter
2007-09-06With a trunk(4) interface in fail over mode the trunk(4) interfaceReyk Floeter
will show input errors for packets received from any of the ports that are part of a fail over interface but are not the "master" port at the time. This fixes the problem by checking the error condition correctly. From brad at comstyle dot com
2007-05-26one extern seems to be better than 20 for ifqmaxlen; ok krwJason Wright
2007-04-26extend the trunk protocol API with some additional callbacks requiredReyk Floeter
for future work. also move the repeated tx start code into a common function. parts of it are merged from FreeBSD's trunk(4) port. oh, wait... they renamed it to 'lagg(4)' because a little green guy from Cizzco-Eeeh told them "trunk is for VLANs, trunk is for VLANs". Bad FreeBSD, don't listen to the little green guy from Cizzco-Eeeh! ok claudio@
2007-01-31handle the full duplex link state in trunk(4). load sharing trunksReyk Floeter
with at least two ports are always handled as full fuplex links. this change will allow trunks as edge ports in a rstp bridge(4). ok brad@ pyr@
2006-05-28check if the interface is active and UP. some, but not all, networkReyk Floeter
drivers report an active link state even if the interface is DOWN. this should fix trunk with various ethernet devices. ok brad@