From owner-freebsd-net@FreeBSD.ORG Sat Mar 10 03:54:54 2007 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3540D16A401 for ; Sat, 10 Mar 2007 03:54:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0CF6F13C48D for ; Sat, 10 Mar 2007 03:54:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id ADFF846D66; Fri, 9 Mar 2007 22:54:53 -0500 (EST) Date: Sat, 10 Mar 2007 03:54:53 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Dave Baukus In-Reply-To: <45F08F1D.5080708@us.fujitsu.com> Message-ID: <20070310035135.B30274@fledge.watson.org> References: <45C0CA5D.5090903@incunabulum.net> <45E6BEE0.2050307@FreeBSD.org> <45E6C22D.7060200@freebsd.org> <45E6D70C.10104@FreeBSD.org> <45EEB086.3050409@FreeBSD.org> <45F03269.7050705@FreeBSD.org> <45F08F1D.5080708@us.fujitsu.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: net@freebsd.org Subject: Re: netisr_direct X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Mar 2007 03:54:54 -0000 University of Cambridge On Thu, 8 Mar 2007, Dave Baukus wrote: > What's the word on netisr_direct ? Do people typically enable this feature ? Direct dispatch is the default configuration for the network stack in FreeBSD 7.x. Many users have reported performance improvements, especially in high packets-per-second receive environments. However, some users have reported performance loss on some SMP systems with some workloads. Direct dispatch will generally significantly lower the overhead of in-bound packet processing in the network stack by avoiding context switches. It also introduces parallelism in the in-bound network layer processing path by allowing processing to occur in more than one thread at a time. However, you can see reduced parallelism in some environments as the ithread no longer run concurrently with the netisr. I would not use net.isr.direct in versions of FreeBSD before 6.1, but it should be pretty safe for 6.1 and later. Robert N M Watson Computer Laboratory University of Cambridge > > net/netisr.c: > static int netisr_direct = 0; > SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RW, > &netisr_direct, 0, "enable direct dispatch"); > TUNABLE_INT("net.isr.direct", &netisr_direct); > > > /* > * Do direct dispatch only for MPSAFE netisrs (and > * only when enabled). Note that when a netisr is > * marked MPSAFE we permit multiple concurrent instances > * to run. We guarantee only the order in which > * packets are processed for each "dispatch point" in > * the system (i.e. call to netisr_dispatch or > * netisr_queue). This insures ordering of packets > * from an interface but does not guarantee ordering > * between multiple places in the system (e.g. IP > * dispatched from interfaces vs. IP queued from IPSec). > */ > if (netisr_direct && (ni->ni_flags & NETISR_MPSAFE)) { > isrstat.isrs_directed++; > /* > * NB: We used to drain the queue before handling > * the packet but now do not. Doing so here will > * not preserve ordering so instead we fallback to > * guaranteeing order only from dispatch points > * in the system (see above). > */ > ni->ni_handler(m); > > -- > Dave Baukus > david.baukus@us.fujitsu.com > 972-479-2491 > > Fujitsu Network Communications > Richardson, Texas > USA > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >