summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Fix a LOR by dropping the global ifnet locks while allocating a new ifnetjhb2011-01-241-6/+20
| | | | | | | | table in if_grow(). The order of the SYSINIT's for ifnet state were swapped so that the various locks were initialized before being used. Reviewed by: pluknet, bz MFC after: 2 weeks
* sysctl(8) should use the CTLTYPE to determine the type of data whenmdf2011-01-192-4/+5
| | | | | | | | | | | reading. (This was already done for writing to a sysctl). This requires all SYSCTL setups to specify a type. Most of them are now checked at compile-time. Remove SYSCTL_*X* sysctl additions as the print being in hex should be controlled by the -x flag to sysctl(8). Succested by: bde
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-123-7/+7
| | | | Commit the net* piece.
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-111-1/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* MfP4 CH=185246 [1]:bz2011-01-091-0/+2
| | | | | | | Add FEATURE() to announce optional VIMAGE. MFC after: 3 days [1] for the moment put it in vnet.c.
* - Restore dropping the priority of syncer down to PPAUSE when it is idle.jhb2011-01-061-0/+5
| | | | | | | | | This was lost when it was converted to using a condition variable instead of lbolt. - Drop the priority of flowtable down to PPAUSE when it is idle as well since it is a similar background task. MFC after: 2 weeks
* Teach ifconfig(8) the handy shared option shortcut aliases the NetBSDmarius2011-01-051-0/+9
| | | | | | | | counterpart also takes, i.e. "fdx" for "full-duplex", "flow" for "flowcontrol", "hdx" for "half-duplex" as well as "loop" and "loopback" for "hw-loopback". MFC after: 1 week
* Fix whitespace.marius2011-01-051-37/+35
| | | | MFC after: 1 week
* Use NULL rather than 0 to invalidate a pointer.bz2010-12-311-9/+2
| | | | | | | | | | | Rather than duplicating the LLE_FREE_LOCKED() macro code in LLE_FREE(), call it directly (like we do for the RT_* macros). Sponsored by: ISPsystem [1] Reviewed by: julian [1] MFC After: 1 week [1] Early 2010.
* Print the vnet pointer under DDB when iterating over flowtables of eachbz2010-12-311-0/+3
| | | | | | | | | | virtual network stack instance. Sponsored by: ISPsystem [1] Reviewed by: julian [1] MFC after: 1 week [1] Early 2010.
* Move the increment operation under the lock and split the conditionbz2010-12-311-8/+10
| | | | | | | | | | | | | | | variable into two so that we can see on which one we are waiting. This might also more properly propagate the update of the flowclean_cycles flag and avoid "hangs" people were seeing. Suggested by: rwatson [1] Sponsored by: ISPsystem [1] Reviewed by: julian [1] Updated by: Mikolaj Golub (to.my.trociny gmail.com) Tested by: Mikolaj Golub (to.my.trociny gmail.com) MFC After: 1 week [1] Early 2010, initial version.
* Introduce and use a new VM interface for temporarily pinning pages. Thisalc2010-12-251-6/+2
| | | | | | | new interface replaces the combined use of vm_fault_quick() and pmap_extract_and_hold() throughout the kernel. In collaboration with: kib@
* Adds IFF_CANTCONFIG to IFF_CANTCHANGE that it shouldn't happen throughweongyo2010-12-071-1/+1
| | | | ioctl(2).
* Introduces IFF_CANTCONFIG interface flag to point that the interfaceweongyo2010-12-071-1/+1
| | | | | | | | | isn't configurable in a meaningful way. This is for ifconfig(8) or other tools not to change code whenever IFT_USB-like interfaces are registered at the interface list. Reviewed by: brooks No objections: gavin, jkim
* o Swap descriptions for net.bpf.bufsize and net.bpf.maxbufsize.maxim2010-11-241-2/+2
| | | | | PR: misc/152531 MFC after: 1 week
* Allow for vlan(4) ifnets to have overlapping unit numbers if they arezec2010-11-221-0/+42
| | | | | | | | | | | | | | | | created in separated vnets. As a side-effect of having a separated if_cloner instance for each vnet, all vlan ifnets created in a vnet will be automatically destroyed when vnet teardown is initiated. Disallow SIOCSETVLAN and SIOCGETVLAN ioctls on vlan ifnets which are associated with physical ifnets residing in parent vnets. This is an interim vlan-specific solution which will be superseded by a more generic if_cloner V_irtualization change from p4. For nooptions VIMAGE builds, this should be a no-op change. Discussed with: bz MFC after: 3 days
* After some off-list discussion, revert a number of changes to thedim2010-11-2210-36/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | DPCPU_DEFINE and VNET_DEFINE macros, as these cause problems for various people working on the affected files. A better long-term solution is still being considered. This reversal may give some modules empty set_pcpu or set_vnet sections, but these are harmless. Changes reverted: ------------------------------------------------------------------------ r215318 | dim | 2010-11-14 21:40:55 +0100 (Sun, 14 Nov 2010) | 4 lines Instead of unconditionally emitting .globl's for the __start_set_xxx and __stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu sections are actually defined. ------------------------------------------------------------------------ r215317 | dim | 2010-11-14 21:38:11 +0100 (Sun, 14 Nov 2010) | 3 lines Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughout the tree. ------------------------------------------------------------------------ r215316 | dim | 2010-11-14 21:23:02 +0100 (Sun, 14 Nov 2010) | 2 lines Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.
* Add a missing ';' and change the debugging sysctl from xint to int.bz2010-11-211-2/+2
| | | | | Submitted by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 3 days
* Instead of unconditionally emitting .globl's for the __start_set_xxx anddim2010-11-141-3/+4
| | | | | __stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu sections are actually defined.
* Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughoutdim2010-11-149-23/+23
| | | | the tree.
* Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.dim2010-11-141-6/+9
|
* o Flesh out the generic IEEE 802.3 annex 31B full duplex flow controlmarius2010-11-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support in mii(4): - Merge generic flow control advertisement (which can be enabled by passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD, IFM_FLOW isn't implemented as a global option via the "don't care mask" but instead as a media specific option this. This has the following advantages: o allows flow control advertisement with autonegotiation to be turned on and off via ifconfig(8) with the default typically being off (though MIIF_FORCEPAUSE has been added causing flow control to be always advertised, allowing to easily MFC this changes for drivers that previously used home-grown support for flow control that behaved that way without breaking POLA) o allows to deal with PHY drivers where flow control advertisement with manual selection doesn't work or at least isn't implemented, like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4), by setting MIIF_NOMANPAUSE o the available combinations of media options are readily available from the `ifconfig -m` output - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so these are understood by ifconfig(8). o Make the master/slave support in mii(4) actually usable: - Change IFM_ETH_MASTER from being implemented as a global option via the "don't care mask" to a media specific one as it actually is only applicable to IFM_1000_T to date. - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to actually configure manually selected slave mode (like we also do in the PHY specific implementations). - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it is understood by ifconfig(8). o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4), e1000phy(4) and ip1000phy(4) to use the generic flow control support instead of home-grown solutions via IFM_FLAGs. This includes changing these PHY drivers and smcphy(4) to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set) and implemented for these media variants, i.e. typically only for copper. o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0 and some IFM_FLAGn. o Switch brgphy(4) to add at least the the supported copper media based on the contents of the BMSR via mii_phy_add_media() instead of hardcoding them. The latter approach seems to have developed historically, besides causing unnecessary code duplication it was also undesirable because brgphy_mii_phy_auto() already based the capability advertisement on the contents of the BMSR though. o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not just BCM5701. Apparently this was a misinterpretation of a workaround in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but this doesn't mean we can't set these as well on other PHYs for manual media selection. o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so IFM_1000_T master mode support now is generally available with all PHY drivers. o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's not applicable there. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) MFC after: 2 weeks
* Use 'z' modifier for size_t printing.kib2010-11-131-1/+1
|
* Similar to r212647, remove the workaround in sys/net/vnet.h for an lddim2010-11-121-9/+0
| | | | | | | | | bug (incorrect placement of __start_SECNAME in some cases) that was fixed in r210245. There is already an UPDATING entry about needing a recent ld. MFC after: 1 month
* Add a queue to hold packets while we await an ARP reply.gnn2010-11-122-4/+22
| | | | | | | | | | | | | | | | | | | | | | When a fast machine first brings up some non TCP networking program it is quite possible that we will drop packets due to the fact that only one packet can be held per ARP entry. This leads to packets being missed when a program starts or restarts if the ARP data is not currently in the ARP cache. This code adds a new sysctl, net.link.ether.inet.maxhold, which defines a system wide maximum number of packets to be held in each ARP entry. Up to maxhold packets are queued until an ARP reply is received or the ARP times out. The default setting is the old value of 1 which has been part of the BSD networking code since time immemorial. Expose the time we hold an incomplete ARP entry by adding the sysctl net.link.ether.inet.wait, which defaults to 20 seconds, the value used when the new ARP code was added.. Reviewed by: bz, rpaulo MFC after: 3 weeks
* Use the same treatment as in linker_set.h for the __start and __stopdim2010-11-111-0/+2
| | | | | | | | | | | symbols of the set_vnet and set_pcpu sections, so those symbols will always be emitted in kernel modules, if they use vnet.h or pcpu.h. Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and associated macros invisible to userland, to prevent it picking up these symbols. Reviewed by: kib
* Sync DLTs with the latest pcap version.rpaulo2010-10-291-0/+137
|
* Factor out DDB commands from r204145, r204279 into if_debug.c for furtherbz2010-10-252-82/+126
| | | | | | | | | | | enhancements (1). Switch to a standard 2-clause BSD license for this (2). Unfortunately we have to un-static the ifindex_table for this but do not publicly export it. Suggested by: rwatson (1) a while back. Approved by: thompsa (2) for the change from r204279. MFC after: 6 days
* Reshuffle SIOCGIFCONF32 handler from r155224.pluknet2010-10-212-27/+29
| | | | | | | | | | | | | - move all the chunks into one file, which allows to hide SIOCGIFCONF32 global definition as well. - replace __amd64__ with proper COMPAT_FREEBSD32 around. - handle 32bit capacity before going into the handler itself instead of doing internal 32bit specific changes within it (e.g. as it's done for SIOCGDEFIFACE32_IN6). - use explicitely sized types for ABI compat. Approved by: kib (mentor) MFC after: 2 weeks
* Close a race acquiring the IF_ADDR_LOCK() for each entry while iteratingbz2010-10-161-0/+4
| | | | | | | | | over all interfaces to make sure the address will neither change nor be freed while we are working on it. PR: kern/146250 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 1 week
* lltable_drain() has never been used so far, thus #if 0 it for now.bz2010-10-162-0/+6
| | | | | | | While touching it add the missing locking to the now disabled code for the time when we'll resurrect it. MFC after: 3 days
* Only hide the ifa and not the tp under #ifdef INET as the tp is neededbz2010-10-011-1/+1
| | | | | | for locking evenwhen there is no INET. MFC after: 3 days
* - Expand scope of tun/tap softc locks to cover more softc fields andjhb2010-09-222-145/+97
| | | | | | | | | | | | | | | | | driver-maintained ifnet fields (such as if_drv_flags). - Use soft locks as the mutex that protects each interface's knote list rather than using the global knote list lock. Also, use the softc for kn_hook instead of the cdev. - Use mtx_sleep() instead of tsleep() when blocking in the read routines. This fixes a lost wakeup race. - Remove D_NEEDGIANT now that the cdevsw routines use the softc lock where locking is needed. - Lock IFQ when calculating the result for FIONREAD in tap(4). tun(4) already did this. - Remove remaining spl calls. Submitted by: Marcin Cieslak saper of saper|info (3) MFC after: 2 weeks
* Fix a typo in a comment.jkim2010-09-161-1/+1
| | | | Submitted by: afiveg
* Replace sbuf_overflowed() with sbuf_error(), which returns any errormdf2010-09-101-2/+2
| | | | | | code associated with overflow or with the drain function. While this function is not expected to be used often, it produces more information in the form of an errno that sbuf_overflowed() did.
* MFp4 CH=183259:bz2010-09-021-2/+2
| | | | | | | No reason to use if_free_type() as we don't change our type. Just if_free() is fine. MFC after: 3 days
* Add a sysctl knob to accept input packets on any link in a failover lagg.emaste2010-09-011-1/+9
|
* MFp4 CH=182972:bz2010-08-271-0/+4
| | | | | | | Add explicit linkstate UP/DOWN for the epair. This is needed by carp(4) and other things to work. MFC after: 5 days
* Add an extra comment to the SDT probes definition. This allows us to getrpaulo2010-08-221-5/+9
| | | | | | | | | use '-' in probe names, matching the probe names in Solaris.[1] Add userland SDT probes definitions to sys/sdt.h. Sponsored by: The FreeBSD Foundation Discussed with: rwaston [1]
* When moving an ethernet ifnet from one vnet to another, destroy thezec2010-08-132-0/+34
| | | | | | | | associated ng_ether netgraph node in the current vnet, and create a new one in the target vnet. Reviewed by: julian MFC after: 3 days
* Unbreak LINT by moving all carp hooks to net/if.c / netinet/ip_carp.h, withwill2010-08-113-11/+18
| | | | | | | the appropriate ifdefs. Reviewed by: bz Approved by: ken (mentor)
* Allow carp(4) to be loaded as a kernel module. Follow precedent set bywill2010-08-113-40/+19
| | | | | | | | | | | | | | | bridge(4), lagg(4) etc. and make use of function pointers and pf_proto_register() to hook carp into the network stack. Currently, because of the uncertainty about whether the unload path is free of race condition panics, unloads are disallowed by default. Compiling with CARPMOD_CAN_UNLOAD in CFLAGS removes this anti foot shooting measure. This commit requires IP6PROTOSPACER, introduced in r211115. Reviewed by: bz, simon Approved by: ken (mentor) MFC after: 2 weeks
* Adjust the interface type in the link layer socket address for vlan(4)jhb2010-08-061-0/+5
| | | | | | | | | | | interfaces to be a vlan (IFT_L2VLAN) rather than an Ethernet interface (IFT_ETHER). The code already fixed if_type in the ifnet causing some places to report the interface as a vlan (e.g. arp -a output) and other places to report the interface as Ethernet (getifaddrs(3)). Now they should all report IFT_L2VLAN. Reviewed by: brooks MFC after: 1 month
* Properly set ifi_datalen for compat32 struct if_data32.kib2010-08-031-1/+1
| | | | | | PR: kern/149240 Submitted by: Stef Walter <stef memberwebs com> MFC after: 1 weeks
* Don't check malloc(M_WAITOK) result.glebius2010-07-271-2/+0
|
* Return NULL rather than 0 for a pointer.bz2010-07-271-1/+1
| | | | MFC after: 3 days
* When installing a new ARP entry via 'arp -S', lla_lookup() willglebius2010-07-271-0/+1
| | | | | | | | | | | | | | | either find an existing entry, or allocate a new one. In the latter case an entry would have flags, that were supplied as argument to lla_lookup(). In case of an existing entry, flags aren't modified. This lead to losing LLE_PUB and/or LLE_PROXY flags. We should apply these flags either in lla_rt_output() or in the in.c:in_lltable_lookup(). It seems to me that lla_rt_output() is a more correct choice. PR: kern/148784, kern/146539 Silence from: qingli, 5 days
* Fix an obvious typo from r1.1. We were acquiring an exclusive writer lockjkim2010-07-221-1/+1
| | | | | | regardless of the given flags. MFC after: 3 days
* whitespace cleanupluigi2010-07-151-2/+2
|
* small portability fix to build on linux/windowsluigi2010-07-151-0/+4
|
OpenPOWER on IntegriCloud