summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_eiface.c
Commit message (Collapse)AuthorAgeFilesLines
* Conditionally compile out V_ globals while instantiating the appropriatezec2008-12-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | container structures, depending on VIMAGE_GLOBALS compile time option. Make VIMAGE_GLOBALS a new compile-time option, which by default will not be defined, resulting in instatiations of global variables selected for V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be effectively compiled out. Instantiate new global container structures to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0, vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0. Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_ macros resolve either to the original globals, or to fields inside container structures, i.e. effectively #ifdef VIMAGE_GLOBALS #define V_rt_tables rt_tables #else #define V_rt_tables vnet_net_0._rt_tables #endif Update SYSCTL_V_*() macros to operate either on globals or on fields inside container structs. Extend the internal kldsym() lookups with the ability to resolve selected fields inside the virtualization container structs. This applies only to the fields which are explicitly registered for kldsym() visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently this is done only in sys/net/if.c. Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code, and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in turn result in proper code being generated depending on VIMAGE_GLOBALS. De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c which were prematurely V_irtualized by automated V_ prepending scripts during earlier merging steps. PF virtualization will be done separately, most probably after next PF import. Convert a few variable initializations at instantiation to initialization in init functions, most notably in ipfw. Also convert TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in initializer functions. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* 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
* Unhide declarations of network stack virtualization structs fromzec2008-11-281-3/+0
| | | | | | | | | | | | | | | | | | underneath #ifdef VIMAGE blocks. This change introduces some churn in #include ordering and nesting throughout the network stack and drivers but is not expected to cause any additional issues. In the next step this will allow us to instantiate the virtualization container structures and switch from using global variables to their "containerized" counterparts. Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, 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-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Honor the IFF_MONITOR flag.glebius2007-07-261-0/+6
| | | | | | PR: kern/99500 Submitted by: Craig Leres <leres ee.lbl.gov> Approved by: re (kensmith)
* ng_send_fn() can return with an error, the function of interestru2007-03-081-1/+2
| | | | | | | will never be called and OACTIVE will never be reset. Fix this. Submitted by: Vsevolod Lobko MFC after: 3 days
* SIOCSIFFLAGS doesn't require an argument in kernel land; instead, flagsru2006-09-151-1/+1
| | | | | | | | | are supposed to be set directly in ifnet already. This change fixes a panic when ng_eiface node is attached to ng_fec node and the latter is shut down (ng_fec sets flags and then calls SIOCSIFFLAGS with a NULL argument). MFC after: 3 days
* Don't count output bytes twice (the byte accouting is doneru2006-02-111-7/+4
| | | | | | in if.c). Count output errors. MFC after: 3 days
* Two fixes:ru2006-02-061-33/+33
| | | | | | | | | - Run send queue down to completion, not just one packet. It has been observed to cause a stall queue otherwise. - Prevent queueing multiple function calls to a node. MFC after: 3 days
* Simplify setting the link-level address.ru2005-11-081-19/+3
|
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-14/+17
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-11/+17
| | | | | | | | | | | | | | | | | | | | 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
* - Initialize interface as UP when hook is connected.glebius2005-04-201-2/+5
| | | | | | | - Call if_link_state_change() when netgraph flow control messages are received. Sponsored by: Rambler
* Remove extra ifnet pointer from private data. It can be accessed via arpcom.glebius2005-04-201-6/+5
|
* Remove ng_connect_t where it is unused. Probably it remained from ng_source.c.glebius2005-03-141-14/+0
|
* Use subr_unit allocator instead of own functions.glebius2005-03-141-94/+5
|
* Pull up to ETHER_HDR_LEN before passing an mbuf to ether_input().ru2005-03-011-0/+6
| | | | | The bug was found by running ng_dummy(4) node configured with a delay, in front of the ng_eiface(4) node.
* bzero() -> M_ZERO.ru2005-02-081-2/+1
|
* Create a per-module mutex on MOD_LOAD, and destroy it on MOD_UNLOAD.ru2005-02-051-1/+24
| | | | | | (This fixes witness_destroy() panic after module unload.) OK'ed by: rwatson, julian
* Fixed an off-by-one error when dealing with interface nameru2005-02-031-2/+2
| | | | (if_xname is IFNAMSIZ-sized and NUL-terminated).
* Added ASCII version of the NGM_EIFACE_GET_IFNAME message, "getifname".ru2005-02-031-8/+9
|
* Removed unused includes.ru2005-02-031-3/+0
|
* Fix the comment.ru2005-02-021-2/+2
|
* Whitespace and "const" changes to reduce diffs to RELENG_4.ru2005-02-021-87/+89
| | | | (Gives the same object when compiled without NETGRAPH_DEBUG.)
* Raise & drop IFF_RUNNING upon receival of netgraph flow controlglebius2005-01-141-0/+12
| | | | messages.
* Remove orphaned comment about Meta data.glebius2004-09-111-1/+0
|
* Introduce a new mutex, ng_eiface_mtx, to protect the global unit listrwatson2004-07-141-1/+11
| | | | | | | lock used to synchronize allocation of unit numbers for new netgraph ethernet interfaces. Reviewed by: glebius
* Consistently use __inline instead of __inline__ as the former is an empty macrostefanf2004-07-041-2/+2
| | | | in <sys/cdefs.h> for compilers without support for inline.
* Make the frameworkl responsible for not passing the nodes a NULL mbuf pointer.julian2004-06-251-5/+0
| | | | | | this allows the nodes to not test for this.. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
* Switch to using C99 sparse initialisers for the type methods array.julian2004-05-291-12/+10
| | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week
* + rename and document an unused field in struct arpcom (field is stillluigi2004-04-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | there so there are no ABI changes); + replace 5 redefinitions of the IPF2AC macro with one in if_arp.h Eventually (but before freezing the ABI) we need to get rid of struct arpcom (initially with the help of some smart #defines to avoid having to touch each and every driver, see below). Apart from the struct ifnet, struct arpcom now only stores a copy of the MAC address (ac_enaddr, but we already have another copy in the struct ifnet -- if_addrhead), and a netgraph-specific field which is _always_ accessed through the ifp, so it might well go into the struct ifnet too (where, besides, there is already an entry for AF_NETGRAPH data...) Too bad ac_enaddr is widely referenced by all drivers. But this can be fixed as follows: #define ac_enaddr ac_if.the_original_ac_enaddr_in_struct_ifnet (note that the right hand side would likely be a pointer rather than the base address of an array.)
* Use the (now standard) Ethernet address parse type.ru2003-12-171-19/+5
|
* MFS: Make struct arpcom the first entry in softc. (There are at leastru2003-12-151-1/+1
| | | | | two functions in sys/net/if.c that assume that softc starts with arpcom.) This makes setting of ethernet address via ifconfig(8) work as expected.
* Check the correct set of interface flags and fix a memory leak.ru2003-11-171-1/+2
| | | | Reviewed by: harti
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-11/+8
| | | | | | | | | | | | | 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)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* o track changes to ethernet input packet handlingsam2002-11-141-25/+5
| | | | | | | | o track changes to bpf o track changes to make ng hooks more private Reviewed by: many Approved by: re
* Fix GCC warnings caused by initializing a zero length array. In the process,archie2002-05-311-0/+2
| | | | | | | simply things a bit by getting rid of 'struct ng_parse_struct_info' which was useless because it only contained one field. MFC after: 2 weeks
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-3/+3
| | | | also don't use ANSI string concatenation.
* Allow a changed MAC address to show up in ifconfig by changing itjulian2001-02-261-0/+13
| | | | in the ifaddr list as well. Also change an error return in the base system.
* slight cleanups during testing.julian2001-02-251-4/+46
|
* Add a node that looks to all the word like an ethernet but delivers itsjulian2001-02-251-0/+633
ehternet frames to a netgraph hook. Submitted by: "Vitaly V. Belekhov" <vitaly@riss-telecom.ru> translated to 5.0 by me. man page not yet written. This node still needs a little work.. don't use yet. Not yet linked into the build.
OpenPOWER on IntegriCloud