net: clean up empty lines in .c and .h files
sys: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorpro
sys: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.
show more ...
Remove the NATM framework including the en(4), fatm(4), hatm(4), andpatm(4) devices.Maintaining an address family and framework has real costs when we makeinfrastructure improvements. In the cas
Remove the NATM framework including the en(4), fatm(4), hatm(4), andpatm(4) devices.Maintaining an address family and framework has real costs when we makeinfrastructure improvements. In the case of NATM we support no devicesmanufactured in the last 20 years and some will not even work in modernmotherboards (some newer devices that patm(4) could be updated tosupport apparently exist, but we do not currently have support).With this change, support remains for some netgraph modules that don'trequire NATM support code. It is unclear if all these should remain,though ng_atmllc certainly stands alone.Note well: FreeBSD 11 supports NATM and will continue to do so until atleast September 30, 2021. Improvements to the code in FreeBSD 11 arecertainly welcome.Reviewed by: philipApproved by: harti
sys/netgraph: spelling fixes in comments.No functional change.
sys: use our nitems() macro when param.h is available.This should cover all the remaining cases in the kernel.Discussed in: freebsd-current
sys/net* : for pointers replace 0 with NULL.Mostly cosmetical, no functional change.Found with devel/coccinelle.
Change the callout to supply -1 to indicate we are not changingCPU, also add protection against invalid CPU's as well assplit c_flags and c_iflags so that if a user plays with the activeflag (the
Change the callout to supply -1 to indicate we are not changingCPU, also add protection against invalid CPU's as well assplit c_flags and c_iflags so that if a user plays with the activeflag (the one expected to be played with by callers in MPSAFE) withouta lock, it won't adversely affect the callout system by causing a corruptlist. This also means that all callers need to use the macros and *not*play with the falgs directly (like netgraph used to).Differential Revision: htts://reviews.freebsd.org/D1894Reviewed by: .. timed out but looked at by jhb, imp, adrian hselasky tested by hiren and netflix.Sponsored by: Netflix Inc.
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid testingM_EXT itself. Update all callers to use the return value.With this change, very few network device drivers remain aware ofM_EXT; the primary exceptions lie in mbuf-chain pretty printers fordebugging, and in a few cases, custom mbuf and cluster allocationimplementations.NB: This is a difficult-to-test change as it touches many drivers forwhich I don't have physical devices. Instead we've gone for intensivereview, but further post-commit review would definitely be appreciatedto spot errors where changes could not easily be made mechanically,but were largely mechanical in nature.Differential Revision: https://reviews.freebsd.org/D1440Reviewed by: adrian, bz, gnnSponsored by: EMC / Isilon Storage Division
Mechanically substitute flags from historic mbuf allocator withmalloc(9) flags within sys.Exceptions:- sys/contrib not touched- sys/mbuf.h edited manually
Mechanically remove the last stray remains of spl* calls from net*/*.They have been Noop's for a long time now.
Revert previous commit...Pointyhat to: kevlo (myself)
Prefer NULL over 0 for pointers
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.The SYSCTL_NODE macro defines a list that stores all child-elements ofthat node. If there's no SYSCTL_DECL macro anywhere else,
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.The SYSCTL_NODE macro defines a list that stores all child-elements ofthat node. If there's no SYSCTL_DECL macro anywhere else, there's noreason why it shouldn't be static.
Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.This means that their use is restricted to a single C file.
Node constructor methods are supposed to be called in syscallcontext always. Convert nodes to consistently use M_WAITOK flagfor memory allocation.Reviewed by: julian
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Fix some wrong usages.Note: this does not affect generated binaries as this argument is not used.PR: 137213Submitted by: Eygene Ryab
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Fix some wrong usages.Note: this does not affect generated binaries as this argument is not used.PR: 137213Submitted by: Eygene Ryabinkin (initial version)MFC after: 1 month
Merge the remainder of kern_vimage.c and vimage.h into vnet.c andvnet.h, we now use jails (rather than vimages) as the abstractionfor virtualization management, and what remained was specific tovi
Merge the remainder of kern_vimage.c and vimage.h into vnet.c andvnet.h, we now use jails (rather than vimages) as the abstractionfor virtualization management, and what remained was specific tovirtual network stacks. Minor cleanups are done in the process,and comments updated to reflect these changes.Reviewed by: bzApproved by: re (vimage blanket)
Build on Jeff Roberson's linker-set based dynamic per-CPU allocator(DPCPU), as suggested by Peter Wemm, and implement a new per-virtualnetwork stack memory allocator. Modify vnet to use the alloca
Build on Jeff Roberson's linker-set based dynamic per-CPU allocator(DPCPU), as suggested by Peter Wemm, and implement a new per-virtualnetwork stack memory allocator. Modify vnet to use the allocatorinstead of monolithic global container structures (vinet, ...). Thischange solves many binary compatibility problems associated withVIMAGE, and restores ELF symbols for virtualized global variables.Each virtualized global variable exists as a "reference copy", and alsoonce per virtual network stack. Virtualized global variables aretagged at compile-time, placing the in a special linker set, which isloaded into a contiguous region of kernel memory. Virtualized globalvariables in the base kernel are linked as normal, but those in modulesare copied and relocated to a reserved portion of the kernel's vnetregion with the help of a the kernel linker.Virtualized global variables exist in per-vnet memory set up when thenetwork stack instance is created, and are initialized statically fromthe reference copy. Run-time access occurs via an accessor macro, whichconverts from the current vnet and requested symbol to a per-vnetaddress. When "options VIMAGE" is not compiled into the kernel, normalglobal ELF symbols will be used instead and indirection is avoided.This change restores static initialization for network stack globalvariables, restores support for non-global symbols and types, eliminatesthe need for many subsystem constructors, eliminates large per-subsystemstructures that caused many binary compatibility issues both formonitoring applications (netstat) and kernel modules, removes theper-function INIT_VNET_*() macros throughout the stack, eliminates theneed for vnet_symmap ksym(2) munging, and eliminates duplicatedefinitions of virtualized globals under VIMAGE_GLOBALS.Bump __FreeBSD_version and update UPDATING.Portions submitted by: bzReviewed by: bz, zecDiscussed with: gnn, jamie, jeff, jhb, julian, samSuggested by: peterApproved by: re (kensmith)
Use proper form of gnu designated initalizers. This letsclang compile this files.Approved by: ed (mentor)Silence from: harti (maintainer?)
After cleaning up rt_tables from vnet.h and cleaning up opt_route.ha lot of files no longer need route.h either. Garbage collect them.While here remove now unneeded vnet.h #includes as well.
After r193232 rt_tables in vnet.h are no longer indirectly dependent onthe ROUTETABLES kernel option thus there is no need to include opt_route.hanymore in all consumers of vnet.h and no longer dep
After r193232 rt_tables in vnet.h are no longer indirectly dependent onthe ROUTETABLES kernel option thus there is no need to include opt_route.hanymore in all consumers of vnet.h and no longer depend on it for modulebuilds.Remove the hidden include in flowtable.h as well and leave the twoexplicit #includes in ip_input.c and ip_output.c.
Make Netgraph compile with Clang.Clang disallows structs with variable length arrays to be nested insideother structs, because this is in violation with ISO C99. Even though wecan keep bugging th
Make Netgraph compile with Clang.Clang disallows structs with variable length arrays to be nested insideother structs, because this is in violation with ISO C99. Even though wecan keep bugging the LLVM folks about this issue, we'd better just fixour code to not do this. This code seems to be the only code in theentire source tree that does this.I haven't tested this patch by using the kernel modules in question, butDiane Bruce and I have compared disassembled versions of these kernelmodules. We would have expected them to be exactly the same, but due torandomness in the register allocator and reordering of instructions,there were some minor differences.Approved by: julian
Add memmove() to the kernel, making the kernel compile with Clang.When copying big structures, LLVM generates calls to memmove(), becauseit may not be able to figure out whether structures overlap
Add memmove() to the kernel, making the kernel compile with Clang.When copying big structures, LLVM generates calls to memmove(), becauseit may not be able to figure out whether structures overlap. This causedlinker errors to occur. memmove() is now implemented using bcopy().Ideally it would be the other way around, but that can be solved in thefuture. On ARM we don't do add anything, because it already hasmemmove().Discussed on: arch@Reviewed by: rdivacky
For all files including net/vnet.h directly include opt_route.h andnet/route.h.Remove the hidden include of opt_route.h and net/route.h from net/vnet.h.We need to make sure that both opt_route.h
For all files including net/vnet.h directly include opt_route.h andnet/route.h.Remove the hidden include of opt_route.h and net/route.h from net/vnet.h.We need to make sure that both opt_route.h and net/route.h are includedbefore net/vnet.h because of the way MRT figures out the number of FIBsfrom the kernel option. If we do not, we end up with the default numberof 1 when including net/vnet.h and array sizes are wrong.This does not change the list of files which depend on opt_route.hbut we can identify them now more easily.
Rather than using hidden includes (with cicular dependencies),directly include only the header files needed. This reduces theunneeded spamming of various headers into lots of files.For now, this
Rather than using hidden includes (with cicular dependencies),directly include only the header files needed. This reduces theunneeded spamming of various headers into lots of files.For now, this leaves us with very few modules including vnet.hand thus needing to depend on opt_route.h.Reviewed by: brooks, gnn, des, zec, impSponsored by: The FreeBSD Foundation
123