stf(4): Set ND6 flags to disable auto link-local and DADClear the 'ND6_IFF_AUTO_LINKLOCAL' flag and set the 'ND6_IFF_NO_DAD'flag for the stf(4) interface after if_attach(). In this way, thequirk
stf(4): Set ND6 flags to disable auto link-local and DADClear the 'ND6_IFF_AUTO_LINKLOCAL' flag and set the 'ND6_IFF_NO_DAD'flag for the stf(4) interface after if_attach(). In this way, thequirks in in6_ifattach() is removed.
show more ...
Various minor whitespace cleanupsAccumulated along the way.
kernel: Remove unnecessary casts for updated mbuf(9) functions
Use sizeof(uint32_t) for bpfattach(DLT_NULL) for clarityThe DLT_NULL link-layer header is a 4-byte field in host byte order. Souse 'sizeof(uint32_t)' instead of 'sizeof(u_int)' to make it clear.
network - Remove host-order translations of ipv4 ip_off and ip_len* Do not translate ip_off and ip_len to host order and then back again in the network stack. The fields are now left in network
network - Remove host-order translations of ipv4 ip_off and ip_len* Do not translate ip_off and ip_len to host order and then back again in the network stack. The fields are now left in network order.
kernel: Rename BUILDING_WITH_KERNEL to KERNBUILDDIR.Fits better with e.g. KERNCONFDIR.Add a small paragraph in kmod.mk which was taken from FreeBSD.
stf/gre: Make sure the input packet's hash is recalculated.
netisr: Simplify assertion related bits
stf: Make route per-cpu. And it should run in the first netisr_ncpus netisrs.
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.The main reason is that our having to use the MB_WAIT and MB_DONTWAITflags was a recurring issue when porting drivers from FreeBSD
kernel: Move us to using M_NOWAIT and M_WAITOK for mbuf functions.The main reason is that our having to use the MB_WAIT and MB_DONTWAITflags was a recurring issue when porting drivers from FreeBSD becauseit tended to get forgotten and the code would compile anyway with thewrong constants. And since MB_WAIT and MB_DONTWAIT ended up as ocflagsfor an objcache_get() or objcache_reclaimlist call (which use M_WAITOKand M_NOWAIT), it was just one big converting back and forth with somesanitization in between.This commit allows M_* again for the mbuf functions and keeps thesanitizing as it was before: when M_WAITOK is among the passed flags,objcache functions will be called with M_WAITOK and when it is absent,they will be called with M_NOWAIT. All other flags are scrubbed by theMB_OCFLAG() macro which does the same as the former MBTOM().Approved-by: dillon
route: Remove the unused rt_addrinfo parameter from ifa_rtrequest
ifsq: Let ifaltq_subque know its related hardware TX queue's serializerThis avoids following operations on packet transmission hot path:- Dereferening device driver supplied serialize function poi
ifsq: Let ifaltq_subque know its related hardware TX queue's serializerThis avoids following operations on packet transmission hot path:- Dereferening device driver supplied serialize function pointers- Locating hardware TX queue's serializerComparing to the lwkt_serialize functions, the above two operations arecostful.Driver changes:- For device drivers which use the default ifnet serializer, no additional code will be needed, if_attach() will assign ifnet serializer to ifaltq_subque.- For device drivers which use independent serializers for main function, RX queues and TX queues, ifsq_set_hw_serialize() must be called to properly assign the hardware TX queue's serializer to ifaltq_subque. Drivers in this category are bce(4), emx(4), igb(4) and jme(4).
if: Per-cpu ifnet/ifaddr statistics, step 1/3Wrap ifnet/ifaddr stats updating, setting and extraction into macros;ease upcoming changes.
if: Multiple TX queue support step 2 of manyifnet_{serialize,deserialize,tryserialize}_tx and hardware TX serializerasserion macros now require subqueue, so the proper hardware TX queue'sserializ
if: Multiple TX queue support step 2 of manyifnet_{serialize,deserialize,tryserialize}_tx and hardware TX serializerasserion macros now require subqueue, so the proper hardware TX queue'sserializer could be held, released and asserted.
ifq: Use ifq_set_maxlen for ifnet.if_snd
bpf: Use bpf global token instead mplock to protect bpf stuffsSubmitted-by: tuxillo@ w/ modification
network - Major netmsg retooling, part 1* Remove all the netmsg shims and make all pr_usrreqs and some proto->pr_* requests directly netmsg'd.* Fix issues with tcp implied connects and tcp6->tc
network - Major netmsg retooling, part 1* Remove all the netmsg shims and make all pr_usrreqs and some proto->pr_* requests directly netmsg'd.* Fix issues with tcp implied connects and tcp6->tcp4 fallbacks with implied connects.* Fix an issue with a stack-based udp netmsg (allocate it)* Consolidate struct ip6protosw and struct protosw into a single structure and normalize the API functions which differed between the two (primarily proto->pr_input()).* Remove protosw->pr_soport()* Replace varargs protocol *_input() functions (ongoing) with fixed arguments.
network - Completely revamp the netisr / dispatch code* All netisrs are dispatched MPSAFE (followup in later commits)* Centralize the protocol threads. There is now just one thread per cpu man
network - Completely revamp the netisr / dispatch code* All netisrs are dispatched MPSAFE (followup in later commits)* Centralize the protocol threads. There is now just one thread per cpu managed by the netisr code. No more separate tcp/udp threads on each cpu.* Make the mbuf M_HASH/m_pkthdr.hash mechanic the central routing mechanic for netmsgs.* Remove the netisr ip_mport and pktinfo_portfn stuff and replace with a cpufn function which handles M_HASH/m_pkthdr.hash when M_HASH is not already set.* Seriously clean up the packet input paths. Adjust ether_input_chain() and friends to not have to adjust the mbuf forwards and backwards, instead pass a header offset to the ni_cpufn function. The ip pullup and other related code will use the offset to determine where the ip header is within the packet.
kmod.mk: Remove some dead code supposed to handle modules' manual pages.It was ignored previously and since we do not keep kernel relatedmanual pages in sys/ the whole idea is bogus anyway.
Split ifnet serialize step 1/many: Add if_{serialize,deserialize,tryserialize}()function pointers to ifnet.These three function pointers accept ifnet struct and ifnet_serializeenumeration.The i
Split ifnet serialize step 1/many: Add if_{serialize,deserialize,tryserialize}()function pointers to ifnet.These three function pointers accept ifnet struct and ifnet_serializeenumeration.The ifnet_serialize enumeration indicates the serialization type:IFNET_SERIALIZE_ALL: All of the serializers should be held. Except for if_start and if_input, this enumeration must be used when call ifnet function pointers.IFNET_SERIALIZE_TX: Only transmit serializer should be held. This enumeration could be used when calling ifnet.if_start.IFNET_SERIALIZE_RX: Only receive serializer should be held. This enumeration could be used when calling ifnet.if_input.If the NIC driver does not set these three function pointer, then if_attach()will set them to the default ones: only one serializer (if_serializer) is usedand ifnet_serialize parameter is ignored.Following several inline functions are added which are sheer wrappers of thethree ifnet serialize function pointers:ifnet_serialize_{all,tx,rx}()ifnet_deserialize_{all,tx,rx}()ifnet_tryserialize_{all,tx,rx}()All of the protocol layers and most of the pseudo drivers are converted.Discussed-with: dillon@
pr_ctlinput is usually called when certains types of ICMP packets are received.However, the processing of ICMP packets happens in netisr0, which means thethread context, in which pr_ctlinput is cal
pr_ctlinput is usually called when certains types of ICMP packets are received.However, the processing of ICMP packets happens in netisr0, which means thethread context, in which pr_ctlinput is called, is not correct. To handle thisfollowing two fixes are applied:- Add pr_ctlport to protosw and ip6protosw, which could be used to locate correct msgport to call pr_ctlinput for specific protocol- All necessary information needed by pr_ctlinput are gather into one netmsg, and this netmsg is delivered synchronously (some information is on the stack)Note for new protocol implementation:pr_ctlinput and pr_ctlport should be both NULL or both non-NULL.Obtained-from: dillon@Tested-by: pavalos@
Parallelize in_ifaddrhashtbl
Parallelize in_ifaddrhead operation
Reduce ifnet.if_serializer contention on output path:- Push ifnet.if_serializer holding down into each ifnet.if_output implementation- Add a serializer into ifaltq, which is used to protect send qu
Reduce ifnet.if_serializer contention on output path:- Push ifnet.if_serializer holding down into each ifnet.if_output implementation- Add a serializer into ifaltq, which is used to protect send queue instead of its parent's if_serializer. This change has following implication: o On output path, enqueueing packets and calling ifnet.if_start are decoupled o In device drivers, poll->dev_encap_ok->dequeue operation sequence is no longer safe, instead dequeue->dev_encap_fail->prepend should be used This serializer will be held by using lwkt_serialize_adaptive_enter()- Add altq_started field into ifaltq, which is used to interlock the calling of its parent's if_start, to reduce ifnet.if_serializer contention. if_devstart(), a helper function which utilizes ifaltq.altq_started, is added to reduce code duplication in ethernet device drivers.- Add if_cpuid into ifnet. This field indicates on which CPU device driver's interrupt will happen.- Add ifq_dispatch(). This function will try to hold ifnet.if_serializer in order to call ifnet.if_start. If this attempt fails, this function will schedule ifnet.if_start to be called on CPU located by ifnet.if_start_cpuid if_start_nmsg, which is per-CPU netmsg, is added to ifnet to facilitate ifnet.if_start scheduling. ifq_dispatch() is called by ether_output_frame() currently- Use ifq_classic_ functions, if altq is not enabled- Fix various device drivers bugs in their if_start implementation- Add ktr for ifq classic enqueue and dequeue- Add ktr for ifnet.if_start
Parallelize ifnet.if_addrhead accessing by duplicating the list itselfon each CPU, each list element points to ifaddr:- Add SI_SUB_PRE_DRIVERS before SI_SUB_DRIVERS, so action could be taken befo
Parallelize ifnet.if_addrhead accessing by duplicating the list itselfon each CPU, each list element points to ifaddr:- Add SI_SUB_PRE_DRIVERS before SI_SUB_DRIVERS, so action could be taken before drivers' initialization (mainly before NIC driver's if_attach())- Move netisr_init() to the FIRST of SI_SUB_PRE_DRIVERS, so that netmsg_service_port_init() could be called in earlier stage of system initialization.- Create one thread on each CPU to propagate changes to ifnet.if_addrhead. Their thread ports are registered with netmsg_service_port_init() for port syncing operation.- Change to ifnet.if_addrhead begins in netisr0, i.e. serial of changes to ifnet.if_addrhead are serialized by netisr0- ifaddr's refcnt is moved to its list elements, i.e. per-CPU refcnt. They are initialized to 1 instead of 0.- A magic field is added to ifaddr list element to make sure that IFAREF and IFAFREE are called on valid ifaddr list element. This field is initialized to a magic value and is wiped out once the list element's refcnt drops to 0- To close the gap between testing and freeing, once the ifaddr list element's refcnt drops to 0, ifa_portfn(0) (a thread's port on CPU0) is poked to check whether ifaddr is referenced on other CPUs, if not, then ifaddr is freed on ifa_portfn(0)Reviewed-by: dillon@ (earlier version)
12