FreeBSD src
Go to file
Andrey V. Elsukov 6d8fdfa9d5 Rework IP encapsulation handling code.
Currently it has several disadvantages:
- it uses single mutex to protect internal structures. It is used by
  data- and control- path, thus there are no parallelism at all.
- it uses single list to keep encap handlers for both INET and INET6
  families.
- struct encaptab keeps unneeded information (src, dst, masks, protosw),
  that isn't used by code in the source tree.
- matches are prioritized and when many tunneling interfaces are
  registered, encapcheck handler of each interface is invoked for each
  packet. The search takes O(n) for n interfaces. All this work is done
  with exclusive lock held.

What this patch includes:
- the datapath is converted to be lockless using epoch(9) KPI.
- struct encaptab now linked using CK_LIST.
- all unused fields removed from struct encaptab. Several new fields
  addedr: min_length is the minimum packet length, that encapsulation
  handler expects to see; exact_match is maximum number of bits, that
  can return an encapsulation handler, when it wants to consume a packet.
- IPv6 and IPv4 handlers are stored in separate lists;
- added new "encap_lookup_t" method, that will be used later. It is
  targeted to speedup lookup of needed interface, when gif(4)/gre(4) have
  many interfaces.
- the need to use protosw structure is eliminated. The only pr_input
  method was used from this structure, so I don't see the need to keep
  using it.
- encap_input_t method changed to avoid using mbuf tags to store softc
  pointer. Now it is passed directly trough encap_input_t method.
  encap_getarg() funtions is removed.
- all sockaddr structures and code that uses them removed. We don't have
  any code in the tree that uses them. All consumers use encap_attach_func()
  method, that relies on invoking of encapcheck() to determine the needed
  handler.
- introduced struct encap_config, it contains parameters of encap handler
  that is going to be registered by encap_attach() function.
- encap handlers are stored in lists ordered by exact_match value, thus
  handlers that need more bits to match will be checked first, and if
  encapcheck method returns exact_match value, the search will be stopped.
- all current consumers changed to use new KPI.

Reviewed by:	mmacy
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D15617
2018-06-05 20:51:01 +00:00
bin Update other man pages to match leap second reality 2018-06-01 22:37:59 +00:00
cddl dwatch(1): Update manual to reference actual release 2018-06-03 23:49:02 +00:00
contrib Re-apply r190640. 2018-05-31 09:11:21 +00:00
crypto Merge upstream patch to unbreak tunnel forwarding. 2018-05-16 14:04:39 +00:00
etc Move /sys symlink creating out of etc/Makefile. 2018-06-04 15:17:24 +00:00
gnu Use a script wrapper for <compress>grep 2018-04-25 13:23:58 +00:00
include Add time2posix and posix2time to time.h 2018-05-25 13:40:05 +00:00
kerberos5 various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
lib Don't build brk_test on platforms that don't support brk(). 2018-06-05 13:06:06 +00:00
libexec Make rtld use libc_nossp_pic.a. Remove SSP shims. 2018-05-09 10:30:56 +00:00
release switch amd64 memstick installer images to MBR 2018-05-29 15:06:13 +00:00
rescue Avoid referencing private lib names directly. 2017-11-10 07:53:02 +00:00
sbin dhclient(8): allow to supersede interface-mtu option 2018-05-31 19:36:24 +00:00
secure Upgrade to OpenSSH 7.7p1. 2018-05-11 13:22:43 +00:00
share Sort GCC warning flags and remove duplicates. 2018-06-04 16:21:18 +00:00
stand Make the v*printf() functions in libsa return int instead of void. 2018-06-05 17:18:10 +00:00
sys Rework IP encapsulation handling code. 2018-06-05 20:51:01 +00:00
targets Add kernel and userspace code to dump the firmware state of supported 2018-03-08 15:21:56 +00:00
tests audit(4): add tests for open(2) and openat(2) 2018-06-05 20:13:24 +00:00
tools makeroot.sh: allow duplicate entries even with -f <filelist> 2018-05-30 13:51:00 +00:00
usr.bin indent(1): fix buildworld after r334632 2018-06-04 21:21:55 +00:00
usr.sbin hwpmc: log name->pid, name->tid mappings 2018-06-05 04:26:40 +00:00
.arcconfig callsign isn't required anymore 2016-09-29 06:19:45 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.gitattributes .git*: add gitattributes and gitignore 2017-12-25 21:07:54 +00:00
.gitignore .git*: add gitattributes and gitignore 2017-12-25 21:07:54 +00:00
COPYRIGHT Remove 'All Rights Reserved' from the collection copyright and templates. 2018-05-09 02:02:49 +00:00
LOCKS
MAINTAINERS top(1): add myself as a MAINTAIENR 2018-05-21 05:00:19 +00:00
Makefile Restore arm, riscv, sparc64, and mips to UNIVERSE after r334128 2018-05-24 14:01:22 +00:00
Makefile.inc1 Handle -DNO_CLEAN builds across brk/sbrk rewrite in r334626 2018-06-05 18:27:09 +00:00
Makefile.libcompat libpmc/pmu: enable for i386 as well 2018-05-31 22:26:55 +00:00
Makefile.sys.inc AUTO_OBJ: For all top-level targets enforce using an OBJDIR. 2017-12-05 21:29:47 +00:00
ObsoleteFiles.inc Retire vxge(4). 2018-05-17 14:55:41 +00:00
README README: Reduce the textdump; describe the project 2018-05-23 04:09:01 +00:00
README.md README: Reduce the textdump; describe the project 2018-05-23 04:09:01 +00:00
UPDATING Note the need for a new kernel / userland for devinfo to work 2018-05-31 02:58:08 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory. This file was last revised on: FreeBSD

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information, including setting make(1) variables.

Source Roadmap:

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

stand		Boot loader sources.

sys		Kernel sources.

sys/<arch>/conf Kernel configuration file

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html