From owner-freebsd-net@FreeBSD.ORG Wed Dec 2 00:08:06 2009 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08C4A1065676 for ; Wed, 2 Dec 2009 00:08:06 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outH.internet-mail-service.net (outh.internet-mail-service.net [216.240.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id E5DAA8FC20 for ; Wed, 2 Dec 2009 00:08:05 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 6EA8728BD3; Tue, 1 Dec 2009 16:08:05 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id C661C2D6018; Tue, 1 Dec 2009 16:08:04 -0800 (PST) Message-ID: <4B15AFE9.5070606@elischer.org> Date: Tue, 01 Dec 2009 16:08:09 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Brett Glass References: <200912011952.MAA12927@lariat.net> <4B1580E2.4080006@elischer.org> <200912012333.QAA16055@lariat.net> In-Reply-To: <200912012333.QAA16055@lariat.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: net@freebsd.org Subject: Re: Question regarding netgraph and threading 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: Wed, 02 Dec 2009 00:08:06 -0000 Brett Glass wrote: > At 01:47 PM 12/1/2009, Julian Elischer wrote: > >> well, not all work is done by that thread. It is the >> backup-doer-of-things, but many netgraph operations are done in the >> context of a caller such as teh user of a socket. > > In the case of a PPTP session, the data (ignoring the control session > for the moment) flows from the interface (as GRE packets) through PPP > (also implemented in netgraph) to an "ng" pseudo-interface, where it > enters the ordinary FreeBSD IP stack. There isn't a user process listening > on a socket anywhere in that path, so I assume that the netgraph > kernel thread has to handle all of the work of encryption, decryption, > handshaking, etc. Am I incorrect about this? I am concerned that the > performance of a single core will be the bottleneck. > in the netgraph code I see: /* Autoconfigure number of threads. */ if (numthreads <= 0) numthreads = mp_ncpus; and the default value of numthreads (it's a tunable) is 0 so you should have one netgraph thread per cpu. try top -HS