From ddfd47b4361f0420c2269a6d86ca646d04a6387c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 5 Jul 2021 17:11:19 +0800 Subject: [PATCH] shortcut-fe: add simulated-driver --- .../fast-classifier/Makefile | 0 .../fast-classifier/src/Makefile | 0 .../fast-classifier/src/fast-classifier.c | 0 .../fast-classifier/src/fast-classifier.h | 0 .../fast-classifier/src/nl_classifier_test.c | 0 .../fast-classifier/src/userspace_example.c | 0 .../shortcut-fe/{ => shortcut-fe}/Makefile | 0 .../{ => shortcut-fe}/files/usr/bin/sfe_dump | 0 .../shortcut-fe/{ => shortcut-fe}/src/Kconfig | 0 .../{ => shortcut-fe}/src/Makefile | 0 .../shortcut-fe/{ => shortcut-fe}/src/sfe.h | 0 .../{ => shortcut-fe}/src/sfe_backport.h | 0 .../{ => shortcut-fe}/src/sfe_cm.c | 0 .../{ => shortcut-fe}/src/sfe_cm.h | 0 .../{ => shortcut-fe}/src/sfe_ipv4.c | 0 .../{ => shortcut-fe}/src/sfe_ipv6.c | 0 .../shortcut-fe/simulated-driver/Makefile | 57 +++++++++++++++++++ .../patches/200-nss-qdisc-support.patch | 11 ++++ 18 files changed, 68 insertions(+) rename package/lean/{ => shortcut-fe}/fast-classifier/Makefile (100%) rename package/lean/{ => shortcut-fe}/fast-classifier/src/Makefile (100%) rename package/lean/{ => shortcut-fe}/fast-classifier/src/fast-classifier.c (100%) rename package/lean/{ => shortcut-fe}/fast-classifier/src/fast-classifier.h (100%) rename package/lean/{ => shortcut-fe}/fast-classifier/src/nl_classifier_test.c (100%) rename package/lean/{ => shortcut-fe}/fast-classifier/src/userspace_example.c (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/Makefile (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/files/usr/bin/sfe_dump (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/Kconfig (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/Makefile (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/sfe.h (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/sfe_backport.h (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/sfe_cm.c (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/sfe_cm.h (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/sfe_ipv4.c (100%) rename package/lean/shortcut-fe/{ => shortcut-fe}/src/sfe_ipv6.c (100%) create mode 100644 package/lean/shortcut-fe/simulated-driver/Makefile create mode 100644 package/lean/shortcut-fe/simulated-driver/patches/200-nss-qdisc-support.patch diff --git a/package/lean/fast-classifier/Makefile b/package/lean/shortcut-fe/fast-classifier/Makefile similarity index 100% rename from package/lean/fast-classifier/Makefile rename to package/lean/shortcut-fe/fast-classifier/Makefile diff --git a/package/lean/fast-classifier/src/Makefile b/package/lean/shortcut-fe/fast-classifier/src/Makefile similarity index 100% rename from package/lean/fast-classifier/src/Makefile rename to package/lean/shortcut-fe/fast-classifier/src/Makefile diff --git a/package/lean/fast-classifier/src/fast-classifier.c b/package/lean/shortcut-fe/fast-classifier/src/fast-classifier.c similarity index 100% rename from package/lean/fast-classifier/src/fast-classifier.c rename to package/lean/shortcut-fe/fast-classifier/src/fast-classifier.c diff --git a/package/lean/fast-classifier/src/fast-classifier.h b/package/lean/shortcut-fe/fast-classifier/src/fast-classifier.h similarity index 100% rename from package/lean/fast-classifier/src/fast-classifier.h rename to package/lean/shortcut-fe/fast-classifier/src/fast-classifier.h diff --git a/package/lean/fast-classifier/src/nl_classifier_test.c b/package/lean/shortcut-fe/fast-classifier/src/nl_classifier_test.c similarity index 100% rename from package/lean/fast-classifier/src/nl_classifier_test.c rename to package/lean/shortcut-fe/fast-classifier/src/nl_classifier_test.c diff --git a/package/lean/fast-classifier/src/userspace_example.c b/package/lean/shortcut-fe/fast-classifier/src/userspace_example.c similarity index 100% rename from package/lean/fast-classifier/src/userspace_example.c rename to package/lean/shortcut-fe/fast-classifier/src/userspace_example.c diff --git a/package/lean/shortcut-fe/Makefile b/package/lean/shortcut-fe/shortcut-fe/Makefile similarity index 100% rename from package/lean/shortcut-fe/Makefile rename to package/lean/shortcut-fe/shortcut-fe/Makefile diff --git a/package/lean/shortcut-fe/files/usr/bin/sfe_dump b/package/lean/shortcut-fe/shortcut-fe/files/usr/bin/sfe_dump similarity index 100% rename from package/lean/shortcut-fe/files/usr/bin/sfe_dump rename to package/lean/shortcut-fe/shortcut-fe/files/usr/bin/sfe_dump diff --git a/package/lean/shortcut-fe/src/Kconfig b/package/lean/shortcut-fe/shortcut-fe/src/Kconfig similarity index 100% rename from package/lean/shortcut-fe/src/Kconfig rename to package/lean/shortcut-fe/shortcut-fe/src/Kconfig diff --git a/package/lean/shortcut-fe/src/Makefile b/package/lean/shortcut-fe/shortcut-fe/src/Makefile similarity index 100% rename from package/lean/shortcut-fe/src/Makefile rename to package/lean/shortcut-fe/shortcut-fe/src/Makefile diff --git a/package/lean/shortcut-fe/src/sfe.h b/package/lean/shortcut-fe/shortcut-fe/src/sfe.h similarity index 100% rename from package/lean/shortcut-fe/src/sfe.h rename to package/lean/shortcut-fe/shortcut-fe/src/sfe.h diff --git a/package/lean/shortcut-fe/src/sfe_backport.h b/package/lean/shortcut-fe/shortcut-fe/src/sfe_backport.h similarity index 100% rename from package/lean/shortcut-fe/src/sfe_backport.h rename to package/lean/shortcut-fe/shortcut-fe/src/sfe_backport.h diff --git a/package/lean/shortcut-fe/src/sfe_cm.c b/package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.c similarity index 100% rename from package/lean/shortcut-fe/src/sfe_cm.c rename to package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.c diff --git a/package/lean/shortcut-fe/src/sfe_cm.h b/package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.h similarity index 100% rename from package/lean/shortcut-fe/src/sfe_cm.h rename to package/lean/shortcut-fe/shortcut-fe/src/sfe_cm.h diff --git a/package/lean/shortcut-fe/src/sfe_ipv4.c b/package/lean/shortcut-fe/shortcut-fe/src/sfe_ipv4.c similarity index 100% rename from package/lean/shortcut-fe/src/sfe_ipv4.c rename to package/lean/shortcut-fe/shortcut-fe/src/sfe_ipv4.c diff --git a/package/lean/shortcut-fe/src/sfe_ipv6.c b/package/lean/shortcut-fe/shortcut-fe/src/sfe_ipv6.c similarity index 100% rename from package/lean/shortcut-fe/src/sfe_ipv6.c rename to package/lean/shortcut-fe/shortcut-fe/src/sfe_ipv6.c diff --git a/package/lean/shortcut-fe/simulated-driver/Makefile b/package/lean/shortcut-fe/simulated-driver/Makefile new file mode 100644 index 000000000..480a1e07b --- /dev/null +++ b/package/lean/shortcut-fe/simulated-driver/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (c) 2015 The Linux Foundation. All rights reserved. +# Permission to use, copy, modify, and/or distribute this software for +# any purpose with or without fee is hereby granted, provided that the +# above copyright notice and this permission notice appear in all copies. +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# 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:=shortcut-fe-simulated-driver +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/shortcut-fe +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=c7dd8173b178affc9d8da22f51610243be994e1c + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/shortcut-fe-drv + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Network Support + DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x +kmod-shortcut-fe + TITLE:=Simulated sfe driver for ECM + FILES:=$(PKG_BUILD_DIR)/simulated-driver/shortcut-fe-drv.ko + AUTOLOAD:=$(call AutoLoad,10,shortcut-fe-drv) +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. +endef + +EXTRA_CFLAGS+=-DSFE_SUPPORT_IPV6 + +define Build/Compile + $(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ + $(KERNEL_MAKE_FLAGS) \ + $(PKG_MAKE_FLAGS) \ + M="$(PKG_BUILD_DIR)/simulated-driver" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + modules +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/shortcut-fe + $(CP) -rf $(PKG_BUILD_DIR)/simulated-driver/sfe_drv.h $(1)/usr/include/shortcut-fe +endef + +$(eval $(call KernelPackage,shortcut-fe-drv)) diff --git a/package/lean/shortcut-fe/simulated-driver/patches/200-nss-qdisc-support.patch b/package/lean/shortcut-fe/simulated-driver/patches/200-nss-qdisc-support.patch new file mode 100644 index 000000000..638ad8a84 --- /dev/null +++ b/package/lean/shortcut-fe/simulated-driver/patches/200-nss-qdisc-support.patch @@ -0,0 +1,11 @@ +--- ./simulated-driver/sfe_drv.c.orig 2020-06-16 12:49:47.680153371 +0800 ++++ ./simulated-driver/sfe_drv.c 2020-06-16 12:50:18.540153371 +0800 +@@ -1167,7 +1167,7 @@ int sfe_drv_recv(struct sk_buff *skb) + * If ingress Qdisc configured, and packet not processed by ingress Qdisc yet + * We can not accelerate this packet. + */ +- if (dev->ingress_queue && !(skb->tc_verd & TC_NCLS)) { ++ if (dev->ingress_queue && !(skb->tc_verd_qca_nss & TC_NCLS)) { + return 0; + } + #endif