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 "<m>" then
qca-nss-ecm is switched from built-in "<y>" to "<m>".
This commit is contained in:
Qosmio 2024-01-26 16:26:14 -05:00
parent 76469f3cba
commit 8b57fec8d7
2 changed files with 61 additions and 7 deletions

View File

@ -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

View File

@ -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;