summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_fec.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix a number of style issues in the MALLOC / FREE commit. I've tried todes2008-10-231-1/+1
| | | | | be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect.
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).des2008-10-231-10/+9
| | | | MFC after: 3 months
* Help ng_fec deal with multicast addresses.dwmalone2007-05-181-2/+77
| | | | | | | | | | | | | | | | | | | While ng_fec called the ioctl to let interfaces in the bundle know the list of multicast addresses had changed, it never actually updated that list on the interfaces in the bundle. Consequently, the multicast filters could be programmed incorrectly. if_lagg does this correctly, by maintaining a list of addresses that it has added to interfaces in the bundle. This commit basically takes the if_lagg code and adds it to ng_fec. A version of this patch for RELENG_6 has fixed some problems with IPv6 ND over ng_fec. This is probably the problem in PR 107523. PR: 107523 Tested by: Rob Gallagher <robert.gallagher@heanet.ie> Obtained from: if_lagg MFC after: 3 weeks
* Fix input byte counting. Now the sum of the ipackets/ibytes countersru2006-09-151-2/+8
| | | | | | | | | of individual interfaces should match the ipackets/ibytes counter of the aggregate (FEC) interface. PR: kern/82189 Submitted by: Stikheev Andrew <sand AT zunet DOT ru> MFC after: 3 days
* Make it possible to set a larger MTU by attempting to set MTUs on allru2006-09-151-1/+19
| | | | | | | | | | | | | | | trunk ports first. If that succeeds, and we're inside our own bounds, so be it. Still not ideal -- adding a port after changing an MTU doesn't change port's MTU, but a step in the right direction. PR: kern/95417 Submitted by: Vladimir Ivanov <wawa AT yandex-team DOT ru> MFC after: 3 days I've slightly edited a patch to make the conditional logic positive and remove (what I think was) a redundant ng_fec_init() call.
* Fix another fallout from the IF_LLADDR() type change.ru2006-08-241-1/+2
| | | | Spotted by: mwlucas
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-5/+5
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* Make IFP2NG() usable as an lvalue.ru2005-11-091-5/+3
|
* Use if_setlladdr() to reprogram the link-level addresses; it causesru2005-11-041-21/+4
| | | | | | a synchronous reprogramming of hardware MAC filters if the physical interface are up and running. Previously, MAC filters would be reconfigured only when the fec interface was brought up.
* Bring some level of stability to this driver:ru2005-11-041-3/+19
| | | | | | | | | | | | | | | | | | | - Disallow bundle reconfiguration when virtual interface is running; otherwise, removing a port from a running configuration will cause a panic in the start() method on the next packet on an assumption that a bundle has an even number of ports (2 or 4). - Disallow bringing of virtual interface to a running state when a bundle size is 0; otherwise, adding and then removing the port will similarly cause a panic. - Add missing initialization of fec_ifstat when adding a new port and fix media status reporting when virtual interface isn't yet up (check for fec_status of 1 rather than != 0).
* - Fix another fallout from the if_alloc() conversion:ru2005-11-041-6/+6
| | | | | | | | | | | | | | | | | | previously, ifp->if_type was set to IFT_ETHER by ether_ifattach(), now it's done by if_alloc() so an assignment of if_type to IFT_PROPVIRTUAL after if_alloc() but before ether_ifattach() broke it. This makes arp(8) and friends happy about the fec interfaces, and will allow us to use if_setlladdr() on the fec interface. - Set/reset IFF_DRV_RUNNING/IFF_DRV_OACTIVE in init() and stop() methods rather than in ioctl(), like the rest of the drivers do. This fixes a bug when an "ifconfig fec0 ipv4_address" would not have made the interface running, didn't launch the ticker function to track media status of bundled ports, etc.
* Make sure ng_fec_init() uses the same calling convention as the rest ofemax2005-08-251-3/+3
| | | | | | | | | the code, i.e. ng_fec_init() is called with the ifp->if_softc pointer and NOT with the ifp pointer. PR: kern/85239 Reviewed by: brooks MFC after: 1 day
* Use the ISO standard function variable vs. a GCC'ism.obrien2005-08-101-3/+3
|
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-7/+9
| | | | | | | | | | | | | | 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-22/+22
| | | | | | | | | | | | | | | | | | | | 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
* 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
* /* -> /*- for license, minor formatting changesimp2005-01-071-2/+4
|
* Avoid casts as lvalues.kan2004-07-281-0/+1
|
* Introduce a new mutex, ng_fec_mtx, to protect the global unit list torwatson2004-07-141-1/+10
| | | | | | synchronization allocation of FEC unit numbers. 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.
* Remove one more unneeded reference to arpcom.ac_netgraph.wpaul2004-06-201-10/+34
| | | | | | | | | | | | | | | | Tweak things so that ng_fec has a chance of working with things other than ethernet. Use ifp->if_output of the underlying interfaces and use IF_HANDOFF() rather than depending on ether_output() and ether_output_frame() explicitly. Also, don't insist that underlying devices be IFM_ETHER when checking their link states in the link monitor code. With these changes, I was able to create a two channel bundle consisting of one ethernet interface and one 802.11 wireless device (via ndis). Note that this only works because both devices use the same if_output vector: ng_fec will not let you bundle devices with different output vectors together (it really doesn't make sense to do that).
* Stash our node context pointer somewhere else within struct ifnet ofwpaul2004-06-201-2/+18
| | | | | | underlying interfaces rather than using ac_netgraph in struct arpcom. The latter is meant only for use by ng_ether, and using it breaks interoperability with the rest of netgraph.
* Switch to using C99 sparse initialisers for the type methods array.julian2004-05-291-12/+6
| | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week
* Consistently use ifaddr_byindex() to access the link-level addressluigi2004-04-161-4/+4
| | | | | | | of an interface. No functional change. On passing, comment an useless invocation of TAILQ_INIT(&ifp->if_addrhead) which could probably be removed in the interest of clarity.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-19/+13
| | | | | | | | | | | | | 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)
* Remove extraneous reference to intrq.h, which broke the kernel build.rwatson2003-04-211-1/+0
|
* Some more updates for the new world order:wpaul2003-02-261-24/+37
| | | | | | | | | | | | | | | | | | | | - Make transmission of packets work again. This stopped working because ether_ifattach() was forcing ifp->if_output to be ether_output() and clobbering our attempt to override this vector with a pointer to ng_fec_output(). Move the overriding of ifp->if_output to after ether_ifattach(). - Abandon the use of the netgraph ng_ether_input_p hook for snagging incoming frames, and instead override the ifp->if_input vector for interfaces that have been aggregated into our bundle. (I would have loved to have written things this way in the first place, but I didn't want to have to be the one to implement the if_input hook and change all the drivers.) This avoids collisions with the ng_ether module, which uses the same hook. Each aggregated device now calls ng_fec_input() directly, which then fakes up the rcvif pointer before invoking ifp->if_input itself. This module should actually work now.
* Attempt to make the ng_fec module play nice with BPF again. Things havewpaul2003-02-261-16/+6
| | | | | | | | | | | | | | | changed since this code was written: - The ng_ether_input_p hook only accepts two arguments now: the pointer to the ether header structure is gone. - It's no longer necessary to cons up a fake ether header before passing incoming packets to BPF_MTAP(). ng_fec_input() has been modified to account for these two changes. Running tcpdump on fec0 should work now. PR: kern/46720
* Make ng_fec.c compile again since Sam's changes.julian2002-12-231-5/+8
| | | | Submitted by: Hiten Pandya (hiten@unixdaemons.com)
* ifnet_addrs doesn;t exist any more so usejulian2002-11-011-3/+3
| | | | | | | TAILQ_FIRST(&ifp->if_addrhead) to find the link layer ifaddr. (it's always first I believe) Allows this to compile on -current. .. need testers with FEC capable switches..
* Finally get around to committing Bill Paul's FEC netgraph nodes.julian2002-10-291-0/+1200
These are really only partly netgraph nodes as they do not use the netgraph interfaces for many of the functions for which they could be used, however they represent important functionality. Submitted by: wpaul MFC after: 2 days
OpenPOWER on IntegriCloud