summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.c
AgeCommit message (Collapse)Author
2022-11-04inpcb: rename functions to inpcb_*ozaki-r
Inspired by rmind-smpnet patches.
2022-10-28inpcb: separate inpcb again to reduce the size of PCB for IPv4ozaki-r
The data size of PCB for IPv4 increased because of the merge of struct in6pcb. The change decreases the size to the original size by separating struct inpcb (again). struct in4pcb and in6pcb that embed struct inpcb are introduced. Even after the separation, users don't need to realize the separation and only have to use some macros to access dedicated data. For example, inp->inp_laddr is now accessed through in4p_laddr(inp).
2022-10-28inpcb: integrate data structures of PCB into oneozaki-r
Data structures of network protocol control blocks (PCBs), i.e., struct inpcb, in6pcb and inpcb_hdr, are not organized well. Users of the data structures have to handle them separately and thus the code is cluttered and duplicated. The commit integrates the data structures into one, struct inpcb. As a result, users of PCBs only have to handle just one data structure, so the code becomes simple. One drawback is that the data size of PCB for IPv4 increases by 40 bytes (from 248 bytes to 288 bytes).
2021-03-08Add some randomness to the iss offsetchristos
2018-05-03Remove now unused tcpip.h includes. Some were already unused before.maxv
2018-03-29Remove #ifdef INET. Same as tcp_input.c. Makes the code easier tomaxv
understand. Also make tcp6_mtudisc() static in tcp_subr.c.
2018-01-19Run tcp_slowtimo in workqueue if NET_MPSAFEozaki-r
If NET_MPSAFE is enabled, we have to avoid taking softnet_lock in softint as much as possible to prevent any softint handlers including callout handlers such as tcp_slowtimo from sticking on softnet_lock because it results in undesired delays of executing subsequent softint handlers. NFCI for !NET_MPSAFE
2017-07-28Remove TCP_COMPAT_42. This feature is a workaround for a bug in the TCPmaxv
stack of BSD4.2. Having such features just does not make any sense, and looking at the code, I'm not sure it actually works.
2016-07-25fix: unlock in reverse orderknakahara
2016-04-26Sweep unnecessary route.h inclusionsozaki-r
2015-08-24sprinkle _KERNEL_OPTpooka
2014-11-10Do not uselessly include <sys/malloc.h>.maxv
2014-01-02Allow kernels compiled with INET+INET6 to be booted as IPv4-only or IPv6-only.pooka
2011-08-31NULL does not need a castplunky
2011-04-20Rewrite comments about TCP RTO calculations.gdt
Long ago, the storage representations of srtt and rttvar were changed from the 4.4BSD scheme, and the comments are out of sync with the code. This commit rewrites most of the comments that explain the RTO calculations, and points out some issues in the code. Joint work with Bev Schwartz of BBN (original analysis and comments), but I have rewritten and extended them, so errors are mine. This material is based upon work supported by the Defense Advanced Research Projects Agency and Space and Naval Warfare Systems Center, Pacific, under Contract No. N66001-09-C-2073. Approved for Public Release, Distribution Unlimited
2008-11-10Whitespace.uebayasi
2008-11-09Fix kern/39769: race condition in TCP timersbouyer
When a TCP timer is disarmed (with callout_stop()) in the general case callout_invoking() isn't checked, so the timer handler could be called run when the current interrupt handler exits, athough the timer is disarmed. This case cause bad things like TCPT_REXMT and TCPT_PERSIST being both pending, causing a panic (see the PR for details). Close the issue by aborting the handler if the timer is not callout_expired(). (the EXPIRED flag being cleared by callout_stop()).
2008-10-10tcp_delack: test for TF_DELACK.ad
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-24Merge the socket locking patch:ad
- Socket layer becomes MP safe. - Unix protocols become MP safe. - Allows protocol processing interrupts to safely block on locks. - Fixes a number of race conditions. With much feedback from matt@ and plunky@.
2008-04-12Make IP, TCP, UDP, and ICMP statistics per-CPU. The stats are collatedthorpej
when the user requests them via sysctl.
2008-04-08Change TCP stats from a structure to an array of uint64_t's.thorpej
Note: This is ABI-compatible with the old tcpstat structure; old netstat binaries will continue to work properly.
2007-06-20- per socket keepalive settingschristos
- settable connection establishment timeout
2006-10-09Modular (I tried ;-) TCP congestion control API. Whenever certain conditionsrpaulo
happen in the TCP stack, this interface calls the specified callback to handle the situation according to the currently selected congestion control algorithm. A new sysctl node was created: net.inet.tcp.congctl.{available,selected} with obvious meanings. The old net.inet.tcp.newreno MIB was removed. The API is discussed in tcp_congctl(9). In the near future, it will be possible to selected a congestion control algorithm on a per-socket basis. Discussed on tech-net and reviewed by <yamt>.
2006-05-14integrate kauth.elad
2006-04-15Coverity CID 1153: Add KASSERT before deref.christos
2005-12-11merge ktrace-lwp.christos
2005-07-19Implement PMTU checks from:christos
http://www.gont.com.ar/drafts/icmp-attacks-against-tcp.html 1. Don't act on ICMP-need-frag immediately if adhoc checks on the advertised MTU fail. The MTU update is delayed until a TCP retransmit happens. 2. Ignore ICMP Source Quench messages meant for TCP connections. From OpenBSD.
2005-03-02Copyright maintenance.mycroft
2005-02-28Commit TCP SACK patches from Kentaro A. Karahone's patch at:jonathan
http://www.sigusr1.org/~kurahone/tcp-sack-netbsd-02152005.diff.gz Fixes in that patch for pre-existing TCP pcb initializations were already committed to NetBSD-current, so are not included in this commit. The SACK patch has been observed to correctly negotiate and respond, to SACKs in wide-area traffic. There are two indepenently-observed, as-yet-unresolved anomalies: First, seeing unexplained delays between in fast retransmission (potentially explainable by an 0.2sec RTT between adjacent ethernet/wifi NICs); and second, peculiar and unepxlained TCP retransmits observed over an ath0 card. After discussion with several interested developers, I'm committing this now, as-is, for more eyes to use and look over. Current hypothesis is that the anomalies above may in fact be due to link/level (hardware, driver, HAL, firmware) abberations in the test setup, affecting both Kentaro's wired-Ethernet NIC and in my two (different) WiFi NICs.
2005-02-03ANSIfy function declarationsperry
2005-01-27Whoops. Exit fast recovery when handling a timeout.mycroft
2005-01-26Fix two problems in our TCP stack:mycroft
1) If an echoed RFC 1323 time stamp appears to be later than the current time, ignore it and fall back to old-style RTT calculation. This prevents ending up with a negative RTT and panicking later. 2) Fix NewReno. This involves a few changes: a) Implement the send_high variable in RFC 2582. Our implementation is subtly different; it is one *past* the last sequence number transmitted rather than being equal to it. This simplifies some logic and makes the code smaller. Additional logic was required to prevent sequence number wraparound problems; this is not mentioned in RFC 2582. b) Make sure we reset t_dupacks on new acks, but *not* on a partial ack. All of the new ack code is pushed out into tcp_newreno(). (Later this will probably be a pluggable function.) Thus t_dupacks keeps track of whether we're in fast recovery all the time, with Reno or NewReno, which keeps some logic simpler. c) We do not need to update snd_recover when we're not in fast recovery. See tech-net for an explanation of this. d) In the gratuitous fast retransmit prevention case, do not send a packet. RFC 2582 specifically says that we should "do nothing". e) Do not inflate the congestion window on a partial ack. (This is done by testing t_dupacks to see whether we're still in fast recovery.) This brings the performance of NewReno back up to the same as Reno in a few random test cases (e.g. transferring peer-to-peer over my wireless network). I have not concocted a good test case for the behavior specific to NewReno.
2004-01-02some corrections from markus@openbsd;itojun
- callout_ack() was called with wrong argument
2003-10-27make it compilable with TCP_DEBUG defineditojun
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-07-20As a temporary workaround, apply the fix from PR#20390, therebyhe
cooperating with the callout code in working around the race condition caused by the TCP code's use of the callout facility. Instead of unconditionally releasing memory in tcp_close() and SYN_CACHE_PUT(), check whether any of the related callout handlers are about to be invoked (but have not yet done callout_ack()), and if so, just mark the associated data structure (tcpcb or syn cache entry) as "dead", and test for this (and release storage) in the callout handler functions.
2003-02-03Test callout_pending(), not callout_active(), and eliminate now-unnecessarythorpej
callout_deactivate() calls.
2002-11-24Quell an uninitialised variable warning.scw
2002-10-22Guard use of "so" in tcp_timer_persist() and tcp_timer_2msl() withsimonb
#ifdef TCP_DEBUG.
2002-06-09whitespaceitojun
2002-05-26path MTU discovery blackhole detection.itojun
PR 12790 (sorry for not committing it for a long time)
2001-11-13add RCSIDslukem
2001-11-04Change a few variable/tables to const since they are read-only.matt
2001-09-11Use callouts for SYN cache timers, rather than traversing time queuesthorpej
in tcp_slowtimo().
2001-09-10Update copyrights.thorpej
2001-09-10Use callouts for TCP timers, rather than traversing the list ofthorpej
all open TCP connections in tcp_slowtimo() (which is called 2x per second). It's fairly rare for TCP timers to actually fire, so saving this list traversal is good, especially if you want to scale to thousands of open connections.
2001-09-10Initialize TCP timer variables in a new function, tcp_timer_init().thorpej
2001-09-10Split tcp_timers() into multiple functions, one for each timer,thorpej
and call it directly from tcp_slowtimo() (via a table) rather than going through tcp_userreq(). This will allow us to call TCP timers directly from callouts, in a future revision.
2001-09-10Change the way receive idle time and round trip time are measured.thorpej
Instead of incrementing t_idle and t_rtt in tcp_slowtimo(), we now take a timstamp (via tcp_now) and use subtraction to compute the delta when we actually need it (using unsigned arithmetic so that tcp_now wrapping is handled correctly). Based on similar changes in FreeBSD.