From 8b57fec8d7722c5eae119d755dbe79257c36ee9d Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 26 Jan 2024 16:26:14 -0500 Subject: [PATCH] qca-nss-ecm: Reduce required dependancies No longer required to build with the following kernel modules: * ppp * pptp * pppoe * bonding * vxlan Instead, the dependancies will only be required if one of the nss-clients requireing it is needed. This reduces the number of modules needed at build time thus, a smaller overall build. Note: If any of the above are built as optional modules "" then qca-nss-ecm is switched from built-in "" to "". --- qca/qca-nss-ecm/Makefile | 26 ++++++++---- .../0012-ecm_add-check-for-pppoe.patch | 42 +++++++++++++++++++ 2 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 qca/qca-nss-ecm/patches/0012-ecm_add-check-for-pppoe.patch diff --git a/qca/qca-nss-ecm/Makefile b/qca/qca-nss-ecm/Makefile index 9d34d00..71e4809 100644 --- a/qca/qca-nss-ecm/Makefile +++ b/qca/qca-nss-ecm/Makefile @@ -11,6 +11,7 @@ PKG_MIRROR_HASH:=643895cb187cacfcde337c19dc5a34512acc225c0db1813a15cc1b66523835c PKG_BUILD_PARALLEL:=1 PKG_FLAGS:=nonshared +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk @@ -23,13 +24,15 @@ define KernelPackage/qca-nss-ecm +@NSS_DRV_IPV6_ENABLE \ +@NSS_DRV_VIRT_IF_ENABLE \ +@NSS_DRV_WIFI_ENABLE \ - +kmod-qca-nss-drv \ + +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \ +kmod-nf-conntrack \ - +kmod-ppp +kmod-pppoe +kmod-pptp +kmod-bonding \ - +PACKAGE_kmod-pppol2tp:kmod-pppol2tp \ +PACKAGE_kmod-qca-mcs:kmod-qca-mcs \ - +kmod-nat46 \ - +PACKAGE_kmod-vxlan:kmod-vxlan + +PACKAGE_kmod-bonding:kmod-bonding \ + +PACKAGE_kmod-vxlan:kmod-vxlan \ + +PACKAGE_kmod-nat46:kmod-nat46 \ + +PACKAGE_kmod-pppoe:kmod-pppoe \ + +PACKAGE_kmod-pppoe:kmod-pptp \ + +@(PACKAGE_kmod-pppoe):NSS_DRV_PPPOE_ENABLE TITLE:=QCA NSS Enhanced Connection Manager (ECM) FILES:=$(PKG_BUILD_DIR)/ecm.ko KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \ @@ -63,7 +66,6 @@ ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "qualcommax" "ipq60xx")) ECM_MAKE_OPTS+=ECM_FRONT_END_NSS_ENABLE=y \ ECM_FRONT_END_SFE_ENABLE=n \ ECM_NON_PORTED_SUPPORT_ENABLE=y \ - ECM_INTERFACE_BOND_ENABLE=y \ ECM_INTERFACE_VLAN_ENABLE=y \ ECM_CLASSIFIER_MARK_ENABLE=y \ ECM_CLASSIFIER_DSCP_ENABLE=y \ @@ -80,7 +82,7 @@ ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link),) ECM_MAKE_OPTS+=ECM_INTERFACE_OVPN_ENABLE=y endif -ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr),) +ifeq ($(CONFIG_PACKAGE_kmod-vxlan),y) ECM_MAKE_OPTS+=ECM_INTERFACE_VXLAN_ENABLE=y endif @@ -110,10 +112,16 @@ ifneq ($(CONFIG_PACKAGE_kmod-pppoe),) ECM_MAKE_OPTS+=ECM_INTERFACE_PPPOE_ENABLE=y \ ECM_INTERFACE_PPTP_ENABLE=y \ ECM_INTERFACE_PPP_ENABLE=y +else +ECM_MAKE_OPTS+=ECM_INTERFACE_PPPOE_ENABLE=n \ + ECM_INTERFACE_PPTP_ENABLE=n \ + ECM_INTERFACE_PPP_ENABLE=n endif ifneq ($(CONFIG_PACKAGE_kmod-pppol2tp),) ECM_MAKE_OPTS+=ECM_INTERFACE_L2TPV2_ENABLE=y +else +ECM_MAKE_OPTS+=ECM_INTERFACE_L2TPV2_ENABLE=n endif ifneq ($(CONFIG_PACKAGE_kmod-gre)$(CONFIG_PACKAGE_kmod-gre6),) @@ -133,6 +141,10 @@ ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mscs),) ECM_MAKE_OPTS+=ECM_CLASSIFIER_MSCS_ENABLE=y endif +ifneq ($(CONFIG_PACKAGE_kmod-bonding),) +ECM_MAKE_OPTS+=ECM_INTERFACE_BOND_ENABLE=y +endif + define Build/InstallDev mkdir -p $(1)/usr/include/qca-nss-ecm $(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-ecm diff --git a/qca/qca-nss-ecm/patches/0012-ecm_add-check-for-pppoe.patch b/qca/qca-nss-ecm/patches/0012-ecm_add-check-for-pppoe.patch new file mode 100644 index 0000000..fadff6a --- /dev/null +++ b/qca/qca-nss-ecm/patches/0012-ecm_add-check-for-pppoe.patch @@ -0,0 +1,42 @@ +--- a/frontends/include/ecm_front_end_common.h ++++ b/frontends/include/ecm_front_end_common.h +@@ -332,15 +332,19 @@ static inline bool ecm_front_end_ppppoe_ + fe_type = ecm_front_end_type_get(); + switch (fe_type) { + #ifdef ECM_FRONT_END_NSS_ENABLE ++#ifdef ECM_INTERFACE_PPPOE_ENABLE + case ECM_FRONT_END_TYPE_NSS: + ret = (nss_pppoe_get_br_accel_mode() == NSS_PPPOE_BR_ACCEL_MODE_DIS); + break; + #endif ++#endif + #ifdef ECM_FRONT_END_SFE_ENABLE ++#ifdef ECM_INTERFACE_PPPOE_ENABLE + case ECM_FRONT_END_TYPE_SFE: + ret = (sfe_pppoe_get_br_accel_mode() == SFE_PPPOE_BR_ACCEL_MODE_DISABLED); + break; + #endif ++#endif + default: + DEBUG_TRACE("front end type: %d\n", fe_type); + break; +@@ -362,15 +366,19 @@ static inline bool ecm_front_end_ppppoe_ + fe_type = ecm_front_end_type_get(); + switch (fe_type) { + #ifdef ECM_FRONT_END_NSS_ENABLE ++#ifdef ECM_INTERFACE_PPPOE_ENABLE + case ECM_FRONT_END_TYPE_NSS: + ret = (nss_pppoe_get_br_accel_mode() == NSS_PPPOE_BR_ACCEL_MODE_EN_3T); + break; + #endif ++#endif + #ifdef ECM_FRONT_END_SFE_ENABLE ++#ifdef ECM_INTERFACE_PPPOE_ENABLE + case ECM_FRONT_END_TYPE_SFE: + ret = (sfe_pppoe_get_br_accel_mode() == SFE_PPPOE_BR_ACCEL_MODE_EN_3T); + break; + #endif ++#endif + default: + DEBUG_WARN("front end type: %d is not supported\n", fe_type); + break;