summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* At long last, commit the zero copy sockets code.ken2002-06-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAKEDEV: Add MAKEDEV glue for the ti(4) device nodes. ti.4: Update the ti(4) man page to include information on the TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options, and also include information about the new character device interface and the associated ioctls. man9/Makefile: Add jumbo.9 and zero_copy.9 man pages and associated links. jumbo.9: New man page describing the jumbo buffer allocator interface and operation. zero_copy.9: New man page describing the general characteristics of the zero copy send and receive code, and what an application author should do to take advantage of the zero copy functionality. NOTES: Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS, TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT. conf/files: Add uipc_jumbo.c and uipc_cow.c. conf/options: Add the 5 options mentioned above. kern_subr.c: Receive side zero copy implementation. This takes "disposable" pages attached to an mbuf, gives them to a user process, and then recycles the user's page. This is only active when ZERO_COPY_SOCKETS is turned on and the kern.ipc.zero_copy.receive sysctl variable is set to 1. uipc_cow.c: Send side zero copy functions. Takes a page written by the user and maps it copy on write and assigns it kernel virtual address space. Removes copy on write mapping once the buffer has been freed by the network stack. uipc_jumbo.c: Jumbo disposable page allocator code. This allocates (optionally) disposable pages for network drivers that want to give the user the option of doing zero copy receive. uipc_socket.c: Add kern.ipc.zero_copy.{send,receive} sysctls that are enabled if ZERO_COPY_SOCKETS is turned on. Add zero copy send support to sosend() -- pages get mapped into the kernel instead of getting copied if they meet size and alignment restrictions. uipc_syscalls.c:Un-staticize some of the sf* functions so that they can be used elsewhere. (uipc_cow.c) if_media.c: In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid calling malloc() with M_WAITOK. Return an error if the M_NOWAIT malloc fails. The ti(4) driver and the wi(4) driver, at least, call this with a mutex held. This causes witness warnings for 'ifconfig -a' with a wi(4) or ti(4) board in the system. (I've only verified for ti(4)). ip_output.c: Fragment large datagrams so that each segment contains a multiple of PAGE_SIZE amount of data plus headers. This allows the receiver to potentially do page flipping on receives. if_ti.c: Add zero copy receive support to the ti(4) driver. If TI_PRIVATE_JUMBOS is not defined, it now uses the jumbo(9) buffer allocator for jumbo receive buffers. Add a new character device interface for the ti(4) driver for the new debugging interface. This allows (a patched version of) gdb to talk to the Tigon board and debug the firmware. There are also a few additional debugging ioctls available through this interface. Add header splitting support to the ti(4) driver. Tweak some of the default interrupt coalescing parameters to more useful defaults. Add hooks for supporting transmit flow control, but leave it turned off with a comment describing why it is turned off. if_tireg.h: Change the firmware rev to 12.4.11, since we're really at 12.4.11 plus fixes from 12.4.13. Add defines needed for debugging. Remove the ti_stats structure, it is now defined in sys/tiio.h. ti_fw.h: 12.4.11 firmware. ti_fw2.h: 12.4.11 firmware, plus selected fixes from 12.4.13, and my header splitting patches. Revision 12.4.13 doesn't handle 10/100 negotiation properly. (This firmware is the same as what was in the tree previously, with the addition of header splitting support.) sys/jumbo.h: Jumbo buffer allocator interface. sys/mbuf.h: Add a new external mbuf type, EXT_DISPOSABLE, to indicate that the payload buffer can be thrown away / flipped to a userland process. socketvar.h: Add prototype for socow_setup. tiio.h: ioctl interface to the character portion of the ti(4) driver, plus associated structure/type definitions. uio.h: Change prototype for uiomoveco() so that we'll know whether the source page is disposable. ufs_readwrite.c:Update for new prototype of uiomoveco(). vm_fault.c: In vm_fault(), check to see whether we need to do a page based copy on write fault. vm_object.c: Add a new function, vm_object_allocate_wait(). This does the same thing that vm_object allocate does, except that it gives the caller the opportunity to specify whether it should wait on the uma_zalloc() of the object structre. This allows vm objects to be allocated while holding a mutex. (Without generating WITNESS warnings.) vm_object_allocate() is implemented as a call to vm_object_allocate_wait() with the malloc flag set to M_WAITOK. vm_object.h: Add prototype for vm_object_allocate_wait(). vm_page.c: Add page-based copy on write setup, clear and fault routines. vm_page.h: Add page based COW function prototypes and variable in the vm_page structure. Many thanks to Drew Gallatin, who wrote the zero copy send and receive code, and to all the other folks who have tested and reviewed this code over the years.
* Add kernel print bits #define for the IEEE80211_CAPINFO bits.imp2002-06-241-1/+1
|
* fix indentation, whitespace and a few comments.luigi2002-06-232-34/+31
|
* Remove (almost all) global variables that were used to holdluigi2002-06-222-64/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | packet forwarding state ("annotations") during ip processing. The code is considerably cleaner now. The variables removed by this change are: ip_divert_cookie used by divert sockets ip_fw_fwd_addr used for transparent ip redirection last_pkt used by dynamic pipes in dummynet Removal of the first two has been done by carrying the annotations into volatile structs prepended to the mbuf chains, and adding appropriate code to add/remove annotations in the routines which make use of them, i.e. ip_input(), ip_output(), tcp_input(), bdg_forward(), ether_demux(), ether_output_frame(), div_output(). On passing, remove a bug in divert handling of fragmented packet. Now it is the fragment at offset 0 which sets the divert status of the whole packet, whereas formerly it was the last incoming fragment to decide. Removal of last_pkt required a change in the interface of ip_fw_chk() and dummynet_io(). On passing, use the same mechanism for dummynet annotations and for divert/forward annotations. option IPFIREWALL_FORWARD is effectively useless, the code to implement it is very small and is now in by default to avoid the obfuscation of conditionally compiled code. NOTES: * there is at least one global variable left, sro_fwd, in ip_output(). I am not sure if/how this can be removed. * I have deliberately avoided gratuitous style changes in this commit to avoid cluttering the diffs. Minor stule cleanup will likely be necessary * this commit only focused on the IP layer. I am sure there is a number of global variables used in the TCP and maybe UDP stack. * despite the number of files touched, there are absolutely no API's or data structures changed by this commit (except the interfaces of ip_fw_chk() and dummynet_io(), which are internal anyways), so an MFC is quite safe and unintrusive (and desirable, given the improved readability of the code). MFC after: 10 days
* Update for libpcap 0.7.1fenner2002-06-211-14/+46
| | | | Originally-committed-to-wrong-repository by: fenner
* Remove so*_locked(), which were backed out by mistake.tanimura2002-06-181-1/+1
|
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-313-25/+3
| | | | Requested by: hsu
* Ensure that packet counts are always reset to 0 whensilby2002-05-311-0/+1
| | | | | | | | a route is cloned. Previously, they took on the count of their parent route (which was sometimes nonzero.) Submitted by: Andre Oppermann <oppermann@pipeline.ch> MFC after: 5 days
* Add one copy of crc32() and crc32_tab[] in libkern, and remove it two otherphk2002-05-291-0/+4
| | | | | | | places. Comment out crc32 related definitions in zlib.h, we don't seem to have the corresponding code in our kernel.
* Make discard devices clonable and unloadable. Also, change thebrooks2002-05-251-15/+57
| | | | interface name from ds# to disc#.
* Move all unit number management cloned interfaces into the cloningbrooks2002-05-257-39/+47
| | | | | | | | code. The reverts the API change which made the <if>_clone_destory() functions return an int instead of void bringing us into closer alignment with NetBSD. Reviewed by: net (a long time ago)
* Fix warning; remove unused arg that was passed through uninitialized.peter2002-05-241-2/+2
|
* Include <sys.systm.h> for the declaration of some atomic functions -- don'tbde2002-05-221-0/+1
| | | | depend on namespace pollution in <sys/mutex.h>.
* Avoid exposing struct if_clone and the sys/queue.h macros to userlandiedowse2002-05-201-0/+4
| | | | | | programs by restricting these to the case where _KERNEL is defined. Reviewed by: brooks (ages ago)
* Lock down a socket, milestone 1.tanimura2002-05-203-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* More s/file system/filesystem/gtrhodes2002-05-161-1/+1
|
* Add ipfw hooks to ether_demux() and ether_output_frame().luigi2002-05-131-0/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ipfw processing of frames at layer 2 can be enabled by the sysctl variable net.link.ether.ipfw=1 Consider this feature experimental, because right now, the firewall is invoked in the places indicated below, and controlled by the sysctl variables listed on the right. As a consequence, a packet can be filtered from 1 to 4 times depending on the path it follows, which might make a ruleset a bit hard to follow. I will add an ipfw option to tell if we want a given rule to apply to ether_demux() and ether_output_frame(), but we have run out of flags in the struct ip_fw so i need to think a bit on how to implement this. to upper layers | | +----------->-----------+ ^ V [ip_input] [ip_output] net.inet.ip.fw.enable=1 | | ^ V [ether_demux] [ether_output_frame] net.link.ether.ipfw=1 | | +->- [bdg_forward]-->---+ net.link.ether.bridge_ipfw=1 ^ V | | to devices
* Fix logic inversion bug.kbyanc2002-05-111-2/+2
|
* Fix a misplaced break statement within a switch that accidentally madejoerg2002-05-101-1/+1
| | | | | | | | | | it into an "#ifdef INET6" block. This caused a (harmless but annoying) EINVAL return value to be sent even though the operation completed successfully. PR: kern/37786 Submitted by: Ari Suutari <ari.suutari@syncrontech.com>,David Malone <dwmalone@maths.tcd.ie> MFC after: 1 day
* Cleanup the interface to ip_fw_chk, two of the input argumentsluigi2002-05-091-36/+34
| | | | | | | | | | | | | | | were totally useless and have been removed. ip_input.c, ip_output.c: Properly initialize the "ip" pointer in case the firewall does an m_pullup() on the packet. Remove some debugging code forgotten long ago. ip_fw.[ch], bridge.c: Prepare the grounds for matching MAC header fields in bridged packets, so we can have 'etherfw' functionality without a lot of kernel and userland bloat.
* Roll my own min() (named ISO88025_MIN() so as to not cause conflicts) sokbyanc2002-05-081-2/+4
| | | | | | that this header may be included from userland where min() may not be declared (or worse, declared differently). I open to alternative solutions.
* Move ISO88025 source routing information into sockaddr_dl's sdl_datakbyanc2002-05-073-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | field. This returns the sdl_data field to a variable-length field. More importantly, this prevents a easily-reproduceable data-corruption bug when the interface name plus the hardware address exceed the sdl_data field's original 12 byte limit. However, token-ring interfaces may still overflow the new sdl_data field's 46 byte limit if the interface name exceeds 6 characters (since 6 characters for interface name plus 6 for hardware address plus 34 for source routing = the size of sdl_data). Further refinements could overcome this limitation but would break binary compatibility; this commit only addresses fixing the bug for commonly-occuring cases without breaking binary compatibility with the intention that the functionality can be MFC'ed to -stable. See message ID's (both send to -arch): 20020421013332.F87395-100000@gateway.posi.net 20020430181359.G11009-300000@gateway.posi.net for a more thorough description of the bug addressed and how to reproduce it. Approved by: silence on -arch and -net Sponsored by: NTT Multimedia Communications Labs MFC after: 1 week
* MFOpenBSD: ibss and ibss-master.imp2002-05-071-0/+4
| | | | | | | | | | | | | ibss is the modern ad-hoc mode. ibss-master is the same, except that it creates the ibss network. This distinction is necessary because some supported cards (symbol) support the former without supporting the latter. A seprate commit will introduce a demo-adhoc mode so that we can disentwingle the multiple, mutually exclusive meandings of adhoc in the present state of affairs. Submitted by: jhay
* Minor style nitimp2002-05-071-1/+1
|
* Make funsetown() take a 'struct sigio **' so that the locking canalfred2002-05-063-3/+3
| | | | | | | | | | | | | | | | be done internally. Ensure that no one can fsetown() to a dying process/pgrp. We need to check the process for P_WEXIT to see if it's exiting. Process groups are already safe because there is no such thing as a pgrp zombie, therefore the proctree lock completely protects the pgrp from having sigio structures associated with it after it runs funsetownlst. Add sigio lock to witness list under proctree and allproc, but over proc and pgrp. Seigo Tanimura helped with this.
* Redo the sigio locking.alfred2002-05-014-7/+3
| | | | | | | | | | | Turn the sigio sx into a mutex. Sigio lock is really only needed to protect interrupts from dereferencing the sigio pointer in an object when the sigio itself is being destroyed. In order to do this in the most unintrusive manner change pgsigio's sigio * argument into a **, that way we can lock internally to the function.
* "pointers are not permitted as case values", so force the macros to ints.obrien2002-05-011-2/+2
|
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.tanimura2002-04-302-8/+14
| | | | | | | | | | Requested by: bde Since locking sigio_lock is usually followed by calling pgsigio(), move the declaration of sigio_lock and the definitions of SIGIO_*() to sys/signalvar.h. While I am here, sort include files alphabetically, where possible.
* Move us yet closer to IFM_* definitions in NetBSD.phk2002-04-291-42/+42
|
* Follow NetBSD and s/IFM_1000_TX/IFM_1000_T/phk2002-04-281-2/+2
|
* Add a global sx sigio_lock to protect the pointer to the sigio objecttanimura2002-04-271-1/+3
| | | | | | | | | | of a socket. This avoids lock order reversal caused by locking a process in pgsigio(). sowakeup() and the callers of it (sowwakeup, soisconnected, etc.) now require sigio_lock to be locked. Provide sowwakeup_locked(), soisconnected_locked(), and so on in case where we have to modify a socket and wake up a process atomically.
* just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.suz2002-04-198-22/+78
| | | | | | | (based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week
* Cosmetical change: remove empty line to reduce diffs to RELENG_4fjoe2002-04-141-1/+0
|
* Add hostap 802.11 media type.imp2002-04-121-0/+2
| | | | From wi_hostap stuff by Thomas Skibo
* Add two more IEEE80211 defines for status.imp2002-04-111-0/+2
|
* Swap a bzero for an M_ZERO. Borris approved this ages ago, butdwmalone2002-04-101-2/+1
| | | | | | | the hard drive with the patch on it went south before I committed it. Approved by: bp
* Add missing 'struct ifreq ifr;' that was forgotten in the last commit.peter2002-04-101-0/+1
|
* fixed a kernel crash when enabling multicast on vlan interfacesuz2002-04-101-4/+9
| | | | | | | owing to a NULL argument to vlan_ioctl() at if_allmulti(). Reviewed by: ume MFC after: 1 week
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-045-11/+12
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Replace (deprecated ?) FREE() macro with direct calls to free()luigi2002-04-048-22/+22
|
* Fix incorrect m_free - m_freem() usage.luigi2002-04-041-3/+2
|
* Fix a couple of incorrect m_free() vs. m_freem() usages and related issues.luigi2002-04-043-31/+20
| | | | Reviewed-by: brooks
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-019-26/+30
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Make `route add -inet6 default ::1 -ifp gif0' work actually.ume2002-04-011-5/+1
| | | | | | The change between 1.13 and 1.14 is specific to AF_INET. MFC after: 1 week
* - Merge the pdq driver (if_fpa and if_fea) from NetBSD.mdodd2002-03-292-6/+11
| | | | | Among other things this gets us ifmedia support. - Update fddi_ifattach() to take an additional argument.
* - Define fddibroadcastaddr in if_fddisubr.c.mdodd2002-03-292-5/+108
| | | | - Add fddi_ifdetach() and fddi_ioctl().
* - Use ifp->if_broadcastaddr when possible.mdodd2002-03-291-4/+2
| | | | - Remove unnecessary preprocessor conditional.
* - Add a comment.mdodd2002-03-291-2/+4
| | | | | - Whitespace. - Remove forgotten duplicate assignments in fddi_ifattach().
* - Update interface statistics on error conditions.mdodd2002-03-291-13/+50
| | | | | | | - Make sure the interface is UP and RUNNING in fddi_input(). - Reorder and comment packet tests in fddi_input(). - Call if_attach() in fddi_ifattach(). - Test for a valid return from ifaddr_byindex().
* - Whitespace changes.mdodd2002-03-291-8/+17
| | | | | | - Formatting. - Use macro, not magic numbers. - Move a dropanyway label in fddi_input() to end of function.
OpenPOWER on IntegriCloud