From fade5d6dcf15a30b04dcfe7bb022de6116d329ed Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:29:30 +0800 Subject: [PATCH] shortcut-fe-cm: fixes unknown symbol issues --- .../lean/shortcut-fe/fast-classifier/Makefile | 45 +++++++++---------- package/lean/shortcut-fe/shortcut-fe/Makefile | 19 +++++--- .../lean/shortcut-fe/shortcut-fe/src/sfe_cm.c | 6 +-- .../shortcut-fe/simulated-driver/Makefile | 12 ++--- 4 files changed, 42 insertions(+), 40 deletions(-) diff --git a/package/lean/shortcut-fe/fast-classifier/Makefile b/package/lean/shortcut-fe/fast-classifier/Makefile index 75fdb5d7b7f3a3..ccd659f20a916e 100644 --- a/package/lean/shortcut-fe/fast-classifier/Makefile +++ b/package/lean/shortcut-fe/fast-classifier/Makefile @@ -11,50 +11,50 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # - + include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=fast-classifier PKG_RELEASE:=1 -PKG_CONFIG_DEPENDS := CONFIG_IPV6 include $(INCLUDE_DIR)/package.mk -define KernelPackage/$(PKG_NAME)/Default +define KernelPackage/fast-classifier/Default SECTION:=kernel CATEGORY:=Kernel modules SUBMENU:=Network Support DEPENDS:=+kmod-ipt-conntrack +kmod-shortcut-fe TITLE:=Kernel driver for FAST Classifier FILES:=$(PKG_BUILD_DIR)/fast-classifier.ko - KCONFIG:=CONFIG_NF_CONNTRACK_EVENTS=y \ - CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \ - CONFIG_NF_CONNTRACK_MARK=y \ - CONFIG_XFRM=y + KCONFIG:= \ + CONFIG_NF_CONNTRACK_EVENTS=y \ + CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \ + CONFIG_NF_CONNTRACK_MARK=y \ + CONFIG_XFRM=y CONFLICTS:=kmod-shortcut-fe-drv kmod-shortcut-fe-cm endef -define KernelPackage/$(PKG_NAME) - $(call KernelPackage/$(PKG_NAME)/Default) +define KernelPackage/fast-classifier + $(call KernelPackage/fast-classifier/Default) endef -define KernelPackage/$(PKG_NAME)-noload - $(call KernelPackage/$(PKG_NAME)/Default) +define KernelPackage/fast-classifier-noload + $(call KernelPackage/fast-classifier/Default) endef -define KernelPackage/$(PKG_NAME)/Default/description +define KernelPackage/fast-classifier/Default/description FAST Classifier talks to SFE to make decisions about offloading connections endef -define KernelPackage/$(PKG_NAME)/description -$(call KernelPackage/$(PKG_NAME)/Default/description) +define KernelPackage/fast-classifier/description +$(call KernelPackage/fast-classifier/Default/description) endef -define KernelPackage/$(PKG_NAME)-noload/description -$(call KernelPackage/$(PKG_NAME)/Default/description) +define KernelPackage/fast-classifier-noload/description +$(call KernelPackage/fast-classifier/Default/description) -This package does not load $(PKG_NAME) at boot by default +This package does not load fast-classifier at boot by default endef define Package/fast-classifier-example @@ -67,18 +67,16 @@ Example user space program that communicates with fast classifier kernel module endef -SFE_MAKE_OPTS:=SFE_SUPPORT_IPV6=$(if $(CONFIG_IPV6),y,n) HAVE_ECM:=$(CONFIG_PACKAGE_kmod-qca-nss-ecm-premium)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-noload)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-premium-noload)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-standard) - define Build/Compile/kmod - +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" $(SFE_MAKE_OPTS) \ + +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ $(KERNEL_MAKE_FLAGS) \ $(PKG_MAKE_FLAGS) \ M="$(PKG_BUILD_DIR)" \ CONFIG_FAST_CLASSIFIER=m \ + EXTRA_CFLAGS+="-DSFE_SUPPORT_IPV6" \ $(if $(HAVE_ECM),EXTRA_CFLAGS+="-DCONFIG_SFE_ECM" CONFIG_SFE_ECM=y,) \ - EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ modules endef @@ -101,12 +99,11 @@ define Build/InstallDev $(CP) $(PKG_BUILD_DIR)/fast-classifier.h $(1)/usr/include/ endef - define Package/fast-classifier-example/install $(INSTALL_DIR) $(1)/sbin $(CP) $(PKG_BUILD_DIR)/userspace_fast_classifier $(1)/sbin/ endef -$(eval $(call KernelPackage,$(PKG_NAME))) -$(eval $(call KernelPackage,$(PKG_NAME)-noload)) +$(eval $(call KernelPackage,fast-classifier)) +#$(eval $(call KernelPackage,fast-classifier-noload)) #$(eval $(call BuildPackage,fast-classifier-example)) diff --git a/package/lean/shortcut-fe/shortcut-fe/Makefile b/package/lean/shortcut-fe/shortcut-fe/Makefile index f326e59c9cdfe9..842e6a8f6929d0 100644 --- a/package/lean/shortcut-fe/shortcut-fe/Makefile +++ b/package/lean/shortcut-fe/shortcut-fe/Makefile @@ -11,6 +11,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # + include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk @@ -23,10 +24,13 @@ define KernelPackage/shortcut-fe SECTION:=kernel CATEGORY:=Kernel modules SUBMENU:=Network Support - DEPENDS:=@IPV6 + DEPENDS:=@IPV6 +kmod-nf-conntrack TITLE:=Kernel driver for SFE - FILES:=$(PKG_BUILD_DIR)/shortcut-fe.ko $(if $(CONFIG_IPV6),$(PKG_BUILD_DIR)/shortcut-fe-ipv6.ko,) - KCONFIG:=CONFIG_NF_CONNTRACK_EVENTS=y \ + FILES:= \ + $(PKG_BUILD_DIR)/shortcut-fe.ko \ + $(PKG_BUILD_DIR)/shortcut-fe-ipv6.ko + KCONFIG:= \ + CONFIG_NF_CONNTRACK_EVENTS=y \ CONFIG_NF_CONNTRACK_TIMEOUT=y \ CONFIG_SHORTCUT_FE=y \ CONFIG_XFRM=y @@ -54,9 +58,10 @@ define KernelPackage/shortcut-fe-cm DEPENDS:=+kmod-ipt-conntrack +kmod-shortcut-fe TITLE:=Kernel driver for SFE FILES:=$(PKG_BUILD_DIR)/shortcut-fe-cm.ko - KCONFIG:=CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \ - CONFIG_NF_CONNTRACK_EVENTS=y \ - CONFIG_XFRM=y + KCONFIG:= \ + CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \ + CONFIG_NF_CONNTRACK_EVENTS=y \ + CONFIG_XFRM=y CONFLICTS:=kmod-shortcut-fe-drv endef @@ -69,7 +74,7 @@ define Build/Compile $(KERNEL_MAKE_FLAGS) \ $(PKG_MAKE_FLAGS) \ M="$(PKG_BUILD_DIR)" \ - $(if $(CONFIG_IPV6),EXTRA_CFLAGS+="-DSFE_SUPPORT_IPV6" SFE_SUPPORT_IPV6=y,) \ + EXTRA_CFLAGS+="-DSFE_SUPPORT_IPV6" SFE_SUPPORT_IPV6=y \ $(if $(HAVE_ECM),EXTRA_CFLAGS+="-DCONFIG_SFE_ECM" CONFIG_SFE_ECM=y,) \ modules endef diff --git a/package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.c b/package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.c index cf146fdb114380..d042c740e7bc37 100644 --- a/package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.c +++ b/package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.c @@ -305,11 +305,11 @@ static unsigned int sfe_cm_post_routing(struct sk_buff *skb, int is_v4) struct net_device *dest_dev; struct net_device *src_dev_tmp; struct net_device *dest_dev_tmp; - struct sk_buff *tmp_skb = NULL; struct net_device *src_br_dev = NULL; struct net_device *dest_br_dev = NULL; struct nf_conntrack_tuple orig_tuple; struct nf_conntrack_tuple reply_tuple; + struct sk_buff *tmp_skb = NULL; SFE_NF_CONN_ACCT(acct); /* @@ -527,7 +527,7 @@ static unsigned int sfe_cm_post_routing(struct sk_buff *skb, int is_v4) return NF_ACCEPT; } spin_unlock_bh(&ct->lock); - + /* * Somehow, SFE is not playing nice with IPSec traffic. * Do not accelerate for now. @@ -934,7 +934,7 @@ static void sfe_cm_sync_rule(struct sfe_connection_sync *sis) #else timeouts = nf_ct_timeout_lookup(ct); if (!timeouts) { - timeouts = udp_get_timeouts(nf_ct_net(ct)); + timeouts = nf_udp_pernet(nf_ct_net(ct))->timeouts; } spin_lock_bh(&ct->lock); diff --git a/package/lean/shortcut-fe/simulated-driver/Makefile b/package/lean/shortcut-fe/simulated-driver/Makefile index 1adeb943d76c90..ecf9c41bda8336 100644 --- a/package/lean/shortcut-fe/simulated-driver/Makefile +++ b/package/lean/shortcut-fe/simulated-driver/Makefile @@ -17,7 +17,6 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=shortcut-fe-simulated-driver PKG_RELEASE:=1 -PKG_CONFIG_DEPENDS := CONFIG_IPV6 PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/shortcut-fe PKG_SOURCE_PROTO:=git @@ -32,14 +31,16 @@ define KernelPackage/shortcut-fe-drv CATEGORY:=Kernel modules SUBMENU:=Network Support DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x +kmod-shortcut-fe - KCONFIG:=CONFIG_NET_CLS_ACT=y \ - CONFIG_XFRM=y + KCONFIG:= \ + CONFIG_NET_CLS_ACT=y \ + CONFIG_XFRM=y TITLE:=Simulated sfe driver for ECM FILES:=$(PKG_BUILD_DIR)/simulated-driver/shortcut-fe-drv.ko endef define KernelPackage/shortcut-fe-drv/Description -Simulated sfe driver which act as an adapter to convert message between a connection manager and the SFE core engine. +Simulated sfe driver which act as an adapter to convert message +between a connection manager and the SFE core engine. endef define Build/Compile @@ -47,8 +48,7 @@ define Build/Compile $(KERNEL_MAKE_FLAGS) \ $(PKG_MAKE_FLAGS) \ M="$(PKG_BUILD_DIR)/simulated-driver" \ - $(if $(CONFIG_IPV6),EXTRA_CFLAGS+="-DSFE_SUPPORT_IPV6" SFE_SUPPORT_IPV6=y,) \ - EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + EXTRA_CFLAGS="-DSFE_SUPPORT_IPV6" \ modules endef