Various minor whitespace cleanupsAccumulated along the way.
busdma - Remove filter functionality- Remove filtfunc and filtarg arguments from bus_dma_tag_create() and fix all callers. All callers use NULL today for both filterfunc and filterarg with one
busdma - Remove filter functionality- Remove filtfunc and filtarg arguments from bus_dma_tag_create() and fix all callers. All callers use NULL today for both filterfunc and filterarg with one exception: if_jme.- Remove filter functionality internally and parent tag tracking. Without filter functions, we do not need to keep track of tag ancestry. All inheritance of the parent tag's parameters occurs when creating the new child tag.- rename run_filter() to addr_needs_bounce().- FreeBSD keeps the filtfunc and filtarg arguments but requires them to be NULL.- Drop filterfunc usage from if_jme. In case of "JMC260 chip full mask revision 2", which has a hardware bug when it comes to DMA transfers crossing the 4 GB bounday, the parent buffer tag already limits DMA memory to 32bit address space. As such it should be safe to drop the filterfunc. The filterfunc was checking if the lower 32bits of the physical address used for DMA are all 0. In case of a 32bit address space, the only address where all lower 32-bits are all zero is 0 itself and I am here assuming that the physical address 0 is not used for DMA transfers!Mainly obtained from: FreeBSD (commits 7cb028de, 900907f4, 1228b93b, 3933ff56)
show more ...
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: 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.
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
kernel: Generate miidevs.h, pccarddevs.h and pcidevs.h on the fly.It removes the need to regenerate those header file after first editingthe associated list of IDs (miidevs, pccarddevs or pcidevs)
kernel: Generate miidevs.h, pccarddevs.h and pcidevs.h on the fly.It removes the need to regenerate those header file after first editingthe associated list of IDs (miidevs, pccarddevs or pcidevs). After thiscommit, editing the list alone is enough to add IDs.We already did it like that for usb4bsd's usbdevs.h before. This commitadjusts things for the remaining ID lists.
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
rl: Take DLink DFE520TX C1Obtained-from: FreeBSD 245485
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
rl: Switch from device_polling to ifpollOptimize the RX path a little bit by reading the RL_CURRXADDR andRL_CURRXBUF only if necessary; reading these two registers is quitetime consuming
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.
rl(4): Fix an old typoIf receiving buffer wrapping happens, the first size of copy should be thesize of the buffer at the end of the receiving buffer.DragonFly-Bug: http://bugs.dragonflybsd.org/
rl(4): Fix an old typoIf receiving buffer wrapping happens, the first size of copy should be thesize of the buffer at the end of the receiving buffer.DragonFly-Bug: http://bugs.dragonflybsd.org/issue2083
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
rl(4): Read IDR to extract MAC address for unknown 8139 chipsObtained-from: FreeBSDSubmitted-by: Saifi Khan <saifi.khan@datasynergy.org>
modules: remove KMODDEPS, it is not used anymore
rl(4): Don't use magic number
rl(4): Rework busdma(9) related bits- Correct parameters passed to busdma(9) functions.- Split RX/TX busdma tag.- Use bus_dmamem_coherent() to allocate RX buffers.- Create TX buffer busdma map a
rl(4): Rework busdma(9) related bits- Correct parameters passed to busdma(9) functions.- Split RX/TX busdma tag.- Use bus_dmamem_coherent() to allocate RX buffers.- Create TX buffer busdma map at attach time and destroy them only at detach time.- Rework rl_encap().- Don't sync RX buffers, which is coherent memory.
123