svn commit: r266205 - head/sys/netinet

Mike Silbersack silby at FreeBSD.org
Fri May 16 01:38:39 UTC 2014


Author: silby
Date: Fri May 16 01:38:38 2014
New Revision: 266205
URL: http://svnweb.freebsd.org/changeset/base/266205

Log:
  Remove the function tcp_twrecycleable; it has been #if 0'd for
  eight years.  The original concept was to improve the
  corner case where you run out of ephemeral ports, but it
  was causing performance problems and the mechanism
  of limiting the number of time_wait sockets serves
  the same purpose in the end.
  
  Reviewed by:	bz

Modified:
  head/sys/netinet/tcp_timewait.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_timewait.c
==============================================================================
--- head/sys/netinet/tcp_timewait.c	Fri May 16 01:30:30 2014	(r266204)
+++ head/sys/netinet/tcp_timewait.c	Fri May 16 01:38:38 2014	(r266205)
@@ -357,39 +357,6 @@ tcp_twstart(struct tcpcb *tp)
 		INP_WUNLOCK(inp);
 }
 
-#if 0
-/*
- * The appromixate rate of ISN increase of Microsoft TCP stacks;
- * the actual rate is slightly higher due to the addition of
- * random positive increments.
- *
- * Most other new OSes use semi-randomized ISN values, so we
- * do not need to worry about them.
- */
-#define	MS_ISN_BYTES_PER_SECOND		250000
-
-/*
- * Determine if the ISN we will generate has advanced beyond the last
- * sequence number used by the previous connection.  If so, indicate
- * that it is safe to recycle this tw socket by returning 1.
- */
-int
-tcp_twrecycleable(struct tcptw *tw)
-{
-	tcp_seq new_iss = tw->iss;
-	tcp_seq new_irs = tw->irs;
-
-	INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
-	new_iss += (ticks - tw->t_starttime) * (ISN_BYTES_PER_SECOND / hz);
-	new_irs += (ticks - tw->t_starttime) * (MS_ISN_BYTES_PER_SECOND / hz);
-
-	if (SEQ_GT(new_iss, tw->snd_nxt) && SEQ_GT(new_irs, tw->rcv_nxt))
-		return (1);
-	else
-		return (0);
-}
-#endif
-
 /*
  * Returns 1 if the TIME_WAIT state was killed and we should start over,
  * looking for a pcb in the listen state.  Returns 0 otherwise.

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Fri May 16 01:30:30 2014	(r266204)
+++ head/sys/netinet/tcp_var.h	Fri May 16 01:38:38 2014	(r266205)
@@ -635,9 +635,6 @@ struct tcpcb *
 	 tcp_close(struct tcpcb *);
 void	 tcp_discardcb(struct tcpcb *);
 void	 tcp_twstart(struct tcpcb *);
-#if 0
-int	 tcp_twrecycleable(struct tcptw *tw);
-#endif
 void	 tcp_twclose(struct tcptw *_tw, int _reuse);
 void	 tcp_ctlinput(int, struct sockaddr *, void *);
 int	 tcp_ctloutput(struct socket *, struct sockopt *);


More information about the svn-src-head mailing list