Deleted Added
full compact
tcp_timer.c (115824) tcp_timer.c (117650)
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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)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

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)tcp_timer.c 8.2 (Berkeley) 5/24/95
34 * $FreeBSD: head/sys/netinet/tcp_timer.c 115824 2003-06-04 10:03:55Z hsu $
34 * $FreeBSD: head/sys/netinet/tcp_timer.c 117650 2003-07-15 21:49:53Z hsu $
35 */
36
37#include "opt_inet6.h"
38#include "opt_tcpdebug.h"
39
40#include <sys/param.h>
41#include <sys/kernel.h>
42#include <sys/lock.h>

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

523 * A retransmit is considered "bad" if an ACK for this
524 * segment is received within RTT/2 interval; the assumption
525 * here is that the ACK was already in flight. See
526 * "On Estimating End-to-End Network Path Properties" by
527 * Allman and Paxson for more details.
528 */
529 tp->snd_cwnd_prev = tp->snd_cwnd;
530 tp->snd_ssthresh_prev = tp->snd_ssthresh;
35 */
36
37#include "opt_inet6.h"
38#include "opt_tcpdebug.h"
39
40#include <sys/param.h>
41#include <sys/kernel.h>
42#include <sys/lock.h>

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

523 * A retransmit is considered "bad" if an ACK for this
524 * segment is received within RTT/2 interval; the assumption
525 * here is that the ACK was already in flight. See
526 * "On Estimating End-to-End Network Path Properties" by
527 * Allman and Paxson for more details.
528 */
529 tp->snd_cwnd_prev = tp->snd_cwnd;
530 tp->snd_ssthresh_prev = tp->snd_ssthresh;
531 tp->snd_high_prev = tp->snd_high;
531 tp->snd_recover_prev = tp->snd_recover;
532 if (IN_FASTRECOVERY(tp))
533 tp->t_flags |= TF_WASFRECOVERY;
534 else
535 tp->t_flags &= ~TF_WASFRECOVERY;
532 tp->t_badrxtwin = ticks + (tp->t_srtt >> (TCP_RTT_SHIFT + 1));
533 }
534 tcpstat.tcps_rexmttimeo++;
535 if (tp->t_state == TCPS_SYN_SENT)
536 rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift];
537 else
538 rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
539 TCPT_RANGESET(tp->t_rxtcur, rexmt,

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

561 in6_losing(tp->t_inpcb);
562 else
563#endif
564 in_losing(tp->t_inpcb);
565 tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
566 tp->t_srtt = 0;
567 }
568 tp->snd_nxt = tp->snd_una;
536 tp->t_badrxtwin = ticks + (tp->t_srtt >> (TCP_RTT_SHIFT + 1));
537 }
538 tcpstat.tcps_rexmttimeo++;
539 if (tp->t_state == TCPS_SYN_SENT)
540 rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift];
541 else
542 rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
543 TCPT_RANGESET(tp->t_rxtcur, rexmt,

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

565 in6_losing(tp->t_inpcb);
566 else
567#endif
568 in_losing(tp->t_inpcb);
569 tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
570 tp->t_srtt = 0;
571 }
572 tp->snd_nxt = tp->snd_una;
569 tp->snd_high = tp->snd_max;
573 tp->snd_recover = tp->snd_max;
570 /*
571 * Force a segment to be sent.
572 */
573 tp->t_flags |= TF_ACKNOW;
574 /*
575 * If timing a segment in this window, stop the timer.
576 */
577 tp->t_rtttime = 0;

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

602 {
603 u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
604 if (win < 2)
605 win = 2;
606 tp->snd_cwnd = tp->t_maxseg;
607 tp->snd_ssthresh = win * tp->t_maxseg;
608 tp->t_dupacks = 0;
609 }
574 /*
575 * Force a segment to be sent.
576 */
577 tp->t_flags |= TF_ACKNOW;
578 /*
579 * If timing a segment in this window, stop the timer.
580 */
581 tp->t_rtttime = 0;

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

606 {
607 u_int win = min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg;
608 if (win < 2)
609 win = 2;
610 tp->snd_cwnd = tp->t_maxseg;
611 tp->snd_ssthresh = win * tp->t_maxseg;
612 tp->t_dupacks = 0;
613 }
614 EXIT_FASTRECOVERY(tp);
610 (void) tcp_output(tp);
611
612out:
613#ifdef TCPDEBUG
614 if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
615 tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0,
616 PRU_SLOWTIMO);
617#endif
618 if (tp)
619 INP_UNLOCK(inp);
620 if (headlocked)
621 INP_INFO_WUNLOCK(&tcbinfo);
622 splx(s);
623}
615 (void) tcp_output(tp);
616
617out:
618#ifdef TCPDEBUG
619 if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
620 tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0,
621 PRU_SLOWTIMO);
622#endif
623 if (tp)
624 INP_UNLOCK(inp);
625 if (headlocked)
626 INP_INFO_WUNLOCK(&tcbinfo);
627 splx(s);
628}