summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.h
Commit message (Collapse)AuthorAgeFilesLines
* Do not update the lagg link layer address when destroying a lagg clone.loos2017-01-291-0/+2
| | | | | | | | | | | | | | This would enqueue an event to send the gratuitous arp on a dying lagg interface without any physical ports attached to it. Apart from that, the taskqueue_drain() on lagg_clone_destroy() runs too late, when the ifp data structure is already freed. Fix that too. Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) (cherry picked from commit 1f77bc5d5ca6ab7d72b774b21d1cb4e598b1c72f)
* Revert accidental submit of WIP as part of r297609rpokala2016-04-061-48/+6
| | | | Pointyhat to: rpokala
* Storage Controller Interface driver - typo in unimplemented macro inrpokala2016-04-061-6/+48
| | | | | | | | | scic_sds_controller_registers.h s/contoller/controller/ PR: 207336 Submitted by: Tony Narlock <tony @ git-pull.com>
* Add an IOCTL rr_limit to let users fine tuning the number of packets to bearaujo2016-01-231-0/+3
| | | | | | | | | | | | | | | | | | | sent using roundrobin protocol and set a better granularity and distribution among the interfaces. Tuning the number of packages sent by interface can increase throughput and reduce unordered packets as well as reduce SACK. Example of usage: # ifconfig bge0 up # ifconfig bge1 up # ifconfig lagg0 create # ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \ 192.168.1.1 netmask 255.255.255.0 # ifconfig lagg0 rr_limit 500 Reviewed by: thompsa, glebius, adrian (old patch) Approved by: bapt (mentor) Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D540
* Revert r292275 & r292379smh2015-12-171-1/+1
| | | | | | | glebius has concerns about these changes so reverting those can be discussed and addressed. Sponsored by: Multiplay
* Fix lagg failover due to missing notificationssmh2015-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using lagg failover mode neither Gratuitous ARP (IPv4) or Unsolicited Neighbour Advertisements (IPv6) are sent to notify other nodes that the address may have moved. This results is slow failover, dropped packets and network outages for the lagg interface when the primary link goes down. We now use the new if_link_state_change_cond with the force param set to allow lagg to force through link state changes and hence fire a ifnet_link_event which are now monitored by rip and nd6. Upon receiving these events each protocol trigger the relevant notifications: * inet4 => Gratuitous ARP * inet6 => Unsolicited Neighbour Announce This also fixes the carp IPv6 NA's that stopped working after r251584 which added the ipv6_route__llma route. The new behavour can be controlled using the sysctls: * net.link.ether.inet.arp_on_link * net.inet6.icmp6.nd6_on_link Also removed unused param from lagg_port_state and added descriptions for the sysctls while here. PR: 156226 MFC after: 1 month Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4111
* Fix lladdr change propagation for on vlans on top of it.melifaro2015-11-011-1/+7
| | | | | | | | | Fix lladdr update when setting mac address manually. Fix lladdr_event for slave ports addition. MFC after: 4 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D4004
* Remove per complete the fec aggregation protocol.araujo2015-10-041-2/+0
| | | | | | | | | | | | The remove began with revision r271733. NOTE: This patch must never be merge to 10-Stable Reviewed by: glebius Approved by: bapt (mentor) Relnotes: Yes Sponsored by: EuroBSDCon Sweden. Differential Revision: D3786
* Make LAG LACP fast timeout tunable through IOCTL.hiren2015-08-121-0/+1
| | | | | | | | Differential Revision: D3300 Submitted by: LN Sundararajan <lakshmi.n at msystechnologies> Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas MFC after: 2 weeks Sponsored by: Panasas
* Factor out mbuf hashing code from LAGG driver so that other networkhselasky2015-03-111-1/+0
| | | | | | | | | | | drivers can use it. This avoids some code duplication. Add missing default case to all switch statements while at it. Also move the hashing of the IPv6 flow field to layer 4 because the IPv6 flow field is constant on a per L4 connection basis and not on a per L3 network. Differential Revision: https://reviews.freebsd.org/D1987 Sponsored by: Mellanox Technologies MFC after: 1 month
* Start process of removing the use of the deprecated "M_FLOWID" flaghselasky2014-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies
* - Move L2 addr configuration for the primary port to a taskqueue. This fixeshrs2014-10-051-0/+4
| | | | | | | | | | LOR of softc rmlock in iflladdr_event handlers. - Call if_delmulti_ifma() after LACP_UNLOCK(). This fixes another LOR. - Fix a panic in lacp_transit_expire(). - Fix a panic in lagg_input() upon shutting down a port.
* Separate option handling from SIOC[SG]LAGG to SIOC[SG]LAGGOPTS forhrs2014-10-021-13/+21
| | | | backward compatibility with old ifconfig(8).
* Virtualize lagg(4) cloner. This change fixes a panic when tearing downhrs2014-10-011-3/+14
| | | | | | | | | | | if_lagg(4) interfaces which were cloned in a vnet jail. Sysctl nodes which are dynamically generated for each cloned interface (net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift ifconfig(8) parameters have been added instead. Flags and per-interface statistics counters are displayed in "ifconfig -v". CR: D842
* Finally, convert counters in struct ifnet to counter(9).glebius2014-09-281-1/+1
| | | | | Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Use underlying ports counters to get lagg statistics instead ofmelifaro2014-09-271-13/+6
| | | | | | | | | | per-packet accounting. This introduce user-visible changes like aggregating error counters. Reviewed by: asomers (prev.version), glebius CR: D781 MFC after: 2 weeks Sponsored by: Yandex LLC
* Remove macros that hide access to struct ifnet fields.glebius2014-09-261-4/+1
|
* Make all lagg protocol methods live in lagg_protos, not in softc. Allglebius2014-09-261-13/+0
| | | | | | | interfaces of a same protocol, use the same methods. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* - Whitespace.glebius2014-09-261-4/+4
| | | | - Remove caddr_t.
* - Provide lagg_proto_attach(), lagg_proto_detach().glebius2014-09-261-1/+0
| | | | | | | | - Make detach a protocol method in lagg_protos. - Simplify code to lookup protocols. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Make lagg protos a enum.glebius2014-09-261-9/+11
|
* Make lagg protocols detach methods returning void.glebius2014-09-261-1/+1
| | | | | Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Add laggproto broadcast, it allows sends frames to all ports of the lagg(4) ↵araujo2014-09-181-3/+5
| | | | | | | | | | | | group and receives frames on any port of the lagg(4). Phabric: D549 Reviewed by: glebius, thompsa Approved by: glebius Obtained from: OpenBSD Sponsored by: QNAP Systems Inc.
* Improve locking of multicast addresses in VLAN and LAGG interfaces.mav2014-08-041-0/+1
| | | | | | | This fixes several scenarios of reproducible panics, cause by races between multicast address changes and interface destruction. MFC after: 2 weeks
* Multi-queue NIC drivers and multi-port lagg tend to use the same lowerscottl2013-12-301-0/+1
| | | | | | | | | | | | bits of the flowid as each other, resulting in a poor distribution of packets among queues in certain cases. Work around this by adding a set of sysctls for controlling a bit-shift on the flowid when doing multi-port aggrigation in lagg and lacp. By default, lagg/lacp will now use bits 16 and higher instead of 0 and higher. Reviewed by: max Obtained from: Netflix MFC after: 3 days
* Convert the if_lagg rwlock to an rmlock.adrian2013-08-291-9/+15
| | | | | | | | | | | | | We've been seeing lots of cache line contention (but not lock contention!) in our workloads between the various TX and RX threads going on. The write lock is only grabbed when configuration changes are made - which are infrequent. With this patch, the contention and cycles spent waiting for updates disappear. Sponsored by: Netflix, Inc.
* Break out the static, global LACP debug options into a per-lagg unitadrian2013-07-261-0/+1
| | | | | | | | | | | | | | | sysctl tree. * Create a net.link.lagg.X.lacp node * Add a debug node under that for tx_test and rx_test * Add lacp_strict_mode, defaulting to 1 tx_test and rx_test are still a bitmap of unit numbers for now. At some point it would be nice to create child nodes of the lagg bundle for each sub-interface, and then populate those with various knobs and statistics. Sponsored by: Netflix
* Bring over some link aggregation / LACP protocol improvements and debuggingadrian2013-07-131-0/+5
| | | | | | | | | | | | | | | | | | | additions. * Add some new tracing events to aid in debugging. * Add in a debugging mode to drop transmit and received frames, specifically to test whether seeing or hearing heartbeats correctly cause LACP to drop the port. * Add in (and make default) a strict LACP mode, which requires the heartbeat on a port to be heard before it's used. Sometimes vendor ports will hang but the link layer stays up, resulting in hung traffic. * Add logging the number of link status flaps, again to aid in debugging badly behaving switch ports. * Calculate the lagg interface port speed as the multiple of the configured ports, rather than the largest. Obtained from: Netflix MFC after: 2 weeks
* Add const qualifier to the dst parameter of the ifnet if_output method.glebius2013-04-261-2/+2
|
* Switch lagg(4) statistics to counter(9).glebius2013-04-151-2/+9
| | | | | | | | | | | | | | The lagg(4) is often used to bond high speed links, so basic per-packet += on statistics cause cache misses and statistics loss. Perfect solution would be to convert ifnet(9) to counters(9), but this requires much more work, and unfortunately ABI change, so temporarily patch lagg(4) manually. We store counters in the softc, and once per second push their values to legacy ifnet counters. Sponsored by: Nginx, Inc.
* Remove __FreeBSD_version ifdefs.glebius2013-03-221-2/+0
|
* Add the ability to set which packet layers are used for the load balance hashthompsa2012-03-061-1/+16
| | | | calculation.
* Using the flowid in the mbuf assumes the network card is giving a good hash forthompsa2012-02-221-0/+4
| | | | | | | | | the traffic flow, this may not be the case giving poor traffic distribution. Add a sysctl which allows us to fall back to our own flow hash code. PR: kern/164901 Submitted by: Eugene Grosbein MFC after: 1 week
* Propagate the vlan eventis to the underlying interfaces/members so they can ↵eri2010-02-061-0/+4
| | | | | | | | | do initialization of hw related features. PR: kern/141646 Reviewed by: thompsa Approved by: thompsa(co-mentor) MFC after: 2 weeks
* Change if_output to take a struct route as its fourth argument in orderkmacy2009-04-161-1/+1
| | | | | | to allow passing a cached struct llentry * down to L2 Reviewed by: rwatson
* Fix two panics in lagg.thompsa2007-10-121-0/+1
| | | | | | | | | | | | | 1. The locking was changed to shared but roundrobin mode still updated a pointer in the softc with the next tx interface to use. This will panic under high load. Change this to an atomically incremented sequence number in order to choose the tx port in round robin. 2. IFQ_HANDOFF will free the mbuf if the queue is full, this will then be freed again by lagg_start() and panic. Reorganised the error handling and freeing to fix this. MFC after: 3 days
* - Propagate the largest set of interface capabilities supported by all laggthompsa2007-07-301-1/+0
| | | | | | | | | | | ports to the lagg interface. - Use the MTU from the first interface as the lagg MTU, all extra interfaces must be the same. This fixes using a lagg interface for a vlan or enabling jumbo frames, etc. Approved by: re (kensmith) MFC After: 3 days
* Allow the LACP state to be queried from userland which at the moment is thethompsa2007-07-051-0/+28
| | | | | | | actor and partner peer info. Print out the active aggregator and per port data in verbose mode from ifconfig. Approved by: re (mux)
* non-functional cleanupthompsa2007-06-121-41/+37
| | | | | | | - remove dead code - use consistent variable names - gc unused defines - whitespace cleanup
* Change from a mutex to a read/write lock. This allows the tx port to bethompsa2007-05-151-8/+9
| | | | | selected simultaneously by multiple senders and transmit/receive is not serialised between aggregated interfaces.
* Call if_setlladdr() on the aggregation port from a taskqueue so the softc lockthompsa2007-05-071-0/+11
| | | | | is not held. The short delay between aggregating the port and setting the MAC address is fine.
* Avoid touching various unsafe parts if the interface is disappearing.thompsa2007-05-071-0/+1
|
* Change from using if_delmulti() to if_delmulti_ifma() as it simplifies the codethompsa2007-05-071-8/+4
| | | | | | and is safe to use if the ifp has disappeared. Suggested by: bms
* Fix flag descriptions.thompsa2007-05-031-2/+2
|
* - Add a disabled state for ports that can not be aggregatedthompsa2007-05-031-1/+2
| | | | - Refine check for lacp links, set to disabled if not suitable
* Rename the trunk(4) driver to lagg(4) as it is too similar to vlan trunking.thompsa2007-04-171-0/+209
The name trunk is misused as the networking term trunk means carrying multiple VLANs over a single connection. The IEEE standard for link aggregation (802.3 section 3) does not talk about 'trunk' at all while it is used throughout IEEE 802.1Q in describing vlans. The lagg(4) driver provides link aggregation, failover and fault tolerance. Discussed on: current@
OpenPOWER on IntegriCloud