From owner-svn-src-all@FreeBSD.ORG Thu Mar 4 16:53:39 2010 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 3B2F51065675; Thu, 4 Mar 2010 16:53:39 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7638FC29; Thu, 4 Mar 2010 16:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o24GrcOr031863; Thu, 4 Mar 2010 16:53:39 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o24GrcHb031861; Thu, 4 Mar 2010 16:53:38 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003041653.o24GrcHb031861@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 4 Mar 2010 16:53:38 +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: r204714 - head/sys/netinet/ipfw 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: Thu, 04 Mar 2010 16:53:39 -0000 Author: luigi Date: Thu Mar 4 16:53:38 2010 New Revision: 204714 URL: http://svn.freebsd.org/changeset/base/204714 Log: use callout_drain() (outside the lock) when unloading the module. This prevents a potential deadlock. Submitted by: Francesco Magno Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Mar 4 16:52:26 2010 (r204713) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Mar 4 16:53:38 2010 (r204714) @@ -1690,8 +1690,8 @@ compute_space(struct dn_id *cmd, int *to * link, scheduler template, flowset * integrated in scheduler and header * for flowset list - * (NSI)*(dn_flow + dn_queue) all scheduler instance + one - * queue per instance + * (NSI)*(dn_flow) all scheduler instance (includes + * the queue instance) * - ipfw sched show * (NP/2)*(dn_link + dn_sch + dn_id + dn_fs) only half scheduler * link, scheduler template, flowset @@ -1708,11 +1708,13 @@ compute_space(struct dn_id *cmd, int *to default: return -1; /* XXX where do LINK and SCH differ ? */ + /* 'ipfw sched show' could list all queues associated to + * a scheduler. This feature for now is disabled + */ case DN_LINK: /* pipe show */ x = DN_C_LINK | DN_C_SCH | DN_C_FLOW; need += dn_cfg.schk_count * (sizeof(struct dn_fs) + profile_size) / 2; - need += dn_cfg.si_count * sizeof(struct dn_queue); need += dn_cfg.fsk_count * sizeof(uint32_t); break; case DN_SCH: /* sched show */ @@ -2072,11 +2074,12 @@ ip_dn_init(void) static void ip_dn_destroy(void) { + callout_drain(&dn_timeout); + DN_BH_WLOCK(); ip_dn_ctl_ptr = NULL; ip_dn_io_ptr = NULL; - callout_stop(&dn_timeout); dummynet_flush(); DN_BH_WUNLOCK(); taskqueue_drain(dn_tq, &dn_task);