Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jul 2009 14:34:29 GMT
From:      Andre Oppermann <andre@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 166451 for review
Message-ID:  <200907231434.n6NEYTsm032106@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=166451

Change 166451 by andre@andre_t61 on 2009/07/23 14:34:26

	Bring back tcp reassembly timers lost in the last integrate/resolve.

Affected files ...

.. //depot/projects/tcp_reass/netinet/tcp_timer.c#10 edit

Differences ...

==== //depot/projects/tcp_reass/netinet/tcp_timer.c#10 (text+ko) ====

@@ -597,6 +597,46 @@
 }
 
 void
+tcp_timer_reass(void *xtp)
+{
+	struct tcpcb *tp = xtp;
+	struct inpcb *inp;
+	CURVNET_SET(tp->t_vnet);
+
+	INP_INFO_RLOCK(&V_tcbinfo);
+	inp = tp->t_inpcb;
+	/*
+	 * XXXRW: While this assert is in fact correct, bugs in the tcpcb
+	 * tear-down mean we need it as a work-around for races between
+	 * timers and tcp_discardcb().
+	 *
+	 * KASSERT(inp != NULL, ("tcp_timer_reass: inp == NULL"));
+	 */
+	if (inp == NULL) {
+		tcp_timer_race++;
+		INP_INFO_RUNLOCK(&V_tcbinfo);
+		CURVNET_RESTORE();
+		return;
+	}
+	INP_WLOCK(inp);
+	INP_INFO_RUNLOCK(&V_tcbinfo);
+	if ((inp->inp_vflag & INP_DROPPED) || callout_pending(&tp->t_timers->tt_reass)
+	    || !callout_active(&tp->t_timers->tt_reass)) {
+		INP_WUNLOCK(inp);
+		CURVNET_RESTORE();
+		return;
+	}
+	callout_deactivate(&tp->t_timers->tt_reass);
+
+	TCPSTAT_INC(tcps_reass_flush);
+	tcp_reass_flush(tp);
+	tp->t_flags |= TF_ACKNOW;
+	(void) tcp_output(tp);
+	INP_WUNLOCK(inp);
+	CURVNET_RESTORE();
+}
+
+void
 tcp_timer_activate(struct tcpcb *tp, int timer_type, u_int delta)
 {
 	struct callout *t_callout;
@@ -623,6 +663,10 @@
 			t_callout = &tp->t_timers->tt_2msl;
 			f_callout = tcp_timer_2msl;
 			break;
+		case TT_REASS:
+			t_callout = &tp->t_timers->tt_reass;
+			f_callout = tcp_timer_reass;
+			break;
 		default:
 			panic("bad timer_type");
 		}
@@ -654,6 +698,8 @@
 		case TT_2MSL:
 			t_callout = &tp->t_timers->tt_2msl;
 			break;
+		case TT_REASS:
+			t_callout = &tp->t_timers->tt_reass;
 		default:
 			panic("bad timer_type");
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907231434.n6NEYTsm032106>