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.
kernel: Fix two more -Wcast-qual warnings reported by clang.Use __DECONST() in another case that I had fixed in cebef8bba30e3313d8f2with a (void *) cast.
kernel: Remove numerous #include <sys/thread2.h>.Most of them were added when we converted spl*() calls tocrit_enter()/crit_exit(), almost 14 years ago. We can nowremove a good chunk of them agai
kernel: Remove numerous #include <sys/thread2.h>.Most of them were added when we converted spl*() calls tocrit_enter()/crit_exit(), almost 14 years ago. We can nowremove a good chunk of them again for where crit_*() areno longer used.I had to adjust some files that were relying on thread2.hor headers that it includes coming in via other headersthat it was removed from.
show more ...
i386 removal, part 69/x: Clean up sys/dev/netif.According to comments from sephe.
kernel: Add 'static' to some function definitions.The declarations already have it, so no functional difference.
kernel - Remove PG_ZERO and zeroidle (page-zeroing) entirely* Remove the PG_ZERO flag and remove all page-zeroing optimizations, entirely. Aftering doing a substantial amount of testing, these
kernel - Remove PG_ZERO and zeroidle (page-zeroing) entirely* Remove the PG_ZERO flag and remove all page-zeroing optimizations, entirely. Aftering doing a substantial amount of testing, these optimizations, which existed all the way back to CSRG BSD, no longer provide any benefit on a modern system. - Pre-zeroing a page only takes 80ns on a modern cpu. vm_fault overhead in general is ~at least 1 microscond. - Pre-zeroing a page leads to a cold-cache case on-use, forcing the fault source (e.g. a userland program) to actually get the data from main memory in its likely immediate use of the faulted page, reducing performance. - Zeroing the page at fault-time is actually more optimal because it does not require any reading of dynamic ram and leaves the cache hot. - Multiple synth and build tests show that active idle-time zeroing of pages actually reduces performance somewhat and incidental allocations of already-zerod pages (from page-table tear-downs) do not affect performance in any meaningful way.* Remove bcopyi() and obbcopy() -> collapse into bcopy(). These other versions existed because bcopy() used to be specially-optimized and could not be used in all situations. That is no longer true.* Remove bcopy function pointer argument to m_devget(). It is no longer used. This function existed to help support ancient drivers which might have needed a special memory copy to read and write mapped data. It has long been supplanted by BUSDMA.
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
kernel: make pktinfo and cpuid native to ip_input()In order to remove ether_input_pkt(), switch the prototypeof if_input() and adjust all callers. While there, consolidatethe style of the invoke
kernel: make pktinfo and cpuid native to ip_input()In order to remove ether_input_pkt(), switch the prototypeof if_input() and adjust all callers. While there, consolidatethe style of the invoke.Suggested and reviewed by: sephe
ifq: Remove the unused parameter 'mpolled' from ifq dequeue interfaceThe ifq_poll() -> ifq_dequeue() model is not MPSAFE, and mpolled hasnot been used, i.e. set to NULL, for years; time to let it
ifq: Remove the unused parameter 'mpolled' from ifq dequeue interfaceThe ifq_poll() -> ifq_dequeue() model is not MPSAFE, and mpolled hasnot been used, i.e. set to NULL, for years; time to let it go.
netif: Setup TX ring CPUID before hooking up interrupt vectors
kernel: Use DEVMETHOD_END in the drivers.
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 1 of many; introduce ifaltq subqueuePut the plain queue information, e.g. queue header and tail, serializer,packet staging scoreboard and ifnet.if_start schedule
if: Multiple TX queue support step 1 of many; introduce ifaltq subqueuePut the plain queue information, e.g. queue header and tail, serializer,packet staging scoreboard and ifnet.if_start schedule netmsg etc. intoits own structure (subqueue). ifaltq structure could have multiple ofsubqueues based on the count that drivers can specify.Subqueue's enqueue, dequeue, purging and states updating are protectedby the subqueue's serializer, so for hardwares supporting multiple TXqueues, contention on queuing operation could be greatly reduced.The subqueue is passed to if_start to let the driver know which hardwareTX queue to work on. Only the related driver's TX queue serializer willbe held, so for hardwares supporting multiple TX queues, contention ondriver's TX queue serializer could be greatly reduced.Bunch of ifsq_ prefixed functions are added, which is used to performvarious operations on subqueues. Commonly used ifq_ prefixed functionsare still kept mainly for the drivers which do not support multiple TXqueues (well, these functions also ease the netif/ convertion in thisstep :).All of the pseudo network devices under sys/net are converted to use thenew subqueue operation. netproto/802_11 is converted too. igb(4) isconverted to use the new subqueue operation, the rest of the networkdrivers are only changed for the if_start interface modification.For ALTQs which have packet scheduler enabled, only the first subqueueis used (*).(*) Whether we should utilize multiple TX queues if ALTQ's packet scheduleris enabled is quite questionable. Mainly because hardware's multiple TXqueue packet dequeue mechanism could have negative impact on ALTQ's packetscheduler's decision.
if: Move if_cpuid into ifaltq; prepare multiple TX queues supportif_cpuid and if_npoll_cpuid are merged and moved into ifaltq asaltq_cpuid, which indicates the owner CPU of the tx queue. Sincewe
if: Move if_cpuid into ifaltq; prepare multiple TX queues supportif_cpuid and if_npoll_cpuid are merged and moved into ifaltq asaltq_cpuid, which indicates the owner CPU of the tx queue. Sincewe already have code in if_start_dispatch() to catching tx queueowner CPU changes, this merging is quite safe.
if: Move IFF_OACTIVE bit into ifaltq; prepare multiple TX queues supportifaltq.altq_hw_oactive is now used to record that NIC's TX queue is full.IFF_OACTIVE is removed from kernel. User space IFF
if: Move IFF_OACTIVE bit into ifaltq; prepare multiple TX queues supportifaltq.altq_hw_oactive is now used to record that NIC's TX queue is full.IFF_OACTIVE is removed from kernel. User space IFF_OACTIVE is kept forcompability.ifaltq.altq_hw_oactive should not be accessed directly. Following set offunctions are provided and should be used:ifq_is_oactive(ifnet.if_snd) - Whether NIC's TX queue is full or notifq_set_oactive(ifnet.if_snd) - NIC's TX queue is fullifq_clr_oactive(ifnet.if_snd) - NIC's TX queue is no longer full
dc: Add missing ifpoll_compat_setup
dc: Switch from device_polling to ifpoll
kernel: Remove newlines from the panic messages that have one.panic() itself will add a newline.
intr: Remove no longer correct ithread_cpuid; use rman_get_cpuid instead
kernel: Use NULL for DRIVER_MODULE()'s evh & arg (which are pointers).This is just cosmetics for easier reading.
dc(4): Add IDs for the Abocom FE2500.Tested-by: Max Herrgard <herrgard@gmail.com>
network code: Convert if_multiaddrs from LIST to TAILQ.It can then be traversed backwards in the three drivers which wantto do that.Taken-from: FreeBSD
modules: remove KMODDEPS, it is not used anymore
Nuke INTR_NETSAFE
- In dc_intr(), check IFF_RUNNING instead of IFF_UP; this closes a possible time window between IFF_UP is set but not IFF_RUNNING.- In dc_ioctl(), don't program multicast filter, if NIC is not run
- In dc_intr(), check IFF_RUNNING instead of IFF_UP; this closes a possible time window between IFF_UP is set but not IFF_RUNNING.- In dc_ioctl(), don't program multicast filter, if NIC is not running yet. Add assertion in Xircom's multicast filter programming function to make sure that NIC is running.- Don't set IFF_RUNNING in Xircom's multicast filter programming function.- Move setting IFF_RUNNING before programming multicast filter; just to keep the IFF_RUNNING assertion work. Add comment about itDragonfly-bug: <http://bugs.dragonflybsd.org/issue1106>Tested-by: Tim <t-df@timdarby.net>
1234