freebsd-skq/sys/conf
Hans Petter Selasky f3e7afe2d7 Implement kernel support for hardware rate limited sockets.
- Add RATELIMIT kernel configuration keyword which must be set to
enable the new functionality.

- Add support for hardware driven, Receive Side Scaling, RSS aware, rate
limited sendqueues and expose the functionality through the already
established SO_MAX_PACING_RATE setsockopt(). The API support rates in
the range from 1 to 4Gbytes/s which are suitable for regular TCP and
UDP streams. The setsockopt(2) manual page has been updated.

- Add rate limit function callback API to "struct ifnet" which supports
the following operations: if_snd_tag_alloc(), if_snd_tag_modify(),
if_snd_tag_query() and if_snd_tag_free().

- Add support to ifconfig to view, set and clear the IFCAP_TXRTLMT
flag, which tells if a network driver supports rate limiting or not.

- This patch also adds support for rate limiting through VLAN and LAGG
intermediate network devices.

- How rate limiting works:

1) The userspace application calls setsockopt() after accepting or
making a new connection to set the rate which is then stored in the
socket structure in the kernel. Later on when packets are transmitted
a check is made in the transmit path for rate changes. A rate change
implies a non-blocking ifp->if_snd_tag_alloc() call will be made to the
destination network interface, which then sets up a custom sendqueue
with the given rate limitation parameter. A "struct m_snd_tag" pointer is
returned which serves as a "snd_tag" hint in the m_pkthdr for the
subsequently transmitted mbufs.

2) When the network driver sees the "m->m_pkthdr.snd_tag" different
from NULL, it will move the packets into a designated rate limited sendqueue
given by the snd_tag pointer. It is up to the individual drivers how the rate
limited traffic will be rate limited.

3) Route changes are detected by the NIC drivers in the ifp->if_transmit()
routine when the ifnet pointer in the incoming snd_tag mismatches the
one of the network interface. The network adapter frees the mbuf and
returns EAGAIN which causes the ip_output() to release and clear the send
tag. Upon next ip_output() a new "snd_tag" will be tried allocated.

4) When the PCB is detached the custom sendqueue will be released by a
non-blocking ifp->if_snd_tag_free() call to the currently bound network
interface.

Reviewed by:		wblock (manpages), adrian, gallatin, scottl (network)
Differential Revision:	https://reviews.freebsd.org/D3687
Sponsored by:		Mellanox Technologies
MFC after:		3 months
2017-01-18 13:31:17 +00:00
..
config.mk Implement kernel support for hardware rate limited sockets. 2017-01-18 13:31:17 +00:00
dtb.mk Add missed updates for r301079 and r301084. 2016-05-31 23:12:43 +00:00
files Add sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c into sys/conf/files 2017-01-17 00:48:02 +00:00
files.amd64 sfxge(4): remove obsolete Wake-On-LAN support 2016-12-30 12:06:55 +00:00
files.arm Split the DesignWare HDMI-specific code from imx6_hdmi.c into a separate 2016-12-20 01:34:29 +00:00
files.arm64 Add an ACPI attachment to the existing ahci_generic driver. This is used 2017-01-10 10:56:33 +00:00
files.i386 [intelspi] Add SPI driver for Intel BayTrail SoC 2016-12-27 22:37:24 +00:00
files.mips Restore status quo: mips64 does not need subr_sfbuf.c 2016-12-30 17:12:41 +00:00
files.pc98 Merge i386 and amd64 variants of mp_watchdog.c into x86/, there is no 2016-08-03 13:51:53 +00:00
files.powerpc Merge i.MX and PowerPC SDHCI drivers 2016-11-02 00:57:04 +00:00
files.riscv o Remove operation in machine mode. 2016-08-10 12:41:36 +00:00
files.sparc64 simplify compile-time default keyboard map generation 2016-03-28 19:51:45 +00:00
kern.mk Support mips[*]hf variants in config files 2016-12-30 00:34:52 +00:00
kern.opts.mk Implement kernel support for hardware rate limited sockets. 2017-01-18 13:31:17 +00:00
kern.post.mk Use ${.OBJDIR} to refer to the kernel build object dir, instead of trying 2016-12-22 21:11:42 +00:00
kern.pre.mk Don't compute MPATH during install. 2017-01-17 21:12:21 +00:00
kmod_syms.awk
kmod.mk Always pass -m to ld for converting binary files to kernel ELF objects 2016-09-20 17:07:14 +00:00
ldscript.amd64 Use explicit 0x200000 instead of MAXPAGESIZE for the amd64 kernel physaddr 2016-11-25 18:57:14 +00:00
ldscript.arm remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.arm64 Explicitly include all .rodata.* sections in the kernel .rodata. This 2016-09-03 17:23:24 +00:00
ldscript.i386 remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.mips remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.mips.cfe remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.mips.mips64 remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.mips.octeon1 remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.powerpc remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.powerpc64 remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
ldscript.powerpcspe Create a new MACHINE_ARCH for Freescale PowerPC e500v2 2016-10-22 01:57:15 +00:00
ldscript.riscv o Remove operation in machine mode. 2016-08-10 12:41:36 +00:00
ldscript.sparc64 remove CONSTRUCTORS from kernel linker scripts 2016-07-28 13:54:46 +00:00
Makefile.amd64 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.arm Use MACHINE_ARCH rather than TARGET_ARCH which has no meaning outside 2016-10-20 20:12:34 +00:00
Makefile.arm64 Build changes that allow the modules on arm64. 2015-10-08 17:42:08 +00:00
Makefile.i386 Clang's 3.5 integrated assembler now handles these files correctly (it 2015-01-05 12:28:22 +00:00
Makefile.mips Compile trampoline with soft-float on MIPS, to match the rest of the kernel 2016-11-16 03:24:20 +00:00
Makefile.pc98 Fix kernel build ${MACHINE} path 2015-04-16 22:34:10 +00:00
Makefile.powerpc Create a new MACHINE_ARCH for Freescale PowerPC e500v2 2016-10-22 01:57:15 +00:00
Makefile.riscv Set dependencies for genassym.c. 2016-05-24 16:30:05 +00:00
Makefile.sparc64
makeLINT.mk Migrate e1000 to the IFLIB framework: 2017-01-10 03:23:22 +00:00
makeLINT.sed
newvers.sh newvers.sh: consider as modified SVN mixed revision and other cases 2016-12-19 17:31:34 +00:00
NOTES Implement kernel support for hardware rate limited sockets. 2017-01-18 13:31:17 +00:00
options Implement kernel support for hardware rate limited sockets. 2017-01-18 13:31:17 +00:00
options.amd64 Add kernel interfaces to call EFI Runtime Services. 2016-09-21 11:31:58 +00:00
options.arm Allwinner: Add A33 support 2017-01-04 03:35:39 +00:00
options.arm64 Make BRCM2837 port conform FreeBSD/ARM64 guidelines 2016-10-14 22:23:03 +00:00
options.i386 hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus 2016-04-15 02:20:18 +00:00
options.mips Support mips[*]hf variants in config files 2016-12-30 00:34:52 +00:00
options.pc98
options.powerpc Create a new MACHINE_ARCH for Freescale PowerPC e500v2 2016-10-22 01:57:15 +00:00
options.riscv Add full softfloat and hardfloat support for RISC-V. 2016-11-16 15:21:32 +00:00
options.sparc64
systags.sh
WITHOUT_SOURCELESS
WITHOUT_SOURCELESS_HOST
WITHOUT_SOURCELESS_UCODE rtwn(4), urtwn(4): merge common code, add support for 11ac devices. 2016-10-17 20:38:24 +00:00