summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2015-10-08use the state id to set a flowid on an mbuf.David Gwynne
ok mpi@ mikeb@ sthen@
2015-10-08Unlock the softnet task.Martin Pieuchot
ok dlg@, kettenis@
2015-10-08Use the radix API directly and get rid of the function pointers. ThereMartin Pieuchot
is no point in keeping an unused level of abstraction. ok mikeb@, claudio@
2015-10-07one simple free, ok mpiTheo de Raadt
another not so simple free, repaired by mpi
2015-10-07rn_inithead() offset argument is now specified in byte, missed in previous.Martin Pieuchot
2015-10-07Make rtable_get() private to ensure it won't be used outside ofMartin Pieuchot
net/rtable.c. This will ease the introduction of rtable_put(). Routing tables are mapped to a tuple (idx, af) so the public API should as much as possible require these two keys. ok dlg@
2015-10-07Initialize the routing table before domains.Martin Pieuchot
The routing table is not an optional component of the network stack and initializing it inside the "routing domain" requires some ugly introspection in the domain interface. This put the rtable* layer at the same level of the if* level. These two subsystem are organized around the two global data structure used in the network stack: - the global &ifnet list, to be used in process context only, and - the routing table which can be read in interrupt context. This change makes the rtable_* layer domain-aware and extends the "struct domain" such that INET, INET6 and MPLS can specify the length of the binary key used in lookups. This allows us to keep, or move towards, AF-free route and rtable layers. While here stop the madness and pass the size of the maximum key length in *byte* to rn_inithead0(). ok claudio@, mikeb@
2015-10-07Move route entry debug helpers where they belong.Martin Pieuchot
2015-10-07Move the reference counting of a newly created route entry insideMartin Pieuchot
rtable_insert(). inputs and ok bluhm@
2015-10-07Do not call bpf_catchpacket() if another CPU detached a file from theMartin Pieuchot
corresponding interface. bfp_tap() and _bpf_mtap() are mostly run without the KERNEL_LOCK. The use of SRPs in these functions gives us the guarantees that manipulated BPF descriptors are alive but not the associated interface desctiptor! And indeed they can be cleared by another CPU running bpf_detachd(). Prevent a race reported by Hrvoje Popovski when closing tcpdump(8) with an IPL_MPSAFE ix(4). ok mikeb@, dlg@, deraadt@
2015-10-05Revert if_oqdrops accounting changes done in kernel, per request from mpi@.Masao Uebayashi
(Especially adding IF_DROP() after IFQ_ENQUEUE() was completely wrong because IFQ_ENQUEUE() already does it. Oops.) After this revert, the situation becomes: - if_snd.ifq_drops is incremented in either IFQ_ENQUEUE() or IF_DROP(), but it is not shown to userland, and - if_data.ifi_oqdrops is shown to userland, but it is not incremented by anyone.
2015-10-05Count IFQ_ENQUEUE() failure as output drop.Masao Uebayashi
mpi@ prefers checking IFQ_ENQUEUE() error, and this matches that. OK dlg@
2015-10-05Don't count IF_DROP()'ed packets as if_oerrors too.Masao Uebayashi
mpi@ plans to clean-up IF_DROP()'s, but fix consistent use of it for now. OK dlg@
2015-10-05Accumulate ifq_drops into if_oqdrops if if_start().Masao Uebayashi
mpi@ questioned usefulness of if_snd.ifq_drops, but this is what exists now. This area is going to be readily polished. OK dlg@
2015-10-05Add ifi_oqdrops and its alias to struct if_data.Masao Uebayashi
Necessary bumps in Ports will be handled by sthen@. OK mpi@ dlg@
2015-10-05Factor LACP frame processing out to a separate taskMike Belopuhov
This is slightly refactored version of the diff by jmatthew@ that makes use of a single per-trunk task but retains per-port mbuf queues. Running LACP frame processing in a task context allows a simple way to synchronize changes to the trunk ports and trunk itself performed from the ioctl, timeout and task contexts with a kernel lock. OK mpi
2015-10-05Fix ip_is_idle_packet() to parse packets properly.YASUOKA Masahiko
diff from Yuuichi Someya
2015-10-03Enable eigrpd(8) and eigrpctl(8) in the buildsRenato Westphal
ok deraadt@
2015-10-03IPv6 transport for pflow data.Florian Obser
Input deraadt@ Bug fix & OK benno@
2015-10-03When multiple vxlan interfaces are configured with same VNI, select theYASUOKA Masahiko
interface whose tunnel destination corresponded to the incoming packets' source address. ok reyk
2015-10-01Revert previous, it also breaks naddy@'s nested NFS setup.Martin Pieuchot
2015-09-30rename the internal functions that do ml_foo ops on classes to hfsc_cl_foo.David Gwynne
this avoids confusion with the public functions (hfsc_enqueue, hfsc_dequeue, etc), and maps almost 1:1 to the mbuf list ops they now use. ok mpi@ henning@ mikeb@
2015-09-30Remove remnants of sppp's special queue handling for telnet/rlogin/ftp,Stuart Henderson
the rest was done in r1.96. ok mikeb@
2015-09-30provide a hfsc_requeue()David Gwynne
this will allow packets to taken off an interfaces send queue, and requeued if space didnt exist on the hardware. the internal names are a bit ugly, i want to change them in the next commit. ok henning@ mpi@
2015-09-30sleep until all references to an interface have been released during detach.David Gwynne
this is done by moving to the refcnt api and using refcnt_finalize. tested by Hrjove Popovski ok mpi@
2015-09-30Do not try to refetch a route at the L2 layer if the given one is DOWNMartin Pieuchot
and always return EHOSTUNREACH. Please let me know if you find any new "No route to host" error. ok claudio@
2015-09-30remove cisco hdlc code from sppp(4), it's no longer used - pppoe(4) only usesStuart Henderson
ppp framing, and the drivers for sync serial cards have been removed so the sppp code is now only used to support pppoe(4). ok mpi@, kill it chris@
2015-09-29make the bpf filters a bpf_program instead of an array of bpf_insn.David Gwynne
bpf_program contains a pointer to that same array, but also the number of elements in it. this allows us to know the size when we want to free them. ok deraadt@
2015-09-29add sizes to some of the simpler free callsTheo de Raadt
ok mpi
2015-09-28Use the radix-tree API instead of function pointers.Martin Pieuchot
2015-09-28Factors ou the route hashing code to implement Equal-Cost Multi-PathMartin Pieuchot
for ART. While here sync the two remaining mix() macros. ok chris@, dlg@
2015-09-28Merge gif(4)'s tentacles in a single file.Martin Pieuchot
Tested by <mxb AT alumni DOT chalmers DOT se>. ok dlg@
2015-09-28Remove "if_tp" from the "struct ifnet".Martin Pieuchot
Instead of violating a layer of abstraction by keeping per pseudo-driver informations in "struct ifnet", the port trunk is now passed as a cookie to the interface input handler (ifih). The time of per pseudo-driver hack in the network stack is over! ok mikeb@
2015-09-27Welcome etheranyaddr, cousin of etherbroadcastaddr.Stefan Sperling
Can be used to check if a MAC address is all zeros. Will be used by iwm(4) soon. ok kettenis@
2015-09-27Add if_setlladdr(), factored out from ifioctl(). Will be used by iwm(4) soon.Stefan Sperling
With suggestions from tedu@ and guenther@ ok kettenis@
2015-09-27pull the m_freem calls out of hfsc_enqueue by having IFQ_ENQUEUE freeDavid Gwynne
the mbuf in both the hfsc and priq error paths. ok mikeb@ mpi@ claudio@ henning@
2015-09-25Ensure that RTF_LOCAL route entries always stay UP.Martin Pieuchot
Local route entries, being now attached to their corresponding interface, are susceptible to be brought DOWN when a link state change occurs. When this happens locally configured addresses are no longer reachable. So keep the previous (original) behavior by forcing such route entries to always be UP. ok sthen@, claudio@
2015-09-24add a comment explaining how we serialize when switching trunkproto;Mike Belopuhov
requested by mpi@
2015-09-24Avoid a theoretical m_pullup(9) mishandling by delegating the mbufMike Belopuhov
reclaiming to the PDU and marker input routines. m_pullup may return a pointer to the newly allocated mbuf. In this case m_freem is called by the trunk_input, not by the proto specific code and pointer to the mbuf is not passed by reference. Therefore m_freem will either be called on the middle element of the chain (when the m_pullup call succeeds) or on the stale pointer (when it frees the chain in the failure case). Fortunately we should never hit this case as the receive path uniformly uses contiguous chunks of memory. Verified with and ok blambert, ok mpi
2015-09-23Serialize trunk changes with input handler insertion and removal.Mike Belopuhov
This moves around calls to if_ih_insert and if_ih_remove to ensure that we either have completed port initialization or are going to tear the port configuration down and don't want any input processes to get hold of the port. When trunk_port_destroy is called from the ioctl this would wait for all input processes to finish and release their references to be able to disestablish the input handler and ensure full control of the port. When switching trunkproto it is required for the ioctl context to be able to touch all trunk ports and the protocol (tr_psc). The easiest way do this is to disestablish all input handlers (while making sure they all complete) and then reestablish them after the trunk reconfiguration is completed. This avoids getting trunk a separate locking protocol of its own. ok mpi, suggested by and ok dlg
2015-09-23Removes locking macros that we've inherited from NetBSD/FreeBSD.Mike Belopuhov
ok dlg, mpi
2015-09-23Keep track of an active port in the failover trunk to avoid listMike Belopuhov
iterations and additional locking protection in the future. Suggested by and ok mpi
2015-09-23Remove trunk watchdog code since it doesn't do anything usefulMike Belopuhov
and we want to limit the number of different places where we access trunk port pointers. trunk_watchdog should be never called as we don't set up it's if_timer and trunk_port_watchdog just calls the if_watchdog from the underlying interface. It's possible that this is no longer needed due to if_slowtimo/ if_watchdog changes done earlier. ok mpi
2015-09-23Always increment rt_use inside rtalloc(9) instead of doing it in someMartin Pieuchot
specific places. ok claudio@, benno@
2015-09-22Use the radix-tree API instead of function pointers.Martin Pieuchot
ok yasuoka@
2015-09-22When a connected route is deleted, pass the corresponding priority toMartin Pieuchot
rtrequest1(9) otherwise the route will remain attached to a stale ifa. Found by matthieu@
2015-09-21Pass the correct variable to free(9) and while here add the size.Martin Pieuchot
From David Hill, ok sthen@
2015-09-21Set the correct priority for connected routes.Martin Pieuchot
Found by benno@. ok phessler@, claudio@, benno@
2015-09-17instead of leaking rarp packets, break from the switch statementDavid Gwynne
so packets can get enqueued for the arp netisr to process. fixes jsgs nfs mountroot problem.
2015-09-15link_addr() is gonePhilip Guenther
ok mpi@