diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2008-05-06 08:47:37 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2008-05-06 08:47:37 +0000 |
commit | 8c8e2776e709f0288a0eb619a06bd68108cb4a42 (patch) | |
tree | 43a9d61bf86b56d2d2a83923b75e00246c6c19ea | |
parent | 715f3069aea09faa3d9052dfd92b53f00dc89411 (diff) |
remove tcp_drain code since it's not longer used; ok henning, feedback thib
-rw-r--r-- | sys/netinet/in_proto.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 9 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 23 | ||||
-rw-r--r-- | sys/netinet/tcp_var.h | 33 | ||||
-rw-r--r-- | sys/netinet6/in6_proto.c | 6 |
5 files changed, 8 insertions, 67 deletions
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 6969401128e..01744b2e59f 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_proto.c,v 1.47 2007/12/14 18:33:40 deraadt Exp $ */ +/* $OpenBSD: in_proto.c,v 1.48 2008/05/06 08:47:35 markus Exp $ */ /* $NetBSD: in_proto.c,v 1.14 1996/02/18 18:58:32 christos Exp $ */ /* @@ -187,7 +187,7 @@ struct protosw inetsw[] = { { SOCK_STREAM, &inetdomain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_ABRTACPTDIS, tcp_input, 0, tcp_ctlinput, tcp_ctloutput, tcp_usrreq, - tcp_init, 0, tcp_slowtimo, tcp_drain, tcp_sysctl + tcp_init, 0, tcp_slowtimo, 0, tcp_sysctl }, { SOCK_RAW, &inetdomain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, rip_input, rip_output, 0, rip_ctloutput, diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ebbff633605..fa3bfc2eeff 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.212 2008/02/20 11:24:02 markus Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.213 2008/05/06 08:47:35 markus Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -1227,10 +1227,8 @@ after_listen: tp->snd_scale = tp->requested_s_scale; tp->rcv_scale = tp->request_r_scale; } - tcp_reass_lock(tp); (void) tcp_reass(tp, (struct tcphdr *)0, (struct mbuf *)0, &tlen); - tcp_reass_unlock(tp); /* * if we didn't have to retransmit the SYN, * use its rtt as our initial srtt & rtt var. @@ -1506,10 +1504,8 @@ trimthenstep6: tp->rcv_scale = tp->request_r_scale; tiwin = th->th_win << tp->snd_scale; } - tcp_reass_lock(tp); (void) tcp_reass(tp, (struct tcphdr *)0, (struct mbuf *)0, &tlen); - tcp_reass_unlock(tp); tp->snd_wl1 = th->th_seq - 1; /* fall into ... */ @@ -2042,10 +2038,8 @@ dodata: /* XXX */ tcp_seq laststart = th->th_seq; tcp_seq lastend = th->th_seq + tlen; #endif - tcp_reass_lock(tp); if (th->th_seq == tp->rcv_nxt && TAILQ_EMPTY(&tp->t_segq) && tp->t_state == TCPS_ESTABLISHED) { - tcp_reass_unlock(tp); TCP_SETUP_ACK(tp, tiflags); tp->rcv_nxt += tlen; tiflags = th->th_flags & TH_FIN; @@ -2062,7 +2056,6 @@ dodata: /* XXX */ } else { m_adj(m, hdroptlen); tiflags = tcp_reass(tp, th, m, &tlen); - tcp_reass_unlock(tp); tp->t_flags |= TF_ACKNOW; } #ifdef TCP_SACK diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index c6142a5129e..7492a2232a8 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.103 2008/02/20 14:23:31 markus Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.104 2008/05/06 08:47:36 markus Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -551,9 +551,7 @@ tcp_close(struct tcpcb *tp) #endif /* free the reassembly queue, if any */ - tcp_reass_lock(tp); tcp_freeq(tp); - tcp_reass_unlock(tp); tcp_canceltimers(tp); TCP_CLEAR_DELACK(tp); @@ -607,25 +605,6 @@ tcp_freeq(struct tcpcb *tp) return (rv); } -void -tcp_drain() -{ - struct inpcb *inp; - - /* called at splnet() */ - CIRCLEQ_FOREACH(inp, &tcbtable.inpt_queue, inp_queue) { - struct tcpcb *tp = (struct tcpcb *)inp->inp_ppcb; - - if (tp != NULL) { - if (tcp_reass_lock_try(tp) == 0) - continue; - if (tcp_freeq(tp)) - tcpstat.tcps_conndrained++; - tcp_reass_unlock(tp); - } - } -} - /* * Compute proper scaling value for receiver window from buffer space */ diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 4322cd9001c..51cf640a800 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_var.h,v 1.86 2008/02/20 14:23:31 markus Exp $ */ +/* $OpenBSD: tcp_var.h,v 1.87 2008/05/06 08:47:36 markus Exp $ */ /* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */ /* @@ -92,7 +92,6 @@ struct tcpcb { #define TF_SEND_CWR 0x00020000 /* send CWR in next seg */ #define TF_DISABLE_ECN 0x00040000 /* disable ECN for this connection */ #endif -#define TF_REASSLOCK 0x00080000 /* reassembling or draining */ #define TF_LASTIDLE 0x00100000 /* no outstanding ACK on last send */ #define TF_DEAD 0x00200000 /* dead and to-be-released */ #define TF_PMTUD_PEND 0x00400000 /* Path MTU Discovery pending */ @@ -302,35 +301,6 @@ struct syn_cache_head { u_short sch_length; /* # entries in bucket */ }; -static __inline int tcp_reass_lock_try(struct tcpcb *); -static __inline void tcp_reass_unlock(struct tcpcb *); -#define tcp_reass_lock(tp) tcp_reass_lock_try(tp) - -static __inline int -tcp_reass_lock_try(struct tcpcb *tp) -{ - int s; - - /* Use splvm() due to mbuf allocation. */ - s = splvm(); - if (tp->t_flags & TF_REASSLOCK) { - splx(s); - return (0); - } - tp->t_flags |= TF_REASSLOCK; - splx(s); - return (1); -} - -static __inline void -tcp_reass_unlock(struct tcpcb *tp) -{ - int s; - - s = splvm(); - tp->t_flags &= ~TF_REASSLOCK; - splx(s); -} #endif /* _KERNEL */ /* @@ -594,7 +564,6 @@ struct tcpcb * tcp_drop(struct tcpcb *, int); int tcp_dooptions(struct tcpcb *, u_char *, int, struct tcphdr *, struct mbuf *, int, struct tcp_opt_info *); -void tcp_drain(void); void tcp_init(void); #if defined(INET6) && !defined(TCP6) int tcp6_input(struct mbuf **, int *, int); diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index 387f80ca7ff..a74dd34b051 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6_proto.c,v 1.53 2007/12/14 18:33:41 deraadt Exp $ */ +/* $OpenBSD: in6_proto.c,v 1.54 2008/05/06 08:47:36 markus Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* @@ -136,9 +136,9 @@ struct ip6protosw inet6sw[] = { tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput, tcp6_usrreq, #ifdef INET /* don't call initialization and timeout routines twice */ - 0, 0, 0, tcp_drain, + 0, 0, 0, 0, #else - tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, + tcp_init, tcp_fasttimo, tcp_slowtimo, 0, #endif tcp_sysctl, }, |