From owner-svn-src-all@FreeBSD.ORG Mon May 18 01:05:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B342106564A; Mon, 18 May 2009 01:05:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 486938FC19; Mon, 18 May 2009 01:05:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4I159ud044911; Mon, 18 May 2009 01:05:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4I159Cp044910; Mon, 18 May 2009 01:05:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200905180105.n4I159Cp044910@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 18 May 2009 01:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192278 - head/sys/contrib/altq/altq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 18 May 2009 01:05:10 -0000 Author: bz Date: Mon May 18 01:05:09 2009 New Revision: 192278 URL: http://svn.freebsd.org/changeset/base/192278 Log: tbr_timeout() is a timer driven function[1]. While the previous commit made LINT happy this does the proper looping over all vnets as we are only called `globally' and not once per vnet instance. Reported by: zec [1] Missed by: bz [1] in r192264 Reviewed by: zec Modified: head/sys/contrib/altq/altq/altq_subr.c Modified: head/sys/contrib/altq/altq/altq_subr.c ============================================================================== --- head/sys/contrib/altq/altq/altq_subr.c Mon May 18 01:00:11 2009 (r192277) +++ head/sys/contrib/altq/altq/altq_subr.c Mon May 18 01:05:09 2009 (r192278) @@ -454,7 +454,9 @@ static void tbr_timeout(arg) void *arg; { - INIT_VNET_NET(curvnet); +#if defined(__FreeBSD__) + VNET_ITERATOR_DECL(vnet_iter); +#endif struct ifnet *ifp; int active, s; @@ -466,16 +468,25 @@ tbr_timeout(arg) #endif #if defined(__FreeBSD__) && (__FreeBSD_version >= 500000) IFNET_RLOCK(); -#endif - for (ifp = TAILQ_FIRST(&V_ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) { - /* read from if_snd unlocked */ - if (!TBR_IS_ENABLED(&ifp->if_snd)) - continue; - active++; - if (!IFQ_IS_EMPTY(&ifp->if_snd) && ifp->if_start != NULL) - (*ifp->if_start)(ifp); - } + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + INIT_VNET_NET(vnet_iter); +#endif + for (ifp = TAILQ_FIRST(&V_ifnet); ifp; + ifp = TAILQ_NEXT(ifp, if_list)) { + /* read from if_snd unlocked */ + if (!TBR_IS_ENABLED(&ifp->if_snd)) + continue; + active++; + if (!IFQ_IS_EMPTY(&ifp->if_snd) && + ifp->if_start != NULL) + (*ifp->if_start)(ifp); + } #if defined(__FreeBSD__) && (__FreeBSD_version >= 500000) + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); IFNET_RUNLOCK(); #endif splx(s);