summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2019-07-08free(9) sizes for M_RTABLE.Martin Pieuchot
ok kn@
2019-07-05pretend to handle setting trunkproto, but only support setting it to lacpDavid Gwynne
2019-07-05fix the $OpenBSD$ tagDavid Gwynne
2019-07-05initialise sc_lacp_timeout to AGGR_LACP_TIMEOUT_SLOW, not 0;David Gwynne
it's the same, but there was a misleading comment on the same line which this cleans up too.
2019-07-05iterate over distributing ports when populating the tx map, not all portsDavid Gwynne
this probably explains why ive seen a box decide not to use a distributing port, even though the state machine and all the lacp state flags say it's fine. it may also explain why jmatthew@ has seen a port still transmitting after it's been removed from an aggr(4).
2019-07-05init the log of tx times to somewhere in the past when adding a port.David Gwynne
2019-07-05move a declaration before a statement.David Gwynne
2019-07-05report a port as active to userland if it is muxedDavid Gwynne
2019-07-05tweak mtu handling and propagate mtu setting to trunkportsDavid Gwynne
make setting a trunkports mtu to its current mtu a nop. set a trunkports mtu to the aggr mtu when the port is getting added. set the mtu on all trunkports when the aggr mtu is set so things look consistent. restore a trunkports mtu when it is removed from an aggr. this is mostly cosmetic since the mtu on trunkports isn't really used anywhere.
2019-07-05add aggr(4), a dedicated driver that implements 802.1AX link aggregationDavid Gwynne
802.1AX (formerly known as 802.3ad) describes the Link Aggregation Control Protocol (LACP) and how to use it in a bunch of different state machines to control when to bundle interfaces into an aggregation. technically the trunk(4) driver already implements support for 802.1AX, but it had a couple of problems i struggled to deal with as part of that driver. firstly, i couldnt easily make the output path in trunk mpsafe without getting bogged down, and the state machine handling had a few hard to diagnose edge cases that i couldnt figure out. the new driver has an mpsafe output path, and implements ifq bypass like vlan(4) does. this means output with aggr(4) is up to twice as fast as trunk(4). the implementation of the state machines as per the standard means the driver behaves more correctly in edge cases like when a physical link looks like it is up, but is logically unidirectional. the code has been good enough for me to use in production, but it does need more work. that can happen in tree now instead of carrying a large diff around. some testing by ccardenas@, hrvoje popovski, and jmatthew@ ok deraadt@ ccardenas@ jmatthew@
2019-07-05record when trunk takes over an interface by setting ac_trunkportDavid Gwynne
this will be used to prevent trunk and the upcoming aggr driver from taking ownership of an Ethernet interface at the same time.
2019-07-03add the kernel side of net.link.ifrxq.pressure_return and pressure_dropDavid Gwynne
these values are used as the backpressure thresholds in the interface rx q processing code. theyre being exposed as tunables to userland while we are figuring out what the best values for them are. ok visa@ deraadt@
2019-07-02When source address tracking record is used for "route-to", the nextYASUOKA Masahiko
hop interface configured with "route-to" was not used. Keep the interface within the pf_src_node and use it when the record is used. OK sashan
2019-07-01Link the state and the source track to keep the source track whileYASUOKA Masahiko
there are states which refer it. OK sashan
2019-07-01reintroduce ifiq_input counting backpressureDavid Gwynne
instead of counting the number of packets on an ifiq, count the number of times a nic has tried to queue packets before the stack processes them. this new semantic interacted badly with virtual interfaces like vlan and trunk, but these interfaces have been tweaked to call if_vinput instead of if_input so their packets are processed directly because theyre already running inside the stack. im putting this in so we can see what the effect is. if it goes badly i'll back it out again. ok cheloha@ proctor@ visa@
2019-06-30if_vinput should pass BPF_DIRECTION_IN to bpf_mtap, not OUTDavid Gwynne
2019-06-26Create IF_WWAN_DEFAULT_PRIORITY which is lower thanClaudio Jeker
IF_WIRELESS_DEFAULT_PRIORITY and use it in umb(4) as default prio. OK kettenis@, sthen@
2019-06-26The MPLS edge devices get the packets from the MPLS stack which neverClaudio Jeker
passed though pf_test(). So there is no need to try to call pf_pkt_addr_changed() instead just check that the PF statekey is NULL. Initial problem of not including pf.h found by jsg@ OK jsg@ sashan@
2019-06-24Since the recent recursion fix in rtable_walk(), deleting an interfaceAlexander Bluhm
address could trigger the "rt->rt_ifidx == ifp->if_index" assertion. In rtflushclone() the ifp that is passed to rtdeletemsg() has been changed from the route interface to the ifa interface. Restore the old behavior and get the route ifp. found by regress/sys/netinet/carp; OK mpi@
2019-06-24Use timeout_add_sec(9)kn
Re-challenge timeouts are made up of single scalar factors which are multiplied with the time unit lcp.timeout to compute the timeout period. Simply reduce that unit of 1 * hz [ticks] to 1 [s] and use the appropiate API. OK mpi
2019-06-24free(9) sizes.Martin Pieuchot
ok kn@
2019-06-22Make computation of re-challenge timeout more obviouskn
Instead of masking the difference between lower and upper bound to yield a random summand that fits, instruct the API to limit their result accordingly. 0x01fe = 510 = 810 - 300. arc4random_uniform(upper_bound) returns `upper_bound - 1' as maximum, so add one to make 810 a possible value for `i'. OK deraadt
2019-06-22Revert accidentially committed hunk from previouskn
2019-06-22Remove duplicate initialisationkn
OK claudio semarie
2019-06-21Prevent recursions by not deleting entries inside rtable_walk(9).Martin Pieuchot
rtable_walk(9) now passes a routing entry back to the caller when a non zero value is returned and if it asked for it. This allows us to call rtdeletemsg()/rtrequest_delete() from the caller without creating a recursion because of rtflushclone(). Multicast code hasn't been adapted and is still possibly creating recursions. However multicast route entries aren't cloned so if a recursion exists it isn't because of rtflushclone(). Fix stack exhaustion triggered by the use of "-msave-args". Issue reported by Dániel Lévai on bugs@ confirmed by and ok bluhm@.
2019-06-17free(9) sizes.Martin Pieuchot
ok reyk@
2019-06-16Use timeout_add_sec(9)kn
All ticks arguments to timeout_add() calls are positive multiple of hz, so simply reduce it and use the appropiate function. Also, (hz / 50) [ticks] = 1 / 50 [s] = 20 [ms]. OK mpi
2019-06-15Free sizes for hooks and `if_sadl'.Martin Pieuchot
ok kn@
2019-06-13free(9) sizes for buffers.Martin Pieuchot
ok anton@, sashan@
2019-06-13free(9) sizes.Martin Pieuchot
ok kn@
2019-06-13Copy the user provided sockaddr into a normalized sockaddr in rtrequest()Claudio Jeker
before adding it to the routing table. The rtable code is doing memcmp() of those rt_dest sockaddrs so it is important that they are stored in a canonical form. To do this struct domain is extended to include the sockaddr size for this address family. OK bluhm@ anton@ Reported-by: syzbot+10fe9cd8d0211c562ead@syzkaller.appspotmail.com
2019-06-10use m_microtime to get the packet rx time it might be available.David Gwynne
2019-06-10don't allow userland to change if_type.David Gwynne
if_type is now immutable in tun(4) and tap(4) ok claudio@ mpi@
2019-06-10Use mallocarray(9) & put some free(9) sizes for M_IPMOPTS allocations.Martin Pieuchot
ok semarie@, visa@
2019-06-09Always return EEXIST if an interface is already part of a bridge.Martin Pieuchot
2019-06-09Remove code for non-Ethernet members, these are no longer supported.Martin Pieuchot
From Eygene Ryabinkin.
2019-06-05Remove workaround and return EINVAL when userland sends routing messagesClaudio Jeker
with bad address flags. OK bluhm@ sthen@
2019-06-04if_netisr(): trade NET_LOCK() for NET_RLOCK()Alexandr Nedvedicky
OK mpi@
2019-06-04pfsync_sendout() requires PF_LOCK()Alexandr Nedvedicky
OK mpi@
2019-06-02Repair state and flag bitmasks to match RFC, from Mitchell KromeTheo de Raadt
ok claudio
2019-05-28Fix reporting of up->down transition in routing messagekn
The code for updating the laststate and timer is looking at laststate before it's been updated. From Mitchell Krome <mitchellkrome at gmail dot com>, thanks! OK claudio
2019-05-21init sc_rxhprio properly instead of sc_txhprio twice; CID 1480289David Gwynne
the cid thing was via jmatthew@
2019-05-21don't fall through SIOCSVNETID into SIOCGVNETID; CID 1480290David Gwynne
the cid was via jmatthew@
2019-05-18BPF: remove redundant reference counting of filedescriptorsAlexandr Nedvedicky
OK visa@, OK mpi@
2019-05-13Do not check for IFF_RUNNING inside bstp_initialization().Martin Pieuchot
This allows to set such flag after completing the initialization of a bridge and still have bstp_tick() be scheduled from the begining. Fix a regression reported by and ok markus@
2019-05-13Deal with the case where bridge_getbif() can return NULL.Martin Pieuchot
Since `bif' are removed from the interface list before calling smr_barrier() and the hash queue is cleaned up afterward, it is possible to find an ifidx with bridge_rtlookup() that won't match to any `bif'. Fix a panic reported by Hrvoje Popovski, ok visa@
2019-05-12Switch the list of span interfaces and interfaces to SMR.Martin Pieuchot
This removes the KERNEL_LOCK() around the list iteration in bridge_enqueue(). Since the NET_LOCK() isn't protecting any data structure, release it early in all the code paths coming from the Network Stack to prevent possible deadlock situations with smr_barrier(). bridge_input() is still KERNEL_LOCK()ed as well as bridge_filterrule(). ok visa@
2019-05-12pushing NET_LOCK() further down from if_clone_{create,destroy}()Alexandr Nedvedicky
OK mpi@
2019-05-12Unused switch_port variable.akoshibe
2019-05-11Correct a check in if_isconnected().Martin Pieuchot
Fix a regression introduced by the bridge(4) refactoring. Found by and ok bluhm@