From owner-p4-projects@FreeBSD.ORG Sat Dec 8 03:16:38 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 10AC016A419; Sat, 8 Dec 2007 03:16:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A495416A417 for ; Sat, 8 Dec 2007 03:16:37 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 298E913C447 for ; Sat, 8 Dec 2007 03:16:37 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lB83GbZU017638 for ; Sat, 8 Dec 2007 03:16:37 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lB83Gb6L017635 for perforce@freebsd.org; Sat, 8 Dec 2007 03:16:37 GMT (envelope-from kmacy@freebsd.org) Date: Sat, 8 Dec 2007 03:16:37 GMT Message-Id: <200712080316.lB83Gb6L017635@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 130453 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2007 03:16:38 -0000 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); +} +