From owner-svn-src-projects@FreeBSD.ORG Sun May 31 09:22:26 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 739FE1065673; Sun, 31 May 2009 09:22:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573728FC12; Sun, 31 May 2009 09:22:26 +0000 (UTC) (envelope-from rwatson@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 n4V9MQt4036902; Sun, 31 May 2009 09:22:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4V9MQbM036901; Sun, 31 May 2009 09:22:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200905310922.n4V9MQbM036901@svn.freebsd.org> From: Robert Watson Date: Sun, 31 May 2009 09:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193158 - projects/pnet/sys/net X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 09:22:26 -0000 Author: rwatson Date: Sun May 31 09:22:26 2009 New Revision: 193158 URL: http://svn.freebsd.org/changeset/base/193158 Log: Rename net.isr.direct_enable to net.isr.direct to match the name in use in the existing netisr framework. Add missing tunables for net.isr.direct and net.isr.direct_force. Add read-only net.isr.numthreads sysctl to easily query the number of threads in use on the current kernel. Fix a bug in which we used the registering protocol's version of the qlimit even if we've adjusted it due to defaults or limits. Modified: projects/pnet/sys/net/netisr.c Modified: projects/pnet/sys/net/netisr.c ============================================================================== --- projects/pnet/sys/net/netisr.c Sun May 31 09:03:14 2009 (r193157) +++ projects/pnet/sys/net/netisr.c Sun May 31 09:22:26 2009 (r193158) @@ -122,27 +122,29 @@ SYSCTL_NODE(_net, OID_AUTO, isr, CTLFLAG * Three direct dispatch policies are supported: * * - Always defer: all work is scheduled for a netisr, regardless of context. - * (!direct_enable) + * (!direct) * * - Hybrid: if the executing context allows direct dispatch, and we're * running on the CPU the work would be done on, then direct dispatch if it * wouldn't violate ordering constraints on the workstream. - * (direct_enable && !direct_force) + * (direct && !direct_force) * * - Always direct: if the executing context allows direct dispatch, always - * direct dispatch. (direct_enable && direct_force) + * direct dispatch. (direct && direct_force) * * Notice that changing the global policy could lead to short periods of * misordered processing, but this is considered acceptable as compared to * the complexity of enforcing ordering during policy changes. */ static int netisr_direct_force = 1; /* Always direct dispatch. */ +TUNABLE_INT("net.isr.direct_force", &netisr_direct_force); SYSCTL_INT(_net_isr, OID_AUTO, direct_force, CTLFLAG_RW, &netisr_direct_force, 0, "Force direct dispatch"); -static int netisr_direct_enable = 1; /* Enable direct dispatch. */ -SYSCTL_INT(_net_isr, OID_AUTO, direct_enable, CTLFLAG_RW, - &netisr_direct_enable, 0, "Enable direct dispatch"); +static int netisr_direct = 1; /* Enable direct dispatch. */ +TUNABLE_INT("net.isr.direct", &netisr_direct); +SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW, + &netisr_direct, 0, "Enable direct dispatch"); /* * Allow the administrator to limit the number of threads (CPUs) to use for @@ -270,6 +272,8 @@ static u_int nws_array[MAXCPU]; * CPUs once fully started. */ static u_int nws_count; +SYSCTL_INT(_net_isr, OID_AUTO, numthreads, CTLFLAG_RD, + &nws_count, 0, "Number of extant netisr threads."); /* * Per-workstream flags. @@ -388,7 +392,7 @@ netisr_register(const struct netisr_hand for (i = 0; i < MAXCPU; i++) { npwp = &nws[i].nws_work[proto]; bzero(npwp, sizeof(*npwp)); - npwp->nw_qlimit = nhp->nh_qlimit; + npwp->nw_qlimit = np[proto].np_qlimit; } NETISR_WUNLOCK(); } @@ -862,7 +866,7 @@ netisr_dispatch_src(u_int proto, uintptr /* * If direct dispatch is entirely disabled, fall back on queueing. */ - if (!netisr_direct_enable) + if (!netisr_direct) return (netisr_queue_src(proto, source, m)); KASSERT(proto < NETISR_MAXPROT,