From owner-svn-src-all@FreeBSD.ORG Sat Sep 21 04:05:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 93E2C513; Sat, 21 Sep 2013 04:05:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68134250D; Sat, 21 Sep 2013 04:05:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8L45d0b025975; Sat, 21 Sep 2013 04:05:39 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8L45dXM025973; Sat, 21 Sep 2013 04:05:39 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201309210405.r8L45dXM025973@svn.freebsd.org> From: Cy Schubert Date: Sat, 21 Sep 2013 04:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255755 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2013 04:05:39 -0000 Author: cy Date: Sat Sep 21 04:05:38 2013 New Revision: 255755 URL: http://svnweb.freebsd.org/changeset/base/255755 Log: Convert ipfilter from timeout(9) to callout(9). Submitted by: jhb Approved by: glebius (mentor) Approved by: re (blanket) Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Sat Sep 21 03:57:56 2013 (r255754) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Sat Sep 21 04:05:38 2013 (r255755) @@ -1654,7 +1654,7 @@ typedef struct ipf_main_softc_s { ipftoken_t **ipf_token_tail; #if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000) && \ defined(_KERNEL) - struct callout_handle ipf_slow_ch; + struct callout ipf_slow_ch; #endif #if defined(linux) && defined(_KERNEL) struct timer_list ipf_timer; Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Sep 21 03:57:56 2013 (r255754) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Sep 21 04:05:38 2013 (r255755) @@ -178,11 +178,13 @@ ipf_timer_func(arg) ipf_slowtimer(softc); if (softc->ipf_running == -1 || softc->ipf_running == 1) { -#if FREEBSD_GE_REV(300000) +#if 0 softc->ipf_slow_ch = timeout(ipf_timer_func, softc, hz/2); -#else - timeout(ipf_timer_func, softc, hz/2); #endif + callout_init(&softc->ipf_slow_ch, CALLOUT_MPSAFE); + callout_reset(&softc->ipf_slow_ch, + (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, + ipf_timer_func, softc); } RWLOCK_EXIT(&softc->ipf_global); SPL_X(s); @@ -223,8 +225,13 @@ ipfattach(softc) ipid = 0; SPL_X(s); +#if 0 softc->ipf_slow_ch = timeout(ipf_timer_func, softc, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT); +#endif + callout_init(&softc->ipf_slow_ch, CALLOUT_MPSAFE); + callout_reset(&softc->ipf_slow_ch, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT, + ipf_timer_func, softc); return 0; } @@ -246,9 +253,12 @@ ipfdetach(softc) SPL_NET(s); +#if 0 if (softc->ipf_slow_ch.callout != NULL) untimeout(ipf_timer_func, softc, softc->ipf_slow_ch); bzero(&softc->ipf_slow, sizeof(softc->ipf_slow)); +#endif + callout_drain(&softc->ipf_slow_ch); #ifndef NETBSD_PF if (ipf_checkp != NULL)