summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/atm
Commit message (Collapse)AuthorAgeFilesLines
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-052-5/+5
| | | | | | | | | malloc(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*/*.andre2012-10-184-12/+0
| | | | They have been Noop's for a long time now.
* Revert previous commit...kevlo2012-10-101-1/+1
| | | | Pointyhat to: kevlo (myself)
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+2
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-072-4/+4
| | | | This means that their use is restricted to a single C file.
* Node constructor methods are supposed to be called in syscallglebius2011-04-184-9/+4
| | | | | | | context always. Convert nodes to consistently use M_WAITOK flag for memory allocation. Reviewed by: julian
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.antoine2009-12-281-10/+10
| | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-011-1/+0
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorrwatson2009-07-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith)
* Use proper form of gnu designated initalizers. This letsrdivacky2009-06-241-1/+1
| | | | | | | clang compile this files. Approved by: ed (mentor) Silence from: harti (maintainer?)
* After cleaning up rt_tables from vnet.h and cleaning up opt_route.hbz2009-06-231-1/+0
| | | | | a 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 onbz2009-06-081-2/+0
| | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c.
* Make Netgraph compile with Clang.ed2009-03-031-1/+0
| | | | | | | | | | | | | | | | Clang disallows structs with variable length arrays to be nested inside other structs, because this is in violation with ISO C99. Even though we can keep bugging the LLVM folks about this issue, we'd better just fix our code to not do this. This code seems to be the only code in the entire source tree that does this. I haven't tested this patch by using the kernel modules in question, but Diane Bruce and I have compared disassembled versions of these kernel modules. We would have expected them to be exactly the same, but due to randomness 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.ed2009-02-281-2/+0
| | | | | | | | | | | | When copying big structures, LLVM generates calls to memmove(), because it may not be able to figure out whether structures overlap. This caused linker errors to occur. memmove() is now implemented using bcopy(). Ideally it would be the other way around, but that can be solved in the future. On ARM we don't do add anything, because it already has memmove(). Discussed on: arch@ Reviewed by: rdivacky
* For all files including net/vnet.h directly include opt_route.h andbz2009-02-271-0/+3
| | | | | | | | | | | | | | net/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 included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily.
* Rather than using hidden includes (with cicular dependencies),bz2008-12-021-0/+1
| | | | | | | | | | | directly include only the header files needed. This reduces the unneeded spamming of various headers into lots of files. For now, this leaves us with very few modules including vnet.h and thus needing to depend on opt_route.h. Reviewed by: brooks, gnn, des, zec, imp Sponsored by: The FreeBSD Foundation
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-2/+2
| | | | MFC after: 3 months
* Step 1.5 of importing the network stack virtualization infrastructurezec2008-10-021-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the vimage project, as per plan established at devsummit 08/08: http://wiki.freebsd.org/Image/Notes200808DevSummit Introduce INIT_VNET_*() initializer macros, VNET_FOREACH() iterator macros, and CURVNET_SET() context setting macros, all currently resolving to NOPs. Prepare for virtualization of selected SYSCTL objects by introducing a family of SYSCTL_V_*() macros, currently resolving to their global counterparts, i.e. SYSCTL_V_INT() == SYSCTL_INT(). Move selected #defines from sys/sys/vimage.h to newly introduced header files specific to virtualized subsystems (sys/net/vnet.h, sys/netinet/vinet.h etc.). All the changes are verified to have zero functional impact at this point in time by doing MD5 comparision between pre- and post-change object files(*). (*) netipsec/keysock.c did not validate depending on compile time options. Implemented by: julian, bz, brooks, zec Reviewed by: julian, bz, brooks, kris, rwatson, ... Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Commit step 1 of the vimage project, (network stack)bz2008-08-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* Remove netatm from HEAD as it is not MPSAFE and relies on the now removedrwatson2008-05-254-1961/+0
| | | | | | | | | | | | | | | | | | | NET_NEEDS_GIANT. netatm has been disconnected from the build for ten months in HEAD/RELENG_7. Specifics: - netatm include files - netatm command line management tools - libatm - ATM parts in rescue and sysinstall - sample configuration files and documents - kernel support as a module or in NOTES - netgraph wrapper nodes for netatm - ctags data for netatm. - netatm-specific device drivers. MFC after: 3 weeks Reviewed by: bz Discussed with: bms, bz, harti
* Don't use data after free.netchild2006-09-301-1/+4
| | | | | | Found by: Coverity Prevent CID: 536 Submitted by: harti (via vs)
* Replace the array initialization using the gcc-specific formatdds2006-06-021-5/+5
| | | | | | [constant] value with the C99 format [constant] = value
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-2/+2
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* Use the ISO standard function variable vs. a GCC'ism.obrien2005-08-104-11/+11
|
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-102-7/+7
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* Fixed an off-by-one error when dealing with interface nameru2005-02-031-9/+6
| | | | | | (if_xname is NUL-terminated). Don't waste time making a copy of if_xname in attach().
* /* -> /*- for license, minor formatting changesimp2005-01-0720-23/+29
|
* Mechanically rename s/ng_timeout/ng_callout/g, s/ng_untimeout/ng_uncallout/g.glebius2004-12-012-4/+4
| | | | | | | This is done to keep both versions in RELENG_5 and support both APIs. Reviewed by: scottl Approved by: julian (mentor), implicitly
* Cancel pending timeout before scheduling a new one. This fixesglebius2004-11-191-0/+1
| | | | | | item leak, I've introduced with previous change. Approved by: julian (mentor)
* Adapt to the new ng_timeout/ng_untimeout arguments. These now useharti2004-11-042-17/+11
| | | | | | the callout instead of the timeout interface. Submitted by: glebius
* Apply error and success logic consistently to the function netisr_queue() andandre2004-08-271-1/+1
| | | | | | | | | | | | | | | | | | its users. netisr_queue() now returns (0) on success and ERRNO on failure. At the moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full) are supported. Previously it would return (1) on success but the return value of IF_HANDOFF() was interpreted wrongly and (0) was actually returned on success. Due to this schednetisr() was never called to kick the scheduling of the isr. However this was masked by other normal packets coming through netisr_dispatch() causing the dequeueing of waiting packets. PR: kern/70988 Found by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp> MFC after: 3 days
* This is the netgraph node framework for the user side call controlharti2004-08-123-0/+1422
| | | | node for ATM. This node implements the API to the signalling services.
* Avoid casts as lvalues.kan2004-07-281-3/+4
|
* Slight cosmetic changes.julian2004-07-201-3/+3
| | | | | | | | | Also introduce a macro to be called by persistent nodes to signal their persistence during shutdown to hide this mechanism from the node author. Make node flags have a consistent style in naming. Document the change.
* Convert Netgraph to use mbuf tags to pass its meta information around.julian2004-06-251-0/+1
| | | | | | | | Thanks to Sam for importing tags in a way that allowed this to be done. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Also allow the sr and ar drivers to create netgraph versions of their modules. Document the change to the ksocket node.
* Switch to using C99 sparse initialisers for the type methods array.julian2004-05-295-60/+51
| | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week
* Get rid of the old *LEN constants in favour of the new *SIZ constantsharti2004-01-262-6/+6
| | | | that also include the trailing \0 byte.
* NULL -> 0 where appropriate.alfred2003-12-242-5/+5
|
* Pass MTX_DEF instead of 0 as the last argument to mtx_init().truckman2003-12-151-1/+2
| | | | Submitted by: Gavin Atkinson <gavin+freebsdc@ury.york.ac.uk>
* The last argument to mtx_init() should be MTX_DEF, not 0. This is not atruckman2003-12-081-1/+2
| | | | functional change since MTX_DEF happens to be defined as 0.
* Make the defines that prevent multiple includes look like theharti2003-11-133-6/+6
| | | | others in netgraph.
* The layer 3 (signalling) of NgATM netgraph node: ng_uni. This nodeharti2003-11-073-0/+1203
| | | | handles user and network side signaling and partly PNNI.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-5/+3
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Netgraph part of the NgATM signalling AA layer. These nodes canharti2003-10-248-0/+2715
| | | | | also be used as a general-purpose transport protocol above any packet layer (IP, UDP).
* Add ng_atmpif: a HARP physical interface emulation. This allows oneharti2003-08-114-0/+1963
| | | | | | to run the HARP ATM stack without real hardware. Submitted by: Vincent Jardin <vjardin@wanadoo.fr>
* Process events from the ATM drivers. Carrier change and PVC changeharti2003-07-292-49/+126
| | | | | | | | | messages are forwarded as netgraph control messages to the node that is connected to the manage hook. If that hook is not connected, the event is lost. Flow control events are converted to netgraph flow control messages and send along the hook that is connected to the flow controlled VC. ACR change events are converted to control messages and sent along the hook for the given VC.
* Test the OPEN flag to see whether a VCI is already open on the hook insteadharti2003-07-151-2/+2
| | | | to look for vci != 0. We can now open VCI 0 for monitoring purposes.
* Remove three unneccessary comparisons that were always true.harti2003-07-151-6/+0
| | | | Spotted by: gcc
* Allow VPI/VCI 0/0 to be opened. This will be used by the IDT77252 driverharti2003-07-021-9/+22
| | | | | | to provide a "receive all cells" mode that can be used for monitoring. Check only the relevant MTU size when NOTX or NORX flags are set.
OpenPOWER on IntegriCloud