Deleted Added
full compact
tcp_timer.c (169309) tcp_timer.c (169454)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
30 * $FreeBSD: head/sys/netinet/tcp_timer.c 169309 2007-05-06 13:38:25Z andre $
30 * $FreeBSD: head/sys/netinet/tcp_timer.c 169454 2007-05-10 15:58:48Z rwatson $
31 */
32
33#include "opt_inet6.h"
34#include "opt_tcpdebug.h"
35
36#include <sys/param.h>
37#include <sys/kernel.h>
38#include <sys/ktr.h>

--- 84 unchanged lines hidden (view full) ---

123static int tcp_timer_rexmt(struct tcpcb *, struct inpcb *);
124
125/*
126 * Tcp protocol timeout routine called every 500 ms.
127 * Updates timestamps used for TCP
128 * causes finite state machine actions if timers expire.
129 */
130void
31 */
32
33#include "opt_inet6.h"
34#include "opt_tcpdebug.h"
35
36#include <sys/param.h>
37#include <sys/kernel.h>
38#include <sys/ktr.h>

--- 84 unchanged lines hidden (view full) ---

123static int tcp_timer_rexmt(struct tcpcb *, struct inpcb *);
124
125/*
126 * Tcp protocol timeout routine called every 500 ms.
127 * Updates timestamps used for TCP
128 * causes finite state machine actions if timers expire.
129 */
130void
131tcp_slowtimo()
131tcp_slowtimo(void)
132{
133
134 tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
135 INP_INFO_WLOCK(&tcbinfo);
136 (void) tcp_timer_2msl_tw(0);
137 INP_INFO_WUNLOCK(&tcbinfo);
138}
139

--- 4 unchanged lines hidden (view full) ---

144 { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 };
145
146static int tcp_totbackoff = 2559; /* sum of tcp_backoff[] */
147
148static int tcp_timer_race;
149SYSCTL_INT(_net_inet_tcp, OID_AUTO, timer_race, CTLFLAG_RD, &tcp_timer_race,
150 0, "Count of t_inpcb races on tcp_discardcb");
151
132{
133
134 tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
135 INP_INFO_WLOCK(&tcbinfo);
136 (void) tcp_timer_2msl_tw(0);
137 INP_INFO_WUNLOCK(&tcbinfo);
138}
139

--- 4 unchanged lines hidden (view full) ---

144 { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 };
145
146static int tcp_totbackoff = 2559; /* sum of tcp_backoff[] */
147
148static int tcp_timer_race;
149SYSCTL_INT(_net_inet_tcp, OID_AUTO, timer_race, CTLFLAG_RD, &tcp_timer_race,
150 0, "Count of t_inpcb races on tcp_discardcb");
151
152
153void
154tcp_timer_activate(struct tcpcb *tp, int timer_type, u_int delta)
155{
156 struct inpcb *inp = tp->t_inpcb;
157 struct tcp_timer *tt = tp->t_timers;
158 int tick = ticks; /* Stable time base. */
159 int next = delta ? tick + delta : 0;
160

--- 251 unchanged lines hidden (view full) ---

412
413 if (tp)
414 INP_UNLOCK(inp); /* CALLOUT_RETURNUNLOCKED */
415
416 INP_INFO_WUNLOCK(&tcbinfo);
417 return;
418}
419
152void
153tcp_timer_activate(struct tcpcb *tp, int timer_type, u_int delta)
154{
155 struct inpcb *inp = tp->t_inpcb;
156 struct tcp_timer *tt = tp->t_timers;
157 int tick = ticks; /* Stable time base. */
158 int next = delta ? tick + delta : 0;
159

--- 251 unchanged lines hidden (view full) ---

411
412 if (tp)
413 INP_UNLOCK(inp); /* CALLOUT_RETURNUNLOCKED */
414
415 INP_INFO_WUNLOCK(&tcbinfo);
416 return;
417}
418
420
421/*
422 * TCP timer processing.
423 */
424static int
425tcp_timer_delack(struct tcpcb *tp, struct inpcb *inp)
426{
427
428 tp->t_flags |= TF_ACKNOW;

--- 313 unchanged lines hidden ---
419/*
420 * TCP timer processing.
421 */
422static int
423tcp_timer_delack(struct tcpcb *tp, struct inpcb *inp)
424{
425
426 tp->t_flags |= TF_ACKNOW;

--- 313 unchanged lines hidden ---