netfilter: add a xt_FLOWOFFLOAD target for NAT/routing offload support

This makes it possible to add an iptables rule that offloads routing/NAT
packet processing to a software fast path. This fast path is much
quicker than running packets through the regular tables/chains.

Requires Linux 4.14

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau
2018-02-20 15:58:42 +01:00
parent 1033356442
commit 820f030998
4 changed files with 479 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ define KernelPackage/nf-flow
CONFIG_NETFILTER_INGRESS=y \
CONFIG_NF_FLOW_TABLE \
CONFIG_NF_FLOW_TABLE_HW
DEPENDS:=+kmod-nf-conntrack +kmod-nft-core @!LINUX_3_18 @!LINUX_4_4 @!LINUX_4_9
DEPENDS:=+kmod-nf-conntrack @!LINUX_3_18 @!LINUX_4_4 @!LINUX_4_9
FILES:= \
$(LINUX_DIR)/net/netfilter/nf_flow_table.ko \
$(LINUX_DIR)/net/netfilter/nf_flow_table_hw.ko
@@ -237,6 +237,17 @@ endef
$(eval $(call KernelPackage,ipt-filter))
define KernelPackage/ipt-offload
TITLE:=Netfilter routing/NAT offload support
KCONFIG:=CONFIG_NETFILTER_XT_TARGET_FLOWOFFLOAD
FILES:=$(foreach mod,$(IPT_FLOW-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_FLOW-m)))
$(call AddDepends/ipt,+kmod-nf-flow)
endef
$(eval $(call KernelPackage,ipt-offload))
define KernelPackage/ipt-ipopt
TITLE:=Modules for matching/changing IP packet options
KCONFIG:=$(KCONFIG_IPT_IPOPT)