| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Approved by: re (implicit)
This commit was manufactured to restore the state of the 7.2-RELEASE image.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove now-unused INP_UNMAPPABLEOPTS.
Discussd with: bz
r189637:
Avoid use of IPv6 macro aliases to inpcb fields and inp_flags; we don't
remove their defintions as some third-party tools may use them (such as
net-snmp), unlike in the 8.x change.
References to in6p_lport and in6_fport in sockstat are also replaced with
normal inp_lport and inp_fport references.
Reviewed by: bz
r189848:
Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted. Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):
INP_TIMEWAIT
INP_SOCKREF
INP_ONESBCAST
INP_DROPPED
Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.
MFC after: 1 week (or after dependencies are MFC'd)
Reviewed by: bz
Note that this change requires netstat, systat, and sockstat to be
recompiled in order to properly print TIMEWAIT connection state; this
minor API change (documented in UPDATING) is considered worth it in
order to fix the above bugs. This change fixes the INP_ONESBCAST bug
describted in kern/124282 by disambiguating flag use.
Approved by: re (kib)
PR: kern/124282
r189637 discussed with: pav
Notes:
svn path=/stable/7/; revision=190457
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r178376, r178377, r178378, r178419, r179412, r179414, r180127, r180338,
r180343, r180344, r180346, r180348, r180368, r180422, r180429, r180536,
r180558, r180589, r181364, r181365 from head to stable/7:
Introduce and use rwlocks throughout the inpcbinfo and inpcb infrastructure,
and protocols that depend on that infrastructure, including UDP, TCP, and
IP raw sockets. Significant parts of this work were reviewed by Bjoern Zeeb,
and tested by Paul Saab, Kris Keneway, and George Neville-Neil, whose
contributions to this work are greatly appreciated.
Tested by: ps, kris, gnn, Mike Tancsa <mike at sentex dot net>
Reviewed by: bz, des
Notes:
svn path=/stable/7/; revision=181822
|
| |
|
|
|
|
|
|
|
|
| |
When allocating temporary storage to hold a TCP/IP packet header
template, use an M_TEMP malloc(9) allocation rather than an mbuf
with mtod(9) and dtom(9). This eliminates the last use of
dtom(9) in TCP.
Notes:
svn path=/stable/7/; revision=181121
|
| |
|
|
|
|
|
|
|
| |
easily include file version information in bug reports.
Approved by: re (kensmith)
Notes:
svn path=/head/; revision=172467
|
| |
|
|
|
|
|
|
|
|
|
| |
Check the return value of tcp_close() being NULL before dereferencing it
in #ifdef TCPDEBUG block.
Reviewed by: rwatson
Approved by: re (gnn)
Notes:
svn path=/head/; revision=172312
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Reintegrate the ANSI C function declaration change
from tcp_timer.c rev 1.92
- Reorganize the tcpcb structure so that it has a single
pointer to the "tcp_timer" structure which contains all
of the tcp timer callouts. This change means that when
the single tcp timer change is reintegrated, tcpcb will
not change in size, and therefore the ABI between
netstat and the kernel will not change.
Neither of these changes should have any functional
impact.
Reviewed by: bmah, rrs
Approved by: re (bmah)
Notes:
svn path=/head/; revision=172309
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TCP timers as a single timer, but retain the API changes necessary to
reintroduce this change. This will back out the source of at least two
reported problems: lock leaks in certain timer edge cases, and TCP timers
continuing to fire after a connection has closed (a bug previously fixed and
then reintroduced with the timer rewrite).
In a follow-up commit, some minor restylings and comment changes performed
after the TCP timer rewrite will be reapplied, and a further change to allow
the TCP timer rewrite to be added back without disturbing the ABI. The new
design is believed to be a good thing, but the outstanding issues are
leading to significant stability/correctness problems that are holding
up 7.0.
This patch was generated by silby, but is being committed by proxy due to
poor network connectivity for silby this week.
Approved by: re (kensmith)
Submitted by: silby
Tested by: rwatson, kris
Problems reported by: peter, kris, others
Notes:
svn path=/head/; revision=172074
|
| |
|
|
|
|
|
|
|
|
|
|
| |
a timer issues a shutdown and a simultaneous close on the socket
happens. This race condition is inherent in the current socket/
inpcb life cycle system but can be handled well.
Reported by: kris
Tested by: kris (on 8-core machine)
Notes:
svn path=/head/; revision=170464
|
| |
|
|
|
|
|
|
|
|
| |
NULL before entering tcp_trace().
Found with: Coverity Prevent(tm)
CID: 1840
Notes:
svn path=/head/; revision=170024
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
other than repo copied tcp_subr.c into tcp_timewait.c#1.284:
tcp_input.c#1.350 tcp_timewait() -> tcp_twcheck()
tcp_timer.c#1.92 tcp_timer_2msl_reset() -> tcp_tw_2msl_reset()
tcp_timer.c#1.92 tcp_timer_2msl_stop() -> tcp_tw_2msl_stop()
tcp_timer.c#1.92 tcp_timer_2msl_tw() -> tcp_tw_2msl_scan()
This is a mechanical move with appropriate renames and making
them static if used only locally.
The tcp_tw_2msl_scan() cleanup function is still run from the
tcp_slowtimo() in tcp_timer.c.
Notes:
svn path=/head/; revision=169608
|
| |
|
|
|
|
|
| |
consistent style(9)-ish layout.
Notes:
svn path=/head/; revision=169454
|
| |
|
|
| |
Notes:
svn path=/head/; revision=169309
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
directly to a merged model where only one callout, the next to fire,
is registered.
Instead of callout_reset(9) and callout_stop(9) the new function
tcp_timer_activate() is used which then internally manages the callout.
The single new callout is a mutex callout on inpcb simplifying the
locking a bit.
tcp_timer() is the called function which handles all race conditions
in one place and then dispatches the individual timer functions.
Reviewed by: rwatson (earlier version)
Notes:
svn path=/head/; revision=168615
|
| |
|
|
| |
Notes:
svn path=/head/; revision=168364
|
| |
|
|
|
|
|
| |
Consistently apply style to all function declarations.
Notes:
svn path=/head/; revision=167785
|
| |
|
|
| |
Notes:
svn path=/head/; revision=167721
|
| |
|
|
|
|
|
|
|
|
|
| |
potential issues where the peer does not close, potentially leaving
thousands of connections in FIN_WAIT_2. This is controlled by a new sysctl
fast_finwait2_recycle, which is disabled by default.
Reviewed by: gnn, silby.
Notes:
svn path=/head/; revision=167036
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
timeouts for TCP and T/TCP connections in the TIME_WAIT
state, and we had two separate timed wait queues for them.
Now that is has gone, the timeout is always 2*MSL again,
and there is no reason to keep two queues (the first was
unused anyway!).
Also, reimplement the remaining queue using a TAILQ (it
was technically impossible before, with two queues).
Notes:
svn path=/head/; revision=162111
|
| |
|
|
| |
Notes:
svn path=/head/; revision=162108
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bad under high load. For example with 40k sockets and 25k tcptw
entries, connect() syscall can run for seconds. Debugging showed
that it iterates the cycle millions times and purges thousands of
tcptw entries at a time.
Besides practical unusability this change is architecturally
wrong. First, in_pcblookup_local() is used in connect() and bind()
syscalls. No stale entries purging shouldn't be done here. Second,
it is a layering violation.
o Return back the tcptw purging cycle to tcp_timer_2msl_tw(),
that was removed in rev. 1.78 by rwatson. The commit log of this
revision tells nothing about the reason cycle was removed. Now
we need this cycle, since major cleaner of stale tcptw structures
is removed.
o Disable probably necessary, but now unused
tcp_twrecycleable() function.
Reviewed by: ru
Notes:
svn path=/head/; revision=162064
|
| |
|
|
|
|
|
|
| |
the timewait expiry to be exactly 0 corrupts the timewait queues (and that entry).
Reviewed by: silby
Notes:
svn path=/head/; revision=161226
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dropped. This prevents a bug introduced during the socket/pcb refcounting
work from occuring, in which occasionally the retransmit timer may fire
after a connection has been reset, resulting in the resulting R|A TCP
packet having a source port of 0, as the port reservation has been
released.
While here, fixing up some RUNLOCK->WUNLOCK bugs.
MFC after: 1 month
Notes:
svn path=/head/; revision=159199
|
| |
|
|
|
|
|
|
|
| |
- Style next line.
Coverity ID: 912
Notes:
svn path=/head/; revision=158644
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
return NULL. In principle this shouldn't change the behavior, but
avoids returning a potentially invalid/inappropriate pointer to
the caller.
Found with: Coverity Prevent (tm)
Submitted by: pjd
MFC after: 3 months
Notes:
svn path=/head/; revision=158304
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pru_abort(), pru_detach(), and in_pcbdetach():
- Universally support and enforce the invariant that so_pcb is
never NULL, converting dozens of unnecessary NULL checks into
assertions, and eliminating dozens of unnecessary error handling
cases in protocol code.
- In some cases, eliminate unnecessary pcbinfo locking, as it is no
longer required to ensure so_pcb != NULL. For example, the receive
code no longer requires the pcbinfo lock, and the send code only
requires it if building a new connection on an otherwise unconnected
socket triggered via sendto() with an address. This should
significnatly reduce tcbinfo lock contention in the receive and send
cases.
- In order to support the invariant that so_pcb != NULL, it is now
necessary for the TCP code to not discard the tcpcb any time a
connection is dropped, but instead leave the tcpcb until the socket
is shutdown. This case is handled by setting INP_DROPPED, to
substitute for using a NULL so_pcb to indicate that the connection
has been dropped. This requires the inpcb lock, but not the pcbinfo
lock.
- Unlike all other protocols in the tree, TCP may need to retain access
to the socket after the file descriptor has been closed. Set
SS_PROTOREF in tcp_detach() in order to prevent the socket from being
freed, and add a flag, INP_SOCKREF, so that the TCP code knows whether
or not it needs to free the socket when the connection finally does
close. The typical case where this occurs is if close() is called on
a TCP socket before all sent data in the send socket buffer has been
transmitted or acknowledged. If INP_SOCKREF is found when the
connection is dropped, we release the inpcb, tcpcb, and socket instead
of flagging INP_DROPPED.
- Abort and detach protocol switch methods no longer return failures,
nor attempt to free sockets, as the socket layer does this.
- Annotate the existence of a long-standing race in the TCP timer code,
in which timers are stopped but not drained when the socket is freed,
as waiting for drain may lead to deadlocks, or have to occur in a
context where waiting is not permitted. This race has been handled
by testing to see if the tcpcb pointer in the inpcb is NULL (and vice
versa), which is not normally permitted, but may be true of a inpcb
and tcpcb have been freed. Add a counter to test how often this race
has actually occurred, and a large comment for each instance where
we compare potentially freed memory with NULL. This will have to be
fixed in the near future, but requires is to further address how to
handle the timer shutdown shutdown issue.
- Several TCP calls no longer potentially free the passed inpcb/tcpcb,
so no longer need to return a pointer to indicate whether the argument
passed in is still valid.
- Un-macroize debugging and locking setup for various protocol switch
methods for TCP, as it lead to more obscurity, and as locking becomes
more customized to the methods, offers less benefit.
- Assert copyright on tcp_usrreq.c due to significant modifications that
have been made as part of this work.
These changes significantly modify the memory management and connection
logic of our TCP implementation, and are (as such) High Risk Changes,
and likely to contain serious bugs. Please report problems to the
current@ mailing list ASAP, ideally with simple test cases, and
optionally, packet traces.
MFC after: 3 months
Notes:
svn path=/head/; revision=157376
|
| |
|
|
|
|
|
|
|
|
|
|
| |
provide better debugging information.
Prefer explicit comparison to NULL for tcpcb pointers rather than
treating them as booleans.
MFC after: 1 month
Notes:
svn path=/head/; revision=157136
|
| |
|
|
|
|
|
|
|
|
| |
of being private to tcp_timer.c.
Sponsored by: TCP/IP Optimization Fundraise 2005
MFC after: 3 days
Notes:
svn path=/head/; revision=155758
|
| |
|
|
|
|
|
|
|
| |
is believed to be basically done (modulo any remaining bugs).
MFC after: 3 days
Notes:
svn path=/head/; revision=148156
|
| |
|
|
|
|
|
|
| |
Submitted by: Raja Mukerji.
Reviewed by: Mohan, Silby, Andre Opperman.
Notes:
svn path=/head/; revision=146463
|
| |
|
|
| |
Notes:
svn path=/head/; revision=139823
|
| |
|
|
|
|
|
|
|
| |
now stopped as part of tcp_discardcb().
MFC after: 2 weeks
Notes:
svn path=/head/; revision=139220
|
| |
|
|
|
|
|
|
|
|
|
|
| |
multiple MIB entries using sysctl in short order, which might
result in unexpected values for tcp_maxidle being generated by
tcp_slowtimo. In practice, this will not happen, or at least,
doesn't require an explicit comment.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=139219
|
| |
|
|
|
|
|
|
|
| |
the tcptw undergo non-atomic read-modify-writes.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=138416
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
structure, so assert the inpcb lock associated with the tcptw.
Also assert the tcbinfo lock, as tcp_timewait() may call
tcp_twclose() or tcp_2msl_rest(), which require it. Since
tcp_timewait() is already called with that lock from tcp_input(),
this doesn't change current locking, merely documents reasons for
it.
In tcp_twstart(), assert the tcbinfo lock, as tcp_timer_2msl_rest()
is called, which requires that lock.
In tcp_twclose(), assert the tcbinfo lock, as tcp_timer_2msl_stop()
is called, which requires that lock.
Document the locking strategy for the time wait queues in tcp_timer.c,
which consists of protecting the time wait queues in the same manner
as the tcbinfo structure (using the tcbinfo lock).
In tcp_timer_2msl_reset(), assert the tcbinfo lock, as the time wait
queues are modified.
In tcp_timer_2msl_stop(), assert the tcbinfo lock, as the time wait
queues may be modified.
In tcp_timer_2msl_tw(), assert the tcbinfo lock, as the time wait
queues may be modified.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=138025
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
but unlikely races that could be corrected by having tcp_keepcnt
and tcp_keepintvl modifications go through handler functions via
sysctl, but probably is not worth doing. Updates to multiple
sysctls within evaluation of a single addition are unlikely.
Annotate that tcp_canceltimers() is currently unused.
De-spl tcp_timer_delack().
De-spl tcp_timer_2msl().
MFC after: 2 weeks
Notes:
svn path=/head/; revision=138024
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A complete rationale and discussion is given in this message
and the resulting discussion:
http://docs.freebsd.org/cgi/mid.cgi?4177C8AD.6060706
Note that this commit removes only the functional part of T/TCP
from the tcp_* related functions in the kernel. Other features
introduced with RFC1644 are left intact (socket layer changes,
sendmsg(2) on connection oriented protocols) and are meant to
be reused by a simpler and less intrusive reimplemention of the
previous T/TCP functionality.
Discussed on: -arch
Notes:
svn path=/head/; revision=137139
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Trailing tab/space cleanup
- Remove spurious spaces between or before tabs
This change avoids touching files that Andre likely has in his working
set for PFIL hooks changes for IPFW/DUMMYNET.
Approved by: re (scottl)
Submitted by: Xin LI <delphij@frontfree.net>
Notes:
svn path=/head/; revision=133874
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
originated on RELENG_4 and was ported to -CURRENT.
The scoreboarding code was obtained from OpenBSD, and many
of the remaining changes were inspired by OpenBSD, but not
taken directly from there.
You can enable/disable sack using net.inet.tcp.do_sack. You can
also limit the number of sack holes that all senders can have in
the scoreboard with net.inet.tcp.sackhole_limit.
Reviewed by: gnn
Obtained from: Yahoo! (Mohan Srinivasan, Jayanth Vijayaraghavan)
Notes:
svn path=/head/; revision=130989
|
| |
|
|
|
|
|
|
|
|
| |
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.
Approved by: core, peter, alc, rwatson
Notes:
svn path=/head/; revision=128019
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the routing table. Move all usage and references in the tcp stack
from the routing table metrics to the tcp hostcache.
It caches measured parameters of past tcp sessions to provide better
initial start values for following connections from or to the same
source or destination. Depending on the network parameters to/from
the remote host this can lead to significant speedups for new tcp
connections after the first one because they inherit and shortcut
the learning curve.
tcp_hostcache is designed for multiple concurrent access in SMP
environments with high contention and is hash indexed by remote
ip address.
It removes significant locking requirements from the tcp stack with
regard to the routing table.
Reviewed by: sam (mentor), bms
Reviewed by: -net, -current, core@kame.net (IPv6 parts)
Approved by: re (scottl)
Notes:
svn path=/head/; revision=122922
|
| |
|
|
|
|
|
| |
Supported by: FreeBSD Foundation
Notes:
svn path=/head/; revision=122326
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lastest rev of the spec. Use an explicit flag for Fast Recovery. [1]
Fix bug with exiting Fast Recovery on a retransmit timeout
diagnosed by Lu Guohan. [2]
Reviewed by: Thomas Henderson <thomas.r.henderson@boeing.com>
Reported and tested by: Lu Guohan <lguohan00@mails.tsinghua.edu.cn> [2]
Approved by: Thomas Henderson <thomas.r.henderson@boeing.com>,
Sally Floyd <floyd@acm.org> [1]
Notes:
svn path=/head/; revision=117650
|
| |
|
|
|
|
|
| |
Reviewed by: jlemon
Notes:
svn path=/head/; revision=115824
|
| |
|
|
|
|
|
|
|
|
| |
structures, reuse the oldest one. Also move the expiry timer from
a per-structure callout to the tcp slow timer.
Sponsored by: DARPA, NAI Labs
Notes:
svn path=/head/; revision=112009
|
| |
|
|
|
|
|
|
|
|
|
| |
control block. Allow the socket and tcpcb structures to be freed
earlier than inpcb. Update code to understand an inp w/o a socket.
Reviewed by: hsu, silby, jayanth
Sponsored by: DARPA, NAI Labs
Notes:
svn path=/head/; revision=111145
|
| |
|
|
|
|
|
|
|
|
|
| |
routine does not require a tcpcb to operate. Since we no longer keep
template mbufs around, move pseudo checksum out of this routine, and
merge it with the length update.
Sponsored by: DARPA, NAI Labs
Notes:
svn path=/head/; revision=111144
|
| |
|
|
|
|
|
| |
Reviewed by: Tom Henderson <thomas.r.henderson@boeing.com>
Notes:
svn path=/head/; revision=109175
|
| |
|
|
| |
Notes:
svn path=/head/; revision=108265
|
| |
|
|
|
|
|
|
|
| |
on namespace pollution 4 layers deep in <netinet/in_pcb.h>.
Removed unused includes. Sorted includes.
Notes:
svn path=/head/; revision=102967
|