Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2013 16:52:10 -0500
From:      Steve Kiernan <stevek@juniper.net>
To:        <freebsd-net@freebsd.org>
Cc:        zec@freebsd.org, luigi@freebsd.org, marcel@freebsd.org
Subject:   [JNPR] Network stack as a module (RFC)
Message-ID:  <20131115165210.23f82578@stevek-ubuntu>
In-Reply-To: <50F868FF.5060506@networx.ch>
References:  <CC6EF6B2.1917A%anshukla@juniper.net> <f1d8693fa83965f0d4a485a2db7e603b@novexsolutions.com> <50F868FF.5060506@networx.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131115165210.23f82578>