From owner-freebsd-net@FreeBSD.ORG Fri Nov 15 22:22:44 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 49CB6573; Fri, 15 Nov 2013 22:22:44 +0000 (UTC) Received: from co9outboundpool.messaging.microsoft.com (co9ehsobe003.messaging.microsoft.com [207.46.163.26]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1302228AB; Fri, 15 Nov 2013 22:22:43 +0000 (UTC) Received: from mail203-co9-R.bigfish.com (10.236.132.248) by CO9EHSOBE011.bigfish.com (10.236.130.74) with Microsoft SMTP Server id 14.1.225.22; Fri, 15 Nov 2013 21:52:21 +0000 Received: from mail203-co9 (localhost [127.0.0.1]) by mail203-co9-R.bigfish.com (Postfix) with ESMTP id 631148A0522; Fri, 15 Nov 2013 21:52:21 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.239.16; KIP:(null); UIP:(null); IPV:NLI; H:P-EMF02-SAC.jnpr.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzdb82hzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6hzz8275ch17326ah8275dh1de097h186068hz31h2a8h839h944hd24hd2bhf0ah1220h1288h12a5h12a9h12bdh137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h1fe8h1ff5h2218h2216h1155h) Received-SPF: softfail (mail203-co9: transitioning domain of juniper.net does not designate 66.129.239.16 as permitted sender) client-ip=66.129.239.16; envelope-from=stevek@juniper.net; helo=P-EMF02-SAC.jnpr.net ; SAC.jnpr.net ; Received: from mail203-co9 (localhost.localdomain [127.0.0.1]) by mail203-co9 (MessageSwitch) id 1384552339276585_4808; Fri, 15 Nov 2013 21:52:19 +0000 (UTC) Received: from CO9EHSMHS025.bigfish.com (unknown [10.236.132.249]) by mail203-co9.bigfish.com (Postfix) with ESMTP id 3E7B0580041; Fri, 15 Nov 2013 21:52:19 +0000 (UTC) Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by CO9EHSMHS025.bigfish.com (10.236.130.35) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 15 Nov 2013 21:52:19 +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; Fri, 15 Nov 2013 13:52:18 -0800 Date: Fri, 15 Nov 2013 16:52:10 -0500 From: Steve Kiernan To: Subject: [JNPR] Network stack as a module (RFC) Message-ID: <20131115165210.23f82578@stevek-ubuntu> In-Reply-To: <50F868FF.5060506@networx.ch> References: <50F868FF.5060506@networx.ch> 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: zec@freebsd.org, luigi@freebsd.org, marcel@freebsd.org 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: Fri, 15 Nov 2013 22:22:44 -0000 This is a follow up to the request sent back in January titled "Proposal for changes to network device drivers and network stack". In order to make it easier to review, we will be submitting pieces to be contributed in logical blocks. Please review the following patch and provide feedback: http://people.freebsd.org/~marcel/Juniper/201311/netstack-option.diff The details of this patch are as follows (and what is suggested for the commit log): Add a NETSTACK option to facilitate separating network stack pieces from the rest of the OS core. This is the first step towards having the network stack as a module. In order to be able to build without the NETSTACK option enabled, the following changes are also required and included with this commit: * Add 'optional netstack' to source files that should be considered part of the network stack, including drivers * Dynamically register the setfib syscall - this eliminates the need of an #Ifdef NETSTACK in kern/syscalls.master and will be necessary when the network stack is a module * Add #ifdef NETSTACK for the following sections of kernel: In linprocfs - the proc/net nodes In the Linuxulator - linux_ioctl_socket and callers In SVR4 compat layer - STREAMS support, socket ioctls, and networking related system calls (getmsg, putmsg, recv, send, sendto) In kern/sys_socket.c - interface/routing/protocol specific ioctls are no longer called in the default case when NETSTACK is not defined, return ENXIO in that case In kern/uipc_socket.c - SO_SETFIB socket option In kern/vfs_init.c - vfs_checkexp should not be set to vfs_stdcheckexp when NETSTACK is not defined In kern/vfs_mount.c - all export-related code In usb device driver - USB_HAVE_PF needs to be defined to 0 in the case of no NETSTACK option Please note that these NETSTACK checks above will end up being removed as pieces of the network stack as a module functionality are added. To verify building without the NETSTACK option, the LINT-NONETSTACK kernel has been added to makeLINT.mk -- Stephen J. Kiernan Juniper Networks, Inc. stevek_at_juniper.net