Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Dec 2007 03:16:37 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 130453 for review
Message-ID:  <200712080316.lB83Gb6L017635@repoman.freebsd.org>

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

Change 130453 by kmacy@kmacy:storage:toestack on 2007/12/08 03:15:45

	add sysctl to drop all syncache entries
	don't skip offloaded entries from syncache timeout

Affected files ...

.. //depot/projects/toestack/sys/netinet/tcp_syncache.c#9 edit

Differences ...

==== //depot/projects/toestack/sys/netinet/tcp_syncache.c#9 (text+ko) ====

@@ -195,6 +195,10 @@
 
 SYSCTL_NODE(_net_inet_tcp, OID_AUTO, syncache, CTLFLAG_RW, 0, "TCP SYN cache");
 
+static int tcp_syncache_drop_all(SYSCTL_HANDLER_ARGS);
+SYSCTL_PROC(_net_inet_tcp_syncache, OID_AUTO, drop_all, CTLTYPE_INT | CTLFLAG_RW,
+    0, 0, tcp_syncache_drop_all, "IU", "drop all elements in the syncache");
+
 SYSCTL_INT(_net_inet_tcp_syncache, OID_AUTO, bucketlimit, CTLFLAG_RDTUN,
      &tcp_syncache.bucket_limit, 0, "Per-bucket hash limit for syncache");
 
@@ -407,10 +411,6 @@
 				sch->sch_nextc = sc->sc_rxttime;
 			continue;
 		}
-#ifndef DISABLE_TCP_OFFLOAD
-		if (sc->sc_inc.inc_eh != NULL)
-			continue;
-#endif	
 		if (sc->sc_rxmits > tcp_syncache.rexmt_limit) {
 			if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) {
 				log(LOG_DEBUG, "%s; %s: Retransmits exhausted, "
@@ -1727,3 +1727,29 @@
 	return error;
 }
 
+static int
+tcp_syncache_drop_all(SYSCTL_HANDLER_ARGS)
+{
+	struct syncache_head *sch = tcp_syncache.hashbase;
+	struct syncache *sc, *nsc;
+	int error, v;
+
+	v = 0;
+	error = sysctl_handle_int(oidp, &v, 0, req);
+	if (error)
+		return (error);
+	if (v == 0)
+		return (0);
+
+	printf("dropping syncache entries\n");
+	SCH_LOCK(sch);
+	TAILQ_FOREACH_SAFE(sc, &sch->sch_bucket, sc_hash, nsc) {
+		printf("dropping %p\n", sc);
+		
+		syncache_drop(sc, sch);
+	}
+	SCH_UNLOCK(sch);
+
+	return (0);
+}
+



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