2014-05-09 21:11:27 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# Options set in the build system that affect the kernel somehow.
|
|
|
|
|
|
|
|
#
|
|
|
|
# Define MK_* variables (which are either "yes" or "no") for users
|
|
|
|
# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
|
|
|
|
# make(1) environment.
|
|
|
|
# These should be tested with `== "no"' or `!= "no"' in makefiles.
|
|
|
|
# The NO_* variables should only be set by makefiles for variables
|
|
|
|
# that haven't been converted over.
|
|
|
|
#
|
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# Note: bsd.own.mk must be included before the rest of kern.opts.mk to make
|
|
|
|
# building on 10.x and earlier work. This should be removed when that's no
|
|
|
|
# longer supported since it confounds the defaults (since it uses the host's
|
|
|
|
# notion of defaults rather than what's default in current when building
|
|
|
|
# within sys/modules).
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2014-05-09 21:11:27 +00:00
|
|
|
# These options are used by the kernel build process (kern.mk and kmod.mk)
|
|
|
|
# They have to be listed here so we can build modules outside of the
|
|
|
|
# src tree.
|
|
|
|
|
|
|
|
__DEFAULT_YES_OPTIONS = \
|
2015-01-26 07:15:49 +00:00
|
|
|
AUTOFS \
|
2015-01-26 06:44:48 +00:00
|
|
|
BHYVE \
|
2014-08-11 14:50:49 +00:00
|
|
|
BLUETOOTH \
|
2015-01-25 04:52:48 +00:00
|
|
|
CCD \
|
2014-08-11 14:50:49 +00:00
|
|
|
CDDL \
|
|
|
|
CRYPT \
|
2015-01-25 05:13:15 +00:00
|
|
|
CUSE \
|
2014-05-10 00:42:43 +00:00
|
|
|
FORMAT_EXTENSIONS \
|
2014-08-04 22:37:02 +00:00
|
|
|
INET \
|
|
|
|
INET6 \
|
2014-08-11 14:50:49 +00:00
|
|
|
IPFILTER \
|
2017-02-06 08:49:57 +00:00
|
|
|
IPSEC_SUPPORT \
|
2015-01-25 04:20:11 +00:00
|
|
|
ISCSI \
|
2014-08-11 14:50:49 +00:00
|
|
|
KERNEL_SYMBOLS \
|
|
|
|
NETGRAPH \
|
|
|
|
PF \
|
|
|
|
SOURCELESS_HOST \
|
|
|
|
SOURCELESS_UCODE \
|
2017-05-09 05:03:35 +00:00
|
|
|
TESTS \
|
2014-08-11 14:50:49 +00:00
|
|
|
USB_GADGET_EXAMPLES \
|
|
|
|
ZFS
|
|
|
|
|
|
|
|
__DEFAULT_NO_OPTIONS = \
|
2016-06-10 19:06:11 +00:00
|
|
|
EXTRA_TCP_STACKS \
|
2014-08-11 14:50:49 +00:00
|
|
|
NAND \
|
2016-12-15 21:26:58 +00:00
|
|
|
OFED \
|
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
|
|
|
RATELIMIT \
|
2016-12-15 21:26:58 +00:00
|
|
|
REPRODUCIBLE_BUILD
|
2014-05-09 21:11:27 +00:00
|
|
|
|
2015-03-12 03:57:19 +00:00
|
|
|
# Some options are totally broken on some architectures. We disable
|
|
|
|
# them. If you need to enable them on an experimental basis, you
|
|
|
|
# must change this code.
|
2015-03-27 17:36:22 +00:00
|
|
|
# Note: These only apply to the list of modules we build by default
|
|
|
|
# and sometimes what is in the opt_*.h files by default.
|
|
|
|
# Kernel config files are unaffected, though some targets can be
|
|
|
|
# affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP.
|
2015-03-12 03:57:19 +00:00
|
|
|
|
|
|
|
# Things that don't work based on the CPU
|
|
|
|
.if ${MACHINE_CPUARCH} == "arm"
|
2015-11-20 16:18:27 +00:00
|
|
|
. if ${MACHINE_ARCH:Marmv6*} == ""
|
2016-03-21 23:32:13 +00:00
|
|
|
BROKEN_OPTIONS+= CDDL ZFS
|
2015-11-20 16:18:27 +00:00
|
|
|
. endif
|
2015-03-12 03:57:19 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MACHINE_CPUARCH} == "mips"
|
2016-10-12 13:51:41 +00:00
|
|
|
BROKEN_OPTIONS+= CDDL ZFS SSP
|
2015-03-12 03:57:19 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc"
|
|
|
|
BROKEN_OPTIONS+= ZFS
|
|
|
|
.endif
|
|
|
|
|
2017-04-12 10:40:30 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "riscv"
|
|
|
|
BROKEN_OPTIONS+= FORMAT_EXTENSIONS
|
|
|
|
.endif
|
|
|
|
|
2015-03-12 03:57:19 +00:00
|
|
|
# Things that don't work because the kernel doesn't have the support
|
|
|
|
# for them.
|
|
|
|
.if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
|
|
|
|
BROKEN_OPTIONS+= OFED
|
|
|
|
.endif
|
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# expanded inline from bsd.mkopt.mk to avoid share/mk dependency
|
2014-05-09 21:11:27 +00:00
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# Those that default to yes
|
2014-05-17 20:31:34 +00:00
|
|
|
.for var in ${__DEFAULT_YES_OPTIONS}
|
|
|
|
.if !defined(MK_${var})
|
|
|
|
.if defined(WITHOUT_${var}) # WITHOUT always wins
|
|
|
|
MK_${var}:= no
|
2014-05-11 23:22:32 +00:00
|
|
|
.else
|
2014-05-17 20:31:34 +00:00
|
|
|
MK_${var}:= yes
|
2014-05-11 23:22:32 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.else
|
|
|
|
.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
|
|
|
|
.error "Illegal value for MK_${var}: ${MK_${var}}"
|
2014-05-17 20:31:34 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.endif # !defined(MK_${var})
|
2014-05-17 20:31:34 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_YES_OPTIONS
|
2014-08-04 22:37:02 +00:00
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# Those that default to no
|
|
|
|
.for var in ${__DEFAULT_NO_OPTIONS}
|
|
|
|
.if !defined(MK_${var})
|
|
|
|
.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
|
|
|
|
MK_${var}:= yes
|
|
|
|
.else
|
|
|
|
MK_${var}:= no
|
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.else
|
|
|
|
.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
|
|
|
|
.error "Illegal value for MK_${var}: ${MK_${var}}"
|
2014-08-11 14:50:49 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.endif # !defined(MK_${var})
|
2014-08-11 14:50:49 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_NO_OPTIONS
|
|
|
|
|
2015-03-12 03:57:00 +00:00
|
|
|
#
|
|
|
|
# MK_* options which are always no, usually because they are
|
|
|
|
# unsupported/badly broken on this architecture.
|
|
|
|
#
|
|
|
|
.for var in ${BROKEN_OPTIONS}
|
|
|
|
MK_${var}:= no
|
|
|
|
.endfor
|
|
|
|
.undef BROKEN_OPTIONS
|
|
|
|
#end of bsd.mkopt.mk expanded inline.
|
|
|
|
|
2014-08-04 22:37:02 +00:00
|
|
|
#
|
|
|
|
# MK_*_SUPPORT options which default to "yes" unless their corresponding
|
|
|
|
# MK_* variable is set to "no".
|
|
|
|
#
|
|
|
|
.for var in \
|
|
|
|
INET \
|
|
|
|
INET6
|
|
|
|
.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
|
|
|
|
MK_${var}_SUPPORT:= no
|
|
|
|
.else
|
2014-11-14 21:10:45 +00:00
|
|
|
.if defined(KERNBUILDDIR) # See if there's an opt_foo.h
|
2016-03-12 22:21:02 +00:00
|
|
|
.if !defined(OPT_${var})
|
2014-11-14 21:10:45 +00:00
|
|
|
OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
|
2016-03-12 22:21:02 +00:00
|
|
|
.export OPT_${var}
|
|
|
|
.endif
|
2014-11-14 21:10:45 +00:00
|
|
|
.if ${OPT_${var}} == "" # nothing -> no
|
|
|
|
MK_${var}_SUPPORT:= no
|
|
|
|
.else
|
|
|
|
MK_${var}_SUPPORT:= yes
|
|
|
|
.endif
|
|
|
|
.else # otherwise, yes
|
2014-08-04 22:37:02 +00:00
|
|
|
MK_${var}_SUPPORT:= yes
|
|
|
|
.endif
|
2014-11-14 21:10:45 +00:00
|
|
|
.endif
|
2014-08-04 22:37:02 +00:00
|
|
|
.endfor
|
2016-05-27 17:40:29 +00:00
|
|
|
|
|
|
|
# Some modules only compile successfully if option FDT is set, due to #ifdef FDT
|
|
|
|
# wrapped around declarations. Module makefiles can optionally compile such
|
|
|
|
# things using .if !empty(OPT_FDT)
|
|
|
|
.if !defined(OPT_FDT) && defined(KERNBUILDDIR)
|
|
|
|
OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h
|
|
|
|
.export OPT_FDT
|
|
|
|
.endif
|