From owner-freebsd-net@FreeBSD.ORG Mon Nov 18 19:35:22 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEFE0B1E; Mon, 18 Nov 2013 19:35:21 +0000 (UTC) Received: from db8outboundpool.messaging.microsoft.com (mail-db8lp0184.outbound.messaging.microsoft.com [213.199.154.184]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C1D6224E; Mon, 18 Nov 2013 19:35:20 +0000 (UTC) Received: from mail58-db8-R.bigfish.com (10.174.8.253) by DB8EHSOBE002.bigfish.com (10.174.4.65) with Microsoft SMTP Server id 14.1.225.22; Mon, 18 Nov 2013 19:35:18 +0000 Received: from mail58-db8 (localhost [127.0.0.1]) by mail58-db8-R.bigfish.com (Postfix) with ESMTP id D0DB2DA094A; Mon, 18 Nov 2013 19:35:18 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.239.11; KIP:(null); UIP:(null); IPV:NLI; H:P-EMF02-SAC.jnpr.net; RD:none; EFVD:NLI X-SpamScore: -2 X-BigFish: VPS-2(zz98dI1432Izz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6hzz8275ch1de098h17326ah8275dh1de097h186068hz31h2a8h839h944hd24hd2bhf0ah1220h1288h12a5h12a9h12bdh137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h1fe8h1ff5h2218h2216h1155h) Received-SPF: softfail (mail58-db8: transitioning domain of juniper.net does not designate 66.129.239.11 as permitted sender) client-ip=66.129.239.11; envelope-from=stevek@juniper.net; helo=P-EMF02-SAC.jnpr.net ; SAC.jnpr.net ; Received: from mail58-db8 (localhost.localdomain [127.0.0.1]) by mail58-db8 (MessageSwitch) id 1384803316669903_20514; Mon, 18 Nov 2013 19:35:16 +0000 (UTC) Received: from DB8EHSMHS032.bigfish.com (unknown [10.174.8.225]) by mail58-db8.bigfish.com (Postfix) with ESMTP id 9EA30480055; Mon, 18 Nov 2013 19:35:16 +0000 (UTC) Received: from P-EMF02-SAC.jnpr.net (66.129.239.11) by DB8EHSMHS032.bigfish.com (10.174.4.42) with Microsoft SMTP Server (TLS) id 14.16.227.3; Mon, 18 Nov 2013 19:35:14 +0000 Received: from stevek-ubuntu (172.25.4.212) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server id 14.3.146.0; Mon, 18 Nov 2013 11:35:12 -0800 Date: Mon, 18 Nov 2013 14:35:08 -0500 From: Steve Kiernan To: Gleb Smirnoff Subject: Re: [JNPR] Network stack as a module (RFC) Message-ID: <20131118143508.0253e663@stevek-ubuntu> In-Reply-To: <20131118164149.GV7577@glebius.int.ru> References: <50F868FF.5060506@networx.ch> <20131115165210.23f82578@stevek-ubuntu> <20131116084919.GF7577@glebius.int.ru> <1DAF9090-08DA-404B-B86B-57E5D124D70D@xcllnt.net> <20131118164149.GV7577@glebius.int.ru> Organization: Juniper Networks Inc. X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-OriginatorOrg: juniper.net X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: freebsd-net@freebsd.org, luigi@freebsd.org, Marcel Moolenaar , zec@freebsd.org, Marcel Moolenaar X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Nov 2013 19:35:22 -0000 On Mon, 18 Nov 2013 20:41:49 +0400 Gleb Smirnoff wrote: > Marcel, > > On Sun, Nov 17, 2013 at 10:10:15AM -0800, Marcel Moolenaar wrote: > M> > S> Add a NETSTACK option to facilitate separating network stack pieces from the > M> > S> rest of the OS core. This is the first step towards having the network stack > M> > S> as a module. > M> > > M> > You probably mean "having the network stack optional", since under module we > M> > usually mean loadable kernel module. > M> > M> Actually, we do mean module. At Juniper we have the FreeBSD stack > M> as a loadable module now. We also have the Juniper stack as a > M> loadable module. Depending on context, we can use the most > M> appropriate one. Yes, this implies that we also have a stable > M> interface between the NIC driver and the network stack itself. > M> We'll be contributing that as well... > M> > M> Note that assumptions in the finalization of setting up networking > M> limits the network stack from being loaded manually, not to mention > M> that unloading is an entirely different challenge. Nonetheless it's > M> very useful without all that and I think it will make it easier for > M> people to change the network stack or experiment with beta versions > M> this way. > > Have you measured the performance impact on the loadable stack? I > suppose many functions, that are now called directly, with loadable > stack will be called via functon pointers. No, only a small number of functions were needed to be methods in a netstack kobj in the current implementation that we have. And some of those may need to change, as they revolve around NFS exports. Currently, we have four (4) methods that are needed: socreate vfs_export vfs_setpublicfs vfs_stdcheckexp When one is not dealing with NFS exports, only the socreate method is of interest. It is called just before mac_socket_create() would be called in socreate(). See http://people.freebsd.org/~marcel/Juniper/netstack-v2.diff, which is the full patch set that had been previously sent out. Some things have changed a bit since then, but if you look for curnetstack usage in the patch, you should be able to see the places where netsack methods are called. -- Stephen J. Kiernan Juniper Networks, Inc. stevek_at_juniper.net