summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Adds support for the SCTP_PORT_REUSE optionrrs2008-07-317-110/+330
| | | | | | Fixes a refcount bug found in the process Obtained from: With the help of Michael Tuexen
* Fix build breakage - kthread_exit() in 8 now has no argumentsrrs2008-07-291-1/+2
| | | | MFC after: 1 week
* - Out with some printfs.rrs2008-07-296-19/+12
| | | | | | | - Fix a initialization of last_tsn_used - Fix handling of mapped IPv4 addresses Obtained from: Michael Tuexen and I :-) MFC after: 1 week
* Some style and assertion fixes to the previous commits hinted by rwatson.mav2008-07-281-3/+9
| | | | There is no functional changes.
* According to in_pcb.h protocol binding information has double locking.mav2008-07-271-2/+1
| | | | It allows access it while list travercing holding only global pcbinfo lock.
* Increase UDBHASHSIZE from 16 to 128 items.mav2008-07-261-1/+1
| | | | | Previous value was chosen 10 years ago and not very effective now. This change gives several percents speedup on 1000 L2TP mpd links.
* According to in_pcb.h protocol binding information has double locking.mav2008-07-261-24/+22
| | | | | It allows access it while list travercing holding only global pcbinfo lock. This relaxed locking noticably increses receive socket lookup performance.
* Add hash table lookup for a fully connected raw sockets.mav2008-07-261-9/+80
| | | | | | | This gives significant performance improvements when many raw sockets used. Benchmarks of mpd handeling 1000 simultaneous PPTP connections show up to 50% performance boost. With higher number of connections benefit becomes even bigger. PopTop snd others should also get some benefits.
* Trying to fix compilation bustage:avatar2008-07-222-4/+4
| | | | | | | | - removing 'const' qualifier from an input parameter to conform to the type required by rw_assert(); - using in_addr->s_addr to retrive 32 bits address value. Observed by: tinderbox
* make new accessor functions consistent with existing stylekmacy2008-07-212-9/+14
|
* - Switch to INP_WLOCK macro from inp_wlockkmacy2008-07-212-16/+1
| | | | | | - calling sodisconnect after tcp_twstart is both gratuitous and unsafe - remove Submitted by: rwatson
* Add versions of tcp_twstart, tcp_close, and tcp_drop that hide the ↵kmacy2008-07-212-1/+65
| | | | | | acquisition the tcbinfo lock. MFC after: 1 week
* add interface for external consumers to syncache_expand - rename ↵kmacy2008-07-212-2/+18
| | | | syncache_add in a manner consistent with other bits intended for offload
* Add accessor functions for socket fields.kmacy2008-07-211-0/+14
| | | | MFC after: 1 week
* add inpcb accessor functions for fields needed by TOE deviceskmacy2008-07-212-0/+62
|
* Document a few sysctls.trhodes2008-07-202-4/+4
| | | | Reviewed by: rwatson
* ia is a pointer thus use NULL rather then 0 for initialization andbz2008-07-201-5/+5
| | | | | | in comparisons to make this more obvious. MFC after: 5 days
* remove unused toedev functions and add comments for restkmacy2008-07-201-2/+22
|
* Add an accept filter for TCP based DNS requests. It waits until thedwmalone2008-07-181-0/+135
| | | | whole first request is present before returning from accept.
* Eliminate use of the global ripsrc which was being used to pass addressrwatson2008-07-181-7/+10
| | | | | | | | | | | | | | | | | information from rip_input() to rip_append(). Instead, pass the source address for an IP datagram to rip_append() using a stack-allocated sockaddr_in, similar to udp_input() and udp_append(). Prior to the move to rwlocks for inpcbinfo, this was not a problem, as use of the global was synchronized using the ripcbinfo mutex, but with read-locking there is the potential for a race during concurrent receive. This problem is not present in the IPv6 raw IP socket code, which already used a stack variable for the address. Spotted by: mav MFC after: 1 week (before inpcbinfo rwlock changes)
* Fix error in comment.rwatson2008-07-161-3/+3
| | | | MFC after: 3 weeks
* Merge last of a series of rwlock conversion changes to UDP, whichrwatson2008-07-152-34/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | completes the move to a fully parallel UDP transmit path by using global read, rather than write, locking of inpcbinfo in further semi-connected cases: - Add macros to allow try-locking of inpcb and inpcbinfo. - Always acquire an incpcb read lock in udp_output(), which stablizes the local inpcb address and port bindings in order to determine what further locking is required: - If the inpcb is currently not bound (at all) and are implicitly connecting, we require inpcbinfo and inpcb write locks, so drop the read lock and re-acquire. - If the inpcb is bound for at least one of the port or address, but an explicit source or destination is requested, trylock the inpcbinfo lock, and if that fails, drop the inpcb lock, lock the global lock, and relock the inpcb lock. - Otherwise, no further locking is required (common case). - Update comments. In practice, this means that the vast majority of consumers of UDP sockets will not acquire any exclusive locks at the socket or UDP levels of the network stack. This leads to a marked performance improvement in several important workloads, including BIND, nsd, and memcached over UDP, as well as significant improvements in pps microbenchmarks. The plan is to MFC all of the rwlock changes to RELENG_7 once they have settled for a weeks in the tree. Tested by: ps, kris (older revision), bde MFC after: 3 weeks
* Fix commment in typo.rpaulo2008-07-151-1/+1
| | | | M tcp_output.c
* Fix carp(4) panics that can occur during carp interface configuration.eri2008-07-141-0/+8
| | | | | | Approved by: mlaier (mentor) Reported by: Scott Ullrich MFC after: 1 week
* Slightly rearrange validation of UDP arguments and jail processing inrwatson2008-07-101-4/+25
| | | | | | | | | udp_output() so that argument validation occurs before jail processing. Add additional comments explaining what's going on when we process addresses and binding during udp_output(). MFC after: 3 weeks
* Pass the ucred along into in{,6}_pcblookup_local for upcomingbz2008-07-102-8/+8
| | | | | | prison checks. Reviewed by: rwatson
* For consistency take lport as u_short in in{,6}_pcblookup_local.bz2008-07-102-3/+2
| | | | | | All callers either pass in an u_short or u_int16_t. Reviewed by: rwatson
* Apply the MAC label to an outgoing UDP packet when other inpcb properties arerwatson2008-07-101-4/+4
| | | | | | | processed, meaning that we avoid the cost of MAC label assignment if we're going to drop the packet due to mbuf exhaustion, etc. MFC after: 3 weeks
* For consistency with the rest of the function use the locally cachedbz2008-07-091-1/+1
| | | | | | pointer pcbinfo rather than inp->inp_pcbinfo. MFC after: 3 weeks
* 1) Adds the rest of the VIMAGE change macrosrrs2008-07-0924-72/+121
| | | | | | | | | | | | 2) Adds some __UserSpace__ on some of the common defines that the user space code needs 3) Fixes a bug when we send up data to a user that failed. We need to a) trim off the data chunk headers, if present, and b) make sure the frag bit is communicated properly for the msgs coming off the stream queues... i.e. we see if some of the msg has been taken. Obtained from: jeli contributed the VIMAGE changes on this pass Thanks Julain!
* Provide some initial chicken-scratching annotations of locking forrwatson2008-07-081-27/+59
| | | | | | | struct inpcb. Prodded by: bz MFC after: 3 days
* Allow udp_notify() to accept read, as well as write, locks on the passedrwatson2008-07-071-3/+9
| | | | | | | | | inpcb. When directly invoking udp_notify() from udp_ctlinput(), acquire only a read lock; we may still see write locks in udp_notify() as the in_pcbnotifyall() routine is shared with TCP and always uses a write lock on the inpcb being notified. MFC after: 1 month
* Add additional udbinfo and inpcb locking assertions to udp_output(); forrwatson2008-07-071-0/+6
| | | | | | | | some code paths, global or inpcb write locks are required, but for other code paths, read locks or no locking at all are sufficient for the data structures. MFC after: 1 month
* First step towards parallel transmit in UDP: if neither a specificrwatson2008-07-071-5/+12
| | | | | | | | | | | | | source or a specific destination address is requested as part of a send on a UDP socket, read lock the inpcb rather than write lock it. This will allow fully parallel transmit down to the IP layer when sending simultaneously from multiple threads on a connected UDP socket. Parallel transmit for more complex cases, such as when sendto(2) is invoked with an address and there's already a local binding, will follow. MFC after: 1 month
* Drop read lock on udbinfo earlier during delivery to the last matchingrwatson2008-07-071-3/+5
| | | | | | | UDP socket for a datagram; the inpcb read lock is sufficient to provide inpcb stability during udp_append(). MFC after: 1 month
* Rename raw_append() to rip_append(): the raw_ prefix is generally usedrwatson2008-07-051-3/+3
| | | | | | | for functions in the generic raw socket library (raw_cb.c, raw_usrreq.c), and they are not used for IPv4 raw sockets. MFC after: 3 days
* Improve approximation of style(9) in raw socket code.rwatson2008-07-051-62/+75
|
* Enqueue de-capsulated packet instead of performing direct dispatch. It'sgonzo2008-07-041-2/+2
| | | | | | | | | possible to exhaust and garble stack with a packet that contains a couple of hundreds nested encapsulation levels. Submitted by: Ming Fu <fming@borderware.com> Reviewed by: rwatson PR: kern/85320
* Remove NETISR_MPSAFE, which allows specific netisr handlers to be directlyrwatson2008-07-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | | dispatched without Giant, and add NETISR_FORCEQUEUE, which allows specific netisr handlers to always be dispatched via a queue (deferred). Mark the usb and if_ppp netisr handlers as NETISR_FORCEQUEUE, and explicitly acquire Giant in those handlers. Previously, any netisr handler not marked NETISR_MPSAFE would necessarily run deferred and with Giant acquired. This change removes Giant scaffolding from the netisr infrastructure, but NETISR_FORCEQUEUE allows non-MPSAFE handlers to continue to force deferred dispatch so as to avoid lock order reversals between their acqusition of Giant and any calling context. It is likely we will be able to remove NETISR_FORCEQUEUE once IFF_NEEDSGIANT is removed, as non-MPSAFE usb and if_ppp drivers will no longer be supported. Reviewed by: bz MFC after: 1 month X-MFC note: We can't remove NETISR_MPSAFE from stable/7 for KPI reasons, but the rest can go back.
* Remove a bogusly introduced rtalloc_ign() in rev. 1.335/SVN 178029,bz2008-07-031-1/+0
| | | | | | | | | | | generating an RTM_MISS for every IP packet forwarded making user space routing daemons unhappy. PR: kern/123621, kern/124540, kern/122338 Reported by: Paul <paul gtcomm.net>, Mike Tancsa <mike sentex.net> on net@ Tested by: Paul and Mike Reviewed by: andre MFC after: 3 days
* Add soreceive_dgram(9), an optimized socket receive function for use byrwatson2008-07-021-0/+1
| | | | | | | | | | | | | | datagram-only protocols, such as UDP. This version removes use of sblock(), which is not required due to an inability to interlace data improperly with datagrams, as well as avoiding some of the larger loops and state management that don't apply on datagram sockets. This is experimental code, so hook it up only for UDPv4 for testing; if there are problems we may need to revise it or turn it off by default, but it offers *significant* performance improvements for threaded UDP applications such as BIND9, nsd, and memcached using UDP. Tested by: kris, ps
* In udp_append() and udp_input(), make use of read locking on incpbsrwatson2008-06-301-8/+8
| | | | | | | | | | | | | | | rather than write locking: while we need to maintain a valid reference to the inpcb and fix its state, no protocol layer state is modified during an IPv4 UDP receive -- there are only changes at the socket layer, which is separately protected by socket locking. While parallel concurrent receive on a single UDP socket is currently relatively unusual, introducing read locking in the transmit path, allowing concurrent receive and transmit, will significantly improve performance for loads such as BIND, memcached, etc. MFC after: 2 months Tested by: gnn, kris, ps
* In case of interface initialization failure remove struct in_ifaddr* fromgonzo2008-06-241-0/+8
| | | | | | | | | | in_ifaddrhashtbl in in_ifinit because error handler in in_control removes entries only for AF_INET addresses. If in_ifinit is called for the cloned inteface that has just been created its address family is not AF_INET and therefor LIST_REMOVE is not called for respective LIST_INSERT_HEAD and freed entries remain in in_ifaddrhashtbl and lead to memory corruption. PR: kern/124384
* Partially revert previous commit. DeleteLink() does not deletes permanentmav2008-06-221-1/+5
| | | | | links so we should be aware of it and try to delete every link only once or we will loop forever.
* Implement UDP transparent proxy support.mav2008-06-211-10/+76
| | | | | PR: bin/54274 Submitted by: Nicolai Petri <nicolai@petri.cc>
* Add support for PORT/EPRT FTP commands in lowercase.mav2008-06-211-96/+21
| | | | | | | Use strncasecmp() instead of huge local implementation to reduce code size. Check space presence after command/code. PR: kern/73034
* Change incorrect stale cookie detection in syncookie_lookup() that prematurelyups2008-06-161-1/+1
| | | | | | | declared a cookie as expired. Reviewed by: andre@, silby@ Reported by: Yahoo!
* Fix a check in SYN cache expansion (syncache_expand()) to accept packets ↵ups2008-06-161-4/+7
| | | | | | | | | | | that arrive in the receive window instead of just on the left edge of the receive window. This is needed for correct behavior when packets are lost or reordered. PR: kern/123950 Reviewed by: andre@, silby@ Reported by: Yahoo!, Wang Jin MFC after: 1 week
* More prep for Vimage:rrs2008-06-154-19/+17
| | | | | | - only one functino to destroy an SCTP stack sctp_finish() - Make it so this function also arranges for any threads created by the image to do a kthread_exit()
* - Fixes foobar on my part. Some missing virtualization macros fromrrs2008-06-142-7/+7
| | | | specific logging cases.
OpenPOWER on IntegriCloud