ipq807x: add NSS ecm 64 support

This commit is contained in:
coolsnowwolf 2021-07-10 08:43:31 +08:00
parent 83f53db630
commit 25683fe038
32 changed files with 2875 additions and 7 deletions

View File

@ -128,7 +128,7 @@ define KernelPackage/mac80211
$(call KernelPackage/mac80211/Default)
TITLE:=Linux 802.11 Wireless Networking Stack
# +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
DEPENDS+= +kmod-cfg80211 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
DEPENDS+= +kmod-cfg80211 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv +PACKAGE_kmod-qca-nss-drv-64:kmod-qca-nss-drv-64
KCONFIG:=\
CONFIG_AVERAGE=y
FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
@ -139,7 +139,7 @@ endef
define KernelPackage/mac80211/config
if PACKAGE_kmod-mac80211
if PACKAGE_kmod-qca-nss-drv
if PACKAGE_kmod-qca-nss-drv||PACKAGE_kmod-qca-nss-drv-64
config PACKAGE_MAC80211_NSS_SUPPORT
bool "Enable NSS support for IPQ platform"
default y

View File

@ -33,7 +33,7 @@ define KernelPackage/qca-nss-cfi-cryptoapi
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64 \
+kmod-qca-nss-crypto +kmod-crypto-authenc @!LINUX_3_18
+kmod-qca-nss-crypto +kmod-crypto-authenc @LINUX_5_4
TITLE:=Kernel driver for NSS cfi
FILES:=$(PKG_BUILD_DIR)/$(CFI_CRYPTOAPI_DIR)/qca-nss-cfi-cryptoapi.ko
AUTOLOAD:=$(call AutoLoad,59,qca-nss-cfi-cryptoapi)

View File

@ -0,0 +1,59 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-nss-clients-64
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/cc-qrdk/oss/lklm/nss-clients
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-04-29
PKG_SOURCE_VERSION:=b93c72c1b72c591c2ddc2f0b24f0e2b457720118
PKG_MIRROR_HASH:=9fab23da994bfbac9a3cef32cdfec31a87a03ed415f36bc926da32b7b0934259
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/qca-nss-drv-pppoe-64
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=Kernel driver for NSS (connection manager) - PPPoE
DEPENDS:=@TARGET_ipq807x +kmod-qca-nss-drv-64 +kmod-ppp +kmod-pppoe
FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe)
endef
define KernelPackage/qca-nss-drv-pppoe-64/Description
Kernel modules for NSS connection manager - Support for PPPoE
endef
EXTRA_CFLAGS+= \
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
-I$(STAGING_DIR)/usr/include/qca-nss-crypto \
-I$(STAGING_DIR)/usr/include/qca-nss-cfi \
-I$(STAGING_DIR)/usr/include/qca-nss-gmac \
-I$(STAGING_DIR)/usr/include/qca-ssdk \
-I$(STAGING_DIR)/usr/include/qca-ssdk/fal \
-I$(STAGING_DIR)/usr/include/nat46
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe-64),)
NSS_CLIENTS_MAKE_OPTS+=pppoe=y
endif
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
SOC="ipq807x_64"
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
SOC="ipq60xx_64"
endif
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" $(strip $(NSS_CLIENTS_MAKE_OPTS)) \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
SoC=$(SOC) \
$(KERNEL_MAKE_FLAGS) \
modules
endef
$(eval $(call KernelPackage,qca-nss-drv-pppoe-64))

View File

@ -0,0 +1,214 @@
#!/bin/sh /etc/rc.common
#
# Copyright (c) 2018-2019, 2021 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.
NSS_IPSEC_LOG_FILE=/tmp/.nss_ipsec_log
NSS_IPSEC_LOG_STR_ECM="ECM_Loaded"
NSS_IPSEC_OL_FILE=/tmp/qca_nss_ipsec_ol
ecm_load () {
if [ ! -d /sys/module/ecm ]; then
/etc/init.d/qca-nss-ecm start
if [ -d /sys/module/ecm ]; then
echo ${NSS_IPSEC_LOG_STR_ECM} >> ${NSS_IPSEC_LOG_FILE}
fi
fi
}
ecm_unload () {
if [ -f /tmp/.nss_ipsec_log ]; then
str=`grep ${NSS_IPSEC_LOG_STR_ECM} ${NSS_IPSEC_LOG_FILE}`
if [[ $str == ${NSS_IPSEC_LOG_STR_ECM} ]]; then
/etc/init.d/qca-nss-ecm stop
`sed 's/${NSS_IPSEC_LOG_STR_ECM}/ /g' $NSS_IPSEC_LOG_FILE > $NSS_IPSEC_LOG_FILE`
fi
fi
}
ecm_disable() {
if [ ! -d /sys/module/ecm ]; then
return;
fi
echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop
echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop
echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all
sleep 2
}
ecm_enable() {
if [ ! -d /sys/module/ecm ]; then
return;
fi
echo 0 > /sys/kernel/debug/ecm/ecm_db/defunct_all
echo 0 > /sys/kernel/debug/ecm/front_end_ipv4_stop
echo 0 > /sys/kernel/debug/ecm/front_end_ipv6_stop
}
kernel_version_check_5_4() {
major_ver=$(uname -r | awk -F '.' '{print $1}')
minor_ver=$(uname -r | awk -F '.' '{print $2}')
if [ $major_ver -lt 5 ] || ([ $major_ver -eq 5 ] && [ $minor_ver -lt 4 ] ) ; then
return 1
else
return 0
fi
}
start_klips() {
if kernel_version_check_5_4
then
echo "Kernel 5.4 doesn't support klips stack."
return $?
fi
touch $NSS_IPSEC_OL_FILE
ecm_load
local kernel_version=$(uname -r)
insmod /lib/modules/${kernel_version}/qca-nss-ipsec-klips.ko
if [ "$?" -gt 0 ]; then
echo "Failed to load plugin. Please start ecm if not done already"
ecm_enable
rm $NSS_IPSEC_OL_FILE
return
fi
/etc/init.d/ipsec start
sleep 2
ipsec eroute
ecm_enable
}
stop_klips() {
if kernel_version_check_5_4
then
echo "Kernel 5.4 doesn't support klips stack."
return $?
fi
ecm_disable
/etc/init.d/ipsec stop
rmmod qca-nss-ipsec-klips
rm $NSS_IPSEC_OL_FILE
ecm_unload
}
start_xfrm() {
touch $NSS_IPSEC_OL_FILE
ecm_load
local kernel_version=$(uname -r)
# load all NETKEY modules first.
for mod in xfrm_ipcomp ipcomp xfrm6_tunnel ipcomp6 xfrm6_mode_tunnel xfrm6_mode_beet xfrm6_mode_ro \
xfrm6_mode_transport xfrm4_mode_transport xfrm4_mode_tunnel \
xfrm4_tunnel xfrm4_mode_beet esp4 esp6 ah4 ah6 af_key
do
insmod $mod 2> /dev/null
done
# Now load the xfrm plugin
insmod /lib/modules/${kernel_version}/qca-nss-ipsec-xfrm.ko
if [ "$?" -gt 0 ]; then
echo "Failed to load plugin. Please start ecm if not done already"
ecm_enable
rm $NSS_IPSEC_OL_FILE
return
fi
/etc/init.d/ipsec start
sleep 2
ecm_enable
}
stop_xfrm() {
ecm_disable
#Shutdown Pluto first. Then only plugin can be removed.
plutopid=/var/run/pluto/pluto.pid
if [ -f $plutopid ]; then
pid=`cat $plutopid`
if [ ! -z "$pid" ]; then
ipsec whack --shutdown | grep -v "002";
if [ -s $plutopid ]; then
echo "Attempt to shut Pluto down failed! Trying kill:"
kill $pid;
sleep 5;
fi
fi
rm -rf $plutopid
fi
ip xfrm state flush;
ip xfrm policy flush;
sleep 2
#Now we can remove the plugin
retries=5
while [ -d /sys/module/qca_nss_ipsec_xfrm ]
do
rmmod qca-nss-ipsec-xfrm
if [ "$?" -eq 0 ]; then
rm $NSS_IPSEC_OL_FILE
break
fi
if [ ${retries} -eq 0 ]; then
echo "Failed to unload qca-nss-ipsec-xfrm plugin!"
exit
fi
echo "XFRM plugin unload failed; retrying ${retries} times"
sleep 1
retries=`expr ${retries} - 1`
done
/etc/init.d/ipsec stop
ecm_unload
}
start() {
local protostack=`uci -q get ipsec.setup.protostack`
if [ "$protostack" = "klips" ]; then
start_klips
return $?
fi
start_xfrm
return $?
}
stop() {
local protostack=`uci -q get ipsec.setup.protostack`
if [ "$protostack" = "klips" ]; then
stop_klips
return $?
fi
stop_xfrm
return $?
}
restart() {
stop
start
}

View File

@ -0,0 +1,28 @@
#!/bin/sh /etc/rc.common
###########################################################################
# Copyright (c) 2019, 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.
###########################################################################
restart() {
rmmod act_nssmirred.ko
insmod act_nssmirred.ko
}
start() {
insmod act_nssmirred.ko
}
stop() {
rmmod act_nssmirred.ko
}

View File

@ -0,0 +1,69 @@
#!/bin/sh /etc/rc.common
###########################################################################
# Copyright (c) 2019, 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.
###########################################################################
ecm_disable() {
if [ ! -d /sys/module/ecm ]; then
return
fi
echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop
echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop
echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all
sleep 2
}
ecm_enable() {
if [ ! -d /sys/module/ecm ]; then
return
fi
echo 0 > /sys/kernel/debug/ecm/ecm_db/defunct_all
echo 0 > /sys/kernel/debug/ecm/front_end_ipv4_stop
echo 0 > /sys/kernel/debug/ecm/front_end_ipv6_stop
}
restart() {
ecm_disable
/etc/init.d/openvpn stop
rmmod qca-nss-ovpn-link
rmmod qca-nss-ovpn-mgr
insmod qca-nss-ovpn-mgr
insmod qca-nss-ovpn-link
if [ "$?" -gt 0 ]; then
echo "Failed to load plugin. Please start ecm if not done already"
ecm_enable
return
fi
ecm_enable
}
start() {
restart
}
stop() {
ecm_disable
/etc/init.d/openvpn stop
rmmod qca-nss-ovpn-link
rmmod qca-nss-ovpn-mgr
ecm_enable
}

View File

@ -0,0 +1,121 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-nss-drv-64
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-drv
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-04-26
PKG_SOURCE_VERSION:=1cf4bf81fd395f61648efeae78cdf1df60e954ff
PKG_MIRROR_HASH:=86b7455565d28a72da981099c67a89ea9e0ae3874a34be30959dcf48f5e2196c
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
NSS_CLIENTS_DIR:=$(TOPDIR)/qca/src/qca-nss-clients
define KernelPackage/qca-nss-drv-64
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
DEPENDS:=@(TARGET_ipq807x||TARGET_ipq60xx) +kmod-qca-nss-dp
TITLE:=Kernel driver for NSS (core driver)
FILES:=$(PKG_BUILD_DIR)/qca-nss-drv.ko
AUTOLOAD:=$(call AutoLoad,32,qca-nss-drv)
endef
define KernelPackage/qca-nss-drv-64/install
$(INSTALL_DIR) $(1)/lib/debug
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/sysctl.d
$(INSTALL_DIR) $(1)/etc/hotplug.d/firmware
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/qca-nss-drv.debug $(1)/lib/debug/qca-nss-drv
$(INSTALL_BIN) ./files/qca-nss-drv.init $(1)/etc/init.d/qca-nss-drv
$(INSTALL_BIN) ./files/qca-nss-drv.sysctl $(1)/etc/sysctl.d/qca-nss-drv.conf
$(INSTALL_BIN) ./files/qca-nss-drv.hotplug $(1)/etc/hotplug.d/firmware/10-qca-nss-fw
$(INSTALL_BIN) ./files/qca-nss-drv.conf $(1)/etc/config/nss
endef
define KernelPackage/qca-nss-drv-64/Description
This package contains a NSS driver for QCA chipset
endef
define Build/InstallDev
mkdir -p $(1)/usr/include/qca-nss-drv
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-drv/
endef
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac -I$(STAGING_DIR)/usr/include/qca-nss-dp -I$(STAGING_DIR)/usr/include/qca-ssdk
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "ipq807x" "ipq60xx"))
EXTRA_CFLAGS+= -DNSS_MEM_PROFILE_MEDIUM
LOW_MEM_PROFILE_MAKE_OPTS=y
endif
ifeq ($(CONFIG_KERNEL_SKB_FIXED_SIZE_2K),y)
EXTRA_CFLAGS+= -DNSS_SKB_FIXED_SIZE_2K
endif
DRV_MAKE_OPTS:=
ifeq ($(LOW_MEM_PROFILE_MAKE_OPTS),y)
DRV_MAKE_OPTS+=NSS_DRV_C2C_ENABLE=n \
NSS_DRV_CAPWAP_ENABLE=n \
NSS_DRV_CLMAP_ENABLE=n \
NSS_DRV_CRYPTO_ENABLE=n \
NSS_DRV_DTLS_ENABLE=n \
NSS_DRV_GRE_ENABLE=n \
NSS_DRV_GRE_REDIR_ENABLE=n \
NSS_DRV_GRE_TUNNEL_ENABLE=n \
NSS_DRV_IGS_ENABLE=n \
NSS_DRV_IPSEC_ENABLE=n \
NSS_DRV_LAG_ENABLE=n \
NSS_DRV_L2TP_ENABLE=n \
NSS_DRV_MAPT_ENABLE=n \
NSS_DRV_OAM_ENABLE=n \
NSS_DRV_PPTP_ENABLE=n \
NSS_DRV_PORTID_ENABLE=n \
NSS_DRV_PVXLAN_ENABLE=n \
NSS_DRV_QRFS_ENABLE=n \
NSS_DRV_QVPN_ENABLE=n \
NSS_DRV_RMNET_ENABLE=n \
NSS_DRV_SHAPER_ENABLE=n \
NSS_DRV_SJACK_ENABLE=n \
NSS_DRV_TLS_ENABLE=n \
NSS_DRV_TRUSTSEC_ENABLE=n \
NSS_DRV_TSTAMP_ENABLE=n \
NSS_DRV_TUN6RD_ENABLE=n \
NSS_DRV_TUNIPIP6_ENABLE=n \
NSS_DRV_VXLAN_ENABLE=n \
NSS_DRV_MATCH_ENABLE=n \
NSS_DRV_MIRROR_ENABLE=n
endif
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
SOC="ipq807x_64"
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
SOC="ipq60xx_64"
endif
define Build/Configure
$(LN) arch/nss_$(SOC).h $(PKG_BUILD_DIR)/exports/nss_arch.h
sed -i "s/define NSS_FW_VERSION_MAJOR.*/define NSS_FW_VERSION_MAJOR 11/" $(PKG_BUILD_DIR)/exports/nss_fw_version.h
sed -i "s/define NSS_FW_VERSION_MINOR.*/define NSS_FW_VERSION_MINOR 3/" $(PKG_BUILD_DIR)/exports/nss_fw_version.h
endef
define Build/Compile
+$(MAKE) -C "$(LINUX_DIR)" $(strip $(DRV_MAKE_OPTS)) \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC=$(SOC) \
$(KERNEL_MAKE_FLAGS) \
$(PKG_JOBS) \
modules
endef
$(eval $(call KernelPackage,qca-nss-drv-64))

View File

@ -0,0 +1,6 @@
config nss_firmware 'qca_nss_0'
config nss_firmware 'qca_nss_1'
config general
option enable_rps '1'

View File

@ -0,0 +1,26 @@
#!/bin/sh /sbin/sysdebug
#
# Copyright (c) 2015-2016, 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.
#
log cat /sys/kernel/debug/qca-nss-drv/stats/pppoe
log cat /sys/kernel/debug/qca-nss-drv/stats/n2h
log cat /sys/kernel/debug/qca-nss-drv/stats/ipv6
log cat /sys/kernel/debug/qca-nss-drv/stats/ipv4
log cat /sys/kernel/debug/qca-nss-drv/stats/gmac
log cat /sys/kernel/debug/qca-nss-drv/stats/drv
log cat /sys/kernel/debug/qca-nss-drv/stats/wifi
log cat /sys/kernel/debug/qca-nss-drv/stats/wifi_if
log cat /sys/kernel/debug/qca-nss-drv/stats/eth_rx

View File

@ -0,0 +1,70 @@
#!/bin/sh
#
# Copyright (c) 2015-2016, 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.
#
KERNEL=`uname -r`
case "${KERNEL}" in
3.4*)
select_or_load=load_nss_fw
;;
*)
select_or_load=select_nss_fw
;;
esac
load_nss_fw () {
ls -l $1 | awk ' { print $9,$5 } '> /dev/console
echo 1 > /sys/class/firmware/$DEVICENAME/loading
cat $1 > /sys/class/firmware/$DEVICENAME/data
echo 0 > /sys/class/firmware/$DEVICENAME/loading
}
select_nss_fw () {
rm -f /lib/firmware/$DEVICENAME
ln -s $1 /lib/firmware/$DEVICENAME
ls -l /lib/firmware/$DEVICENAME | awk ' { print $9,$5 } '> /dev/console
}
[ "$ACTION" != "add" ] && exit
# dev name for UCI, since it doesn't let you use . or -
SDEVNAME=$(echo ${DEVICENAME} | sed s/[.-]/_/g)
SELECTED_FW=$(uci get nss.${SDEVNAME}.firmware 2>/dev/null)
[ -e "${SELECTED_FW}" ] && {
$select_or_load ${SELECTED_FW}
exit
}
case $DEVICENAME in
qca-nss0* | qca-nss.0*)
if [ -e /lib/firmware/qca-nss0-enterprise.bin ] ; then
$select_or_load /lib/firmware/qca-nss0-enterprise.bin
else
$select_or_load /lib/firmware/qca-nss0-retail.bin
fi
exit
;;
qca-nss1* | qca-nss.1*)
if [ -e /lib/firmware/qca-nss1-enterprise.bin ] ; then
$select_or_load /lib/firmware/qca-nss1-enterprise.bin
else
$select_or_load /lib/firmware/qca-nss1-retail.bin
fi
exit
;;
esac

View File

@ -0,0 +1,50 @@
#!/bin/sh /etc/rc.common
#
# Copyright (c) 2015-2017, 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.
#
START=70
enable_rps() {
irq_nss_rps=`grep nss_queue1 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
for entry in $irq_nss_rps
do
echo 2 > /proc/irq/$entry/smp_affinity
done
irq_nss_rps=`grep nss_queue2 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
for entry in $irq_nss_rps
do
echo 4 > /proc/irq/$entry/smp_affinity
done
irq_nss_rps=`grep nss_queue3 /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`
for entry in $irq_nss_rps
do
echo 8 > /proc/irq/$entry/smp_affinity
done
# Enable NSS RPS
sysctl -w dev.nss.rps.enable=1 >/dev/null 2>/dev/null
}
start() {
local rps_enabled="$(uci_get nss @general[0] enable_rps)"
if [ "$rps_enabled" -eq 1 ]; then
enable_rps
fi
}

View File

@ -0,0 +1,4 @@
# Default Number of connection configuration
dev.nss.ipv4cfg.ipv4_conn=4096
dev.nss.ipv6cfg.ipv6_conn=4096

View File

@ -0,0 +1,25 @@
From 3885c752e12f74cad6c97888b797e5903ad1930d Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Thu, 13 May 2021 23:22:38 +0200
Subject: [PATCH] core: add 5.10 kernel to version check
NSS DRV has a kernel version check, so simply add
5.10 as supported.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
nss_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/nss_core.c
+++ b/nss_core.c
@@ -52,7 +52,8 @@
(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)))) || \
(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)))) || \
(((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)))) || \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0))))))
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)))) || \
+(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))))))
#error "Check skb recycle code in this file to match Linux version"
#endif

View File

@ -0,0 +1,164 @@
From b5e2a7167ca3df9fce34f0d7c05468d4f5597275 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Thu, 13 May 2021 23:33:18 +0200
Subject: [PATCH] nss-drv: replace ioremap_nocache() with ioremap()
ioremap_nocache() does not exist anymore.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
nss_hal/ipq50xx/nss_hal_pvt.c | 6 +++---
nss_hal/ipq60xx/nss_hal_pvt.c | 8 ++++----
nss_hal/ipq806x/nss_hal_pvt.c | 4 ++--
nss_hal/ipq807x/nss_hal_pvt.c | 6 +++---
nss_hal/nss_hal.c | 4 ++--
nss_meminfo.c | 2 +-
nss_ppe.c | 2 +-
7 files changed, 16 insertions(+), 16 deletions(-)
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
@@ -184,13 +184,13 @@ static struct nss_platform_data *__nss_h
npd->nphys = res_nphys.start;
npd->qgic_phys = res_qgic_phys.start;
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
if (!npd->nmap) {
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
goto out;
}
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
if (!npd->qgic_map) {
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
goto out;
@@ -348,7 +348,7 @@ static int __nss_hal_common_reset(struct
of_node_put(cmn);
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
if (!nss_misc_reset) {
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
return -EFAULT;
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
@@ -207,13 +207,13 @@ static struct nss_platform_data *__nss_h
npd->nphys = res_nphys.start;
npd->qgic_phys = res_qgic_phys.start;
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
if (!npd->nmap) {
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
goto out;
}
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
if (!npd->qgic_map) {
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
goto out;
@@ -433,13 +433,13 @@ static int __nss_hal_common_reset(struct
of_node_put(cmn);
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
if (!nss_misc_reset) {
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
return -EFAULT;
}
- nss_misc_reset_flag = ioremap_nocache(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag));
+ nss_misc_reset_flag = ioremap(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag));
if (!nss_misc_reset_flag) {
pr_err("%px: ioremap fail for nss_misc_reset_flag\n", nss_dev);
return -EFAULT;
--- a/nss_hal/ipq806x/nss_hal_pvt.c
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
@@ -458,7 +458,7 @@ static struct nss_platform_data *__nss_h
npd->nphys = res_nphys.start;
npd->vphys = res_vphys.start;
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
if (!npd->nmap) {
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
goto out;
@@ -711,7 +711,7 @@ static int __nss_hal_common_reset(struct
}
of_node_put(cmn);
- fpb_base = ioremap_nocache(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base));
+ fpb_base = ioremap(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base));
if (!fpb_base) {
pr_err("%px: ioremap fail for nss_fpb_base\n", nss_dev);
return -EFAULT;
--- a/nss_hal/ipq807x/nss_hal_pvt.c
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
@@ -234,7 +234,7 @@ static struct nss_platform_data *__nss_h
npd->vphys = res_vphys.start;
npd->qgic_phys = res_qgic_phys.start;
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
if (!npd->nmap) {
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
goto out;
@@ -247,7 +247,7 @@ static struct nss_platform_data *__nss_h
goto out;
}
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
if (!npd->qgic_map) {
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
goto out;
@@ -467,7 +467,7 @@ static int __nss_hal_common_reset(struct
}
of_node_put(cmn);
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
if (!nss_misc_reset) {
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
return -EFAULT;
--- a/nss_hal/nss_hal.c
+++ b/nss_hal/nss_hal.c
@@ -78,9 +78,9 @@ int nss_hal_firmware_load(struct nss_ctx
return rc;
}
- load_mem = ioremap_nocache(npd->load_addr, nss_fw->size);
+ load_mem = ioremap(npd->load_addr, nss_fw->size);
if (!load_mem) {
- nss_info_always("%px: ioremap_nocache failed: %x", nss_ctx, npd->load_addr);
+ nss_info_always("%px: ioremap failed: %x", nss_ctx, npd->load_addr);
release_firmware(nss_fw);
return rc;
}
--- a/nss_meminfo.c
+++ b/nss_meminfo.c
@@ -728,7 +728,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
/*
* meminfo_start is the label where the start address of meminfo map is stored.
*/
- meminfo_start = (uint32_t *)ioremap_nocache(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET,
+ meminfo_start = (uint32_t *)ioremap(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET,
NSS_MEMINFO_RESERVE_AREA_SIZE);
if (!meminfo_start) {
nss_info_always("%px: cannot remap meminfo start\n", nss_ctx);
--- a/nss_ppe.c
+++ b/nss_ppe.c
@@ -357,7 +357,7 @@ void nss_ppe_init(void)
/*
* Get the PPE base address
*/
- ppe_pvt.ppe_base = ioremap_nocache(PPE_BASE_ADDR, PPE_REG_SIZE);
+ ppe_pvt.ppe_base = ioremap(PPE_BASE_ADDR, PPE_REG_SIZE);
if (!ppe_pvt.ppe_base) {
nss_warning("DRV can't get PPE base address\n");
return;

View File

@ -0,0 +1,49 @@
From 62e457f262aaa0db7113ad3ccbcb7ae49d4d7ea8 Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Tue, 8 Jun 2021 23:24:43 +0200
Subject: [PATCH] DMA: Fix NULL pointer exceptions
There are multiple instances that pass NULL instead
of device to DMA functions.
That is incorrect and will cause kernel NULL pointer
exceptions.
So, simply pass the device structure pointers.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
nss_core.c | 2 +-
nss_coredump.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
--- a/nss_core.c
+++ b/nss_core.c
@@ -1617,7 +1617,7 @@ static int32_t nss_core_handle_cause_que
*
*/
if (unlikely((buffer_type == N2H_BUFFER_CRYPTO_RESP))) {
- dma_unmap_single(NULL, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_FROM_DEVICE);
+ dma_unmap_single(nss_ctx->dev, (desc->buffer + desc->payload_offs), desc->payload_len, DMA_FROM_DEVICE);
goto consume;
}
--- a/nss_coredump.c
+++ b/nss_coredump.c
@@ -154,7 +154,7 @@ void nss_fw_coredump_notify(struct nss_c
dma_addr = nss_own->meminfo_ctx.logbuffer_dma;
}
- dma_sync_single_for_cpu(NULL, dma_addr, sizeof(struct nss_log_descriptor), DMA_FROM_DEVICE);
+ dma_sync_single_for_cpu(nss_own->dev, dma_addr, sizeof(struct nss_log_descriptor), DMA_FROM_DEVICE);
/*
* If the current entry is smaller than or equal to the number of NSS_LOG_COREDUMP_LINE_NUM,
@@ -181,7 +181,7 @@ void nss_fw_coredump_notify(struct nss_c
offset = (index * sizeof(struct nss_log_entry))
+ offsetof(struct nss_log_descriptor, log_ring_buffer);
- dma_sync_single_for_cpu(NULL, dma_addr + offset,
+ dma_sync_single_for_cpu(nss_own->dev, dma_addr + offset,
sizeof(struct nss_log_entry), DMA_FROM_DEVICE);
nss_info_always("%px: %s\n", nss_own, nle_print->message);
nle_print++;

View File

@ -0,0 +1,344 @@
From d0bffc800a50305315a0d7cf37140291ef5b1b61 Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Thu, 27 May 2021 03:52:47 +0200
Subject: [PATCH] treewide: hack support for mismatched firmware
Make new qsdk feature configurable to support old half compatible
firmware.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
exports/nss_fw_version.h | 11 +++++++++++
exports/nss_ipv4.h | 8 ++++++++
exports/nss_ipv6.h | 7 +++++++
exports/nss_wifi_vdev.h | 14 ++++++++++++++
exports/nss_wifili_if.h | 8 ++++++++
nss_ipv4_stats.c | 2 ++
nss_ipv4_strings.c | 2 ++
nss_ipv6_stats.c | 2 ++
nss_ipv6_strings.c | 2 ++
9 files changed, 56 insertions(+)
create mode 100644 exports/nss_fw_version.h
diff --git a/exports/nss_fw_version.h b/exports/nss_fw_version.h
new file mode 100644
index 0000000..895d523
--- /dev/null
+++ b/exports/nss_fw_version.h
@@ -0,0 +1,11 @@
+#ifndef __NSS_FW_VERSION_H
+#define __NSS_FW_VERSION_H
+
+#define NSS_FW_VERSION_MAJOR 11
+#define NSS_FW_VERSION_MINOR 4
+
+#define NSS_FW_VERSION(a,b) (((a) << 8) + (b))
+
+#define NSS_FW_VERSION_CODE NSS_FW_VERSION(NSS_FW_VERSION_MAJOR, NSS_FW_VERSION_MINOR)
+
+#endif /* __NSS_FW_VERSION_H */
\ No newline at end of file
diff --git a/exports/nss_ipv4.h b/exports/nss_ipv4.h
index ee3a552..25c4d82 100644
--- a/exports/nss_ipv4.h
+++ b/exports/nss_ipv4.h
@@ -26,6 +26,8 @@
#include "nss_stats_public.h"
#endif
+#include "nss_fw_version.h"
+
/**
* @addtogroup nss_ipv4_subsystem
* @{
@@ -216,12 +218,14 @@ enum nss_ipv4_stats_types {
/**< Number of IPv4 multicast connection destroy requests that missed the cache. */
NSS_IPV4_STATS_MC_CONNECTION_FLUSHES,
/**< Number of IPv4 multicast connection flushes. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM,
/**< Number of IPv4 mirror connection requests with an invalid interface number. */
NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE,
/**< Number of IPv4 mirror connection requests with an invalid interface type. */
NSS_IPV4_STATS_MIRROR_FAILURES,
/**< Number of IPv4 mirror failures. */
+#endif
NSS_IPV4_STATS_MAX,
/**< Maximum message type. */
};
@@ -609,8 +613,10 @@ struct nss_ipv4_rule_create_msg {
/**< Ingress shaping related accleration parameters. */
struct nss_ipv4_identifier_rule identifier;
/**< Rule for adding identifier. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
struct nss_ipv4_mirror_rule mirror_rule;
/**< Mirror rule parameter. */
+#endif
};
/**
@@ -955,6 +961,7 @@ struct nss_ipv4_node_sync {
uint32_t ipv4_mc_connection_flushes;
/**< Number of multicast connection flushes. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
uint32_t ipv4_connection_create_invalid_mirror_ifnum;
/**< Number of create request failed with an invalid mirror interface number. */
@@ -963,6 +970,7 @@ struct nss_ipv4_node_sync {
uint32_t ipv4_mirror_failures;
/**< Mirror packet failed. */
+#endif
uint32_t exception_events[NSS_IPV4_EXCEPTION_EVENT_MAX];
/**< Number of exception events. */
diff --git a/exports/nss_ipv6.h b/exports/nss_ipv6.h
index 930e74c..a21f939 100644
--- a/exports/nss_ipv6.h
+++ b/exports/nss_ipv6.h
@@ -195,6 +195,8 @@ enum nss_ipv6_stats_types {
/**< Number of IPv6 multicast connection destroy requests that missed the cache. */
NSS_IPV6_STATS_MC_CONNECTION_FLUSHES,
/**< Number of IPv6 multicast connection flushes. */
+
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM,
/**< Number of IPv6 mirror connection requests with an invalid interface number. */
NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE,
@@ -202,6 +204,7 @@ enum nss_ipv6_stats_types {
NSS_IPV6_STATS_MIRROR_FAILURES,
/**< Number of IPv6 mirror failures. */
+#endif
NSS_IPV6_STATS_MAX,
/**< Maximum message type. */
@@ -702,8 +705,10 @@ struct nss_ipv6_rule_create_msg {
/**< Ingress shaping related accleration parameters. */
struct nss_ipv6_identifier_rule identifier;
/**< Rule for adding identifier. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
struct nss_ipv6_mirror_rule mirror_rule;
/**< Mirror rule parameter. */
+#endif
};
/**
@@ -950,6 +955,7 @@ struct nss_ipv6_node_sync {
uint32_t ipv6_mc_connection_flushes;
/**< Number of multicast connection flushes. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
uint32_t ipv6_connection_create_invalid_mirror_ifnum;
/**< Number of create request failed with an invalid mirror interface number. */
@@ -958,6 +964,7 @@ struct nss_ipv6_node_sync {
uint32_t ipv6_mirror_failures;
/**< Mirror packet failed. */
+#endif
uint32_t exception_events[NSS_IPV6_EXCEPTION_EVENT_MAX];
/**< Number of exception events. */
diff --git a/exports/nss_wifi_vdev.h b/exports/nss_wifi_vdev.h
index 1b52f66..da91b56 100644
--- a/exports/nss_wifi_vdev.h
+++ b/exports/nss_wifi_vdev.h
@@ -74,8 +74,10 @@ enum nss_wifi_vdev_msg_types {
NSS_WIFI_VDEV_INTERFACE_RECOVERY_RESET_MSG,
NSS_WIFI_VDEV_INTERFACE_RECOVERY_RECONF_MSG,
NSS_WIFI_VDEV_SET_GROUP_KEY,
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
NSS_WIFI_VDEV_HMMC_MEMBER_ADD_MSG,
NSS_WIFI_VDEV_HMMC_MEMBER_DEL_MSG,
+#endif
NSS_WIFI_VDEV_MAX_MSG
};
@@ -130,6 +132,7 @@ enum nss_wifi_vdev_err_types {
NSS_WIFI_VDEV_VLAN_MODE_CONFIG_FAIL,
NSS_WIFI_VDEV_RECOVERY_RESET_FAIL,
NSS_WIFI_VDEV_RECOVERY_RECONF_FAIL,
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
NSS_WIFI_VDEV_CONFIG_GROUP_KEY_FAIL,
NSS_WIFI_VDEV_MULTIPASS_NOT_ENABLED,
NSS_WIFI_VDEV_ALLOC_VLAN_MAP_FAILED,
@@ -139,6 +142,7 @@ enum nss_wifi_vdev_err_types {
NSS_WIFI_VDEV_PPE_PORT_DESTROY_FAIL,
NSS_WIFI_VDEV_PPE_VSI_ASSIGN_FAIL,
NSS_WIFI_VDEV_PPE_VSI_UNASSIGN_FAIL,
+#endif
NSS_WIFI_VDEV_EINV_MAX_CFG
};
@@ -161,11 +165,13 @@ enum nss_wifi_vdev_ext_data_pkt_type {
NSS_WIFI_VDEV_EXT_TX_COMPL_PKT_TYPE = 11, /**< Tx completion. */
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_WDS_LEARN = 12, /**< WDS source port learning command. */
NSS_WIFI_VDEV_EXT_DATA_PPDU_INFO = 13, /**< PPDU metadata information. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MCBC_RX = 14, /**< Multicast/broadcast packet received. */
NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_SPL_PACKET = 15,
/**< Mesh link VAP special packet. */
NSS_WIFI_VDEV_MESH_EXT_DATA_PKT_TYPE_RX_MCAST_EXC = 16,
/**< Mesh link VAP multicast packet. */
+#endif
NSS_WIFI_VDEV_EXT_DATA_PKT_TYPE_MAX
};
@@ -201,9 +207,11 @@ enum nss_wifi_vdev_cmd {
NSS_WIFI_VDEV_ENABLE_IGMP_ME_CMD, /**< Configuration to set IGMP multicast enhancement on VAP. */
NSS_WIFI_VDEV_CFG_WDS_BACKHAUL_CMD,
/**< Configuration to set WDS backhaul extension on VAP. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
NSS_WIFI_VDEV_CFG_MCBC_EXC_TO_HOST_CMD, /**< Configuration to set multicast/broadcast exception to host on VAP. */
NSS_WIFI_VDEV_CFG_PEER_AUTHORIZE_CMD,
/**< Configuration to enable peer authorization on VAP. */
+#endif
NSS_WIFI_VDEV_MAX_CMD
};
@@ -271,7 +279,9 @@ struct nss_wifi_vdev_config_msg {
uint8_t is_nss_qwrap_en; /**< VAP is configured for NSS firmware QWRAP logic. */
uint8_t tx_per_pkt_vdev_id_check; /**< Transmit per-packet virtual device ID check. */
uint8_t align_pad; /**< Reserved field. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
uint32_t vap_ext_mode; /**< Different VAP extended modes. */
+#endif
};
/**
@@ -1037,8 +1047,10 @@ struct nss_wifi_vdev_stats_sync_msg {
uint32_t rx_mcast_bytes; /**< Receive multicast bytes count. */
uint32_t rx_decrypt_err; /**< Receive decryption error */
uint32_t rx_mic_err; /**< Receive MIC error */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
uint32_t mcbc_exc_host_fail_cnt;
/**< Number of multicast/broadcast packets failed to send to host through exception path. */
+#endif
};
/**
@@ -1070,6 +1082,7 @@ struct nss_wifi_vdev_msg {
/**< Updates a snooplist group member. */
struct nss_wifi_vdev_me_snptbl_deny_grp_add_msg vdev_deny_member_add;
/**< Add a snooplist member to the deny list. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
struct nss_wifi_vdev_me_hmmc_add_msg vdev_hmmc_member_add;
/**< Adds a new member into the HMMC list. */
struct nss_wifi_vdev_me_hmmc_del_msg vdev_hmmc_member_del;
@@ -1078,6 +1091,7 @@ struct nss_wifi_vdev_msg {
/**< Adds a new member into the deny list. */
struct nss_wifi_vdev_me_deny_ip_del_msg vdev_deny_list_member_del;
/**< Delete a member from the deny list. */
+#endif
struct nss_wifi_vdev_txmsg vdev_txmsgext;
/**< Transmits special data. */
struct nss_wifi_vdev_vow_dbg_cfg_msg vdev_vow_dbg_cfg;
diff --git a/exports/nss_wifili_if.h b/exports/nss_wifili_if.h
index fce20fd..1f26d67 100644
--- a/exports/nss_wifili_if.h
+++ b/exports/nss_wifili_if.h
@@ -62,8 +62,12 @@
/**< Maximum number of bandwidth supported. */
#define NSS_WIFILI_REPT_MU_MIMO 1
#define NSS_WIFILI_REPT_MU_OFDMA_MIMO 3
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
+#define NSS_WIFILI_MAX_RESERVED_TYPE 3
+#else
#define NSS_WIFILI_MAX_RESERVED_TYPE 2
/**< Maximum reserved type. */
+#endif
#define NSS_WIFILI_SOC_PER_PACKET_METADATA_SIZE 60
/**< Metadata area total size. */
#define NSS_WIFILI_MEC_PEER_ID 0xDEAD
@@ -1333,7 +1337,9 @@ struct nss_wifili_rx_err {
struct nss_wifili_rx_ctrl_stats {
struct nss_wifili_rx_err err; /**< Rx peer errors. */
uint32_t multipass_rx_pkt_drop; /**< Total number of multipass packets without a VLAN header. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
uint32_t peer_unauth_rx_pkt_drop; /**< Number of receive packets dropped due to an authorized peer. */
+#endif
uint32_t reserved_type[NSS_WIFILI_MAX_RESERVED_TYPE]; /**< Reserved type for future use. */
uint32_t non_amsdu_cnt; /**< Number of MSDUs with no MSDU level aggregation. */
uint32_t amsdu_cnt; /**< Number of MSDUs part of AMSDU. */
@@ -1810,10 +1816,12 @@ struct nss_wifili_msg {
/**< Peer four-address event message. */
struct nss_wifili_dbdc_repeater_loop_detection_msg wdrldm;
/**< Wifili DBDC repeater loop detection message. */
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
struct nss_wifili_peer_update_auth_flag peer_auth;
/**< Peer authentication flag message. */
struct nss_wifili_mesh_capability_info cap_info;
/**< Mesh capability flag. */
+#endif
} msg; /**< Message payload. */
};
diff --git a/nss_ipv4_stats.c b/nss_ipv4_stats.c
index 39b162c..c875a63 100644
--- a/nss_ipv4_stats.c
+++ b/nss_ipv4_stats.c
@@ -177,9 +177,11 @@ void nss_ipv4_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_
nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv4_mc_connection_destroy_requests;
nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv4_mc_connection_destroy_misses;
nss_ipv4_stats[NSS_IPV4_STATS_MC_CONNECTION_FLUSHES] += nins->ipv4_mc_connection_flushes;
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv4_connection_create_invalid_mirror_ifnum;
nss_ipv4_stats[NSS_IPV4_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv4_connection_create_invalid_mirror_iftype;
nss_ipv4_stats[NSS_IPV4_STATS_MIRROR_FAILURES] += nins->ipv4_mirror_failures;
+#endif
for (i = 0; i < NSS_IPV4_EXCEPTION_EVENT_MAX; i++) {
nss_ipv4_exception_stats[i] += nins->exception_events[i];
diff --git a/nss_ipv4_strings.c b/nss_ipv4_strings.c
index 77ff352..ce4c249 100644
--- a/nss_ipv4_strings.c
+++ b/nss_ipv4_strings.c
@@ -137,9 +137,11 @@ struct nss_stats_info nss_ipv4_strings_stats[NSS_IPV4_STATS_MAX] = {
{"mc_destroy_requests" , NSS_STATS_TYPE_SPECIAL},
{"mc_destroy_misses" , NSS_STATS_TYPE_SPECIAL},
{"mc_flushes" , NSS_STATS_TYPE_SPECIAL},
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
{"mirror_invalid_ifnum_conn_create_req" , NSS_STATS_TYPE_SPECIAL},
{"mirror_invalid_iftype_conn_create_req" , NSS_STATS_TYPE_SPECIAL},
{"mirror_failures" , NSS_STATS_TYPE_SPECIAL},
+#endif
};
/*
diff --git a/nss_ipv6_stats.c b/nss_ipv6_stats.c
index 617f55b..a492a6c 100644
--- a/nss_ipv6_stats.c
+++ b/nss_ipv6_stats.c
@@ -180,9 +180,11 @@ void nss_ipv6_stats_node_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv6_
nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_REQUESTS] += nins->ipv6_mc_connection_destroy_requests;
nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_DESTROY_MISSES] += nins->ipv6_mc_connection_destroy_misses;
nss_ipv6_stats[NSS_IPV6_STATS_MC_CONNECTION_FLUSHES] += nins->ipv6_mc_connection_flushes;
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFNUM] += nins->ipv6_connection_create_invalid_mirror_ifnum;
nss_ipv6_stats[NSS_IPV6_STATS_CONNECTION_CREATE_INVALID_MIRROR_IFTYPE] += nins->ipv6_connection_create_invalid_mirror_iftype;
nss_ipv6_stats[NSS_IPV6_STATS_MIRROR_FAILURES] += nins->ipv6_mirror_failures;
+#endif
for (i = 0; i < NSS_IPV6_EXCEPTION_EVENT_MAX; i++) {
nss_ipv6_exception_stats[i] += nins->exception_events[i];
diff --git a/nss_ipv6_strings.c b/nss_ipv6_strings.c
index 57b100f..29df9c9 100644
--- a/nss_ipv6_strings.c
+++ b/nss_ipv6_strings.c
@@ -115,9 +115,11 @@ struct nss_stats_info nss_ipv6_strings_stats[NSS_IPV6_STATS_MAX] = {
{"mc_destroy_requests" ,NSS_STATS_TYPE_SPECIAL},
{"mc_destroy_misses" ,NSS_STATS_TYPE_SPECIAL},
{"mc_flushes" ,NSS_STATS_TYPE_SPECIAL},
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
{"mirror_invalid_ifnum_conn_create_req" ,NSS_STATS_TYPE_SPECIAL},
{"mirror_invalid_iftype_conn_create_req" ,NSS_STATS_TYPE_SPECIAL},
{"mirror_failures" ,NSS_STATS_TYPE_SPECIAL},
+#endif
};
/*
--
2.31.1

View File

@ -18,7 +18,7 @@ define KernelPackage/qca-nss-drv
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \
+PACKAGE_kmod-qca-nss-gmac:kmod-qca-nss-gmac @!LINUX_3_18
+PACKAGE_kmod-qca-nss-gmac:kmod-qca-nss-gmac @LINUX_5_4
TITLE:=Kernel driver for NSS (core driver)
FILES:=$(PKG_BUILD_DIR)/qca-nss-drv.ko
AUTOLOAD:=$(call AutoLoad,32,qca-nss-drv)

View File

@ -0,0 +1,97 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=qca-nss-ecm-64
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/cc-qrdk/oss/lklm/qca-nss-ecm
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-04-29
PKG_SOURCE_VERSION:=c115aec34867b582e2e5ea79fc5315971e0e953c
PKG_MIRROR_HASH:=a772996af7bbae7031eebc2f789431d29be67f11eb0a1e874c08b74eec6f4585
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/qca-nss-ecm-64
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Support
DEPENDS:=@(TARGET_ipq807x||TARGET_ipq60xx) \
+kmod-qca-nss-drv-64 \
+iptables-mod-extra \
+kmod-ipt-conntrack \
+kmod-ipt-physdev \
+iptables-mod-physdev \
+kmod-ppp \
+kmod-pppoe
TITLE:=QCA NSS Enhanced Connection Manager (ECM)
FILES:=$(PKG_BUILD_DIR)/*.ko
KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
CONFIG_NF_CONNTRACK_EVENTS=y \
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \
CONFIG_NF_CONNTRACK_DSCPREMARK_EXT=n
endef
define KernelPackage/qca-nss-ecm-64/Description
This package contains the QCA NSS Enhanced Connection Manager
endef
define KernelPackage/qca-nss-ecm-64/install
$(INSTALL_DIR) $(1)/etc/firewall.d $(1)/etc/init.d $(1)/usr/bin $(1)/lib/netifd/offload $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/sysctl.d
$(INSTALL_DATA) ./files/qca-nss-ecm.firewall $(1)/etc/firewall.d/qca-nss-ecm
$(INSTALL_BIN) ./files/qca-nss-ecm.init $(1)/etc/init.d/qca-nss-ecm
$(INSTALL_BIN) ./files/ecm_dump.sh $(1)/usr/bin/
$(INSTALL_BIN) ./files/on-demand-down $(1)/lib/netifd/offload/on-demand-down
$(INSTALL_DATA) ./files/qca-nss-ecm.uci $(1)/etc/config/ecm
$(INSTALL_DATA) ./files/qca-nss-ecm.defaults $(1)/etc/uci-defaults/99-qca-nss-ecm
$(INSTALL_BIN) ./files/qca-nss-ecm.sysctl $(1)/etc/sysctl.d/qca-nss-ecm.conf
echo 'net.netfilter.nf_conntrack_max=8192' >> $(1)/etc/sysctl.d/qca-nss-ecm.conf
endef
EXTRA_CFLAGS+=-I$(STAGING_DIR)/usr/include/qca-nss-drv
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "ipq807x" "ipq60xx"))
ECM_MAKE_OPTS+= ECM_FRONT_END_NSS_ENABLE=y \
ECM_CLASSIFIER_HYFI_ENABLE=n \
ECM_MULTICAST_ENABLE=n \
ECM_INTERFACE_IPSEC_ENABLE=n \
ECM_INTERFACE_PPTP_ENABLE=n \
ECM_INTERFACE_L2TPV2_ENABLE=n \
ECM_INTERFACE_GRE_TAP_ENABLE=n \
ECM_INTERFACE_GRE_TUN_ENABLE=n \
ECM_INTERFACE_SIT_ENABLE=n \
ECM_INTERFACE_TUNIPIP6_ENABLE=n \
ECM_INTERFACE_RAWIP_ENABLE=n \
ECM_INTERFACE_VLAN_ENABLE=n \
ECM_CLASSIFIER_MARK_ENABLE=n \
ECM_CLASSIFIER_DSCP_ENABLE=n \
ECM_CLASSIFIER_PCC_ENABLE=n \
ECM_BAND_STEERING_ENABLE=n \
ECM_INTERFACE_PPPOE_ENABLE=y
endif
ifeq ($(CONFIG_TARGET_BOARD), "ipq807x")
SOC="ipq807x_64"
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
SOC="ipq60xx_64"
endif
define Build/InstallDev
mkdir -p $(1)/usr/include/qca-nss-ecm
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-ecm
endef
define Build/Compile
+$(MAKE) -C "$(LINUX_DIR)" $(strip $(ECM_MAKE_OPTS)) \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
M="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC=$(SOC) \
$(KERNEL_MAKE_FLAGS) \
$(PKG_JOBS) \
modules
endef
$(eval $(call KernelPackage,qca-nss-ecm-64))

View File

@ -0,0 +1,95 @@
#!/bin/sh
#
# Copyright (c) 2015-2016, 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.
#
ECM_MODULE=${1:-ecm_state}
MOUNT_ROOT=/dev/ecm
#
# usage: ecm_dump.sh [module=ecm_db]
#
# with no parameters, ecm_dump.sh will attempt to mount the
# ecm_db state file and cat its contents.
#
# example with a parameter: ecm_dump.sh ecm_classifier_default
#
# this will cause ecm_dump to attempt to find and mount the state
# file for the ecm_classifier_default module, and if successful
# cat the contents.
#
# this is one of the state files, which happens to be the
# last module started in ecm
ECM_STATE=/sys/kernel/debug/ecm/ecm_state/state_dev_major
# tests to see if ECM is up and ready to receive commands.
# returns 0 if ECM is fully up and ready, else 1
ecm_is_ready() {
if [ ! -e "${ECM_STATE}" ]
then
return 1
fi
return 0
}
#
# module_state_mount(module_name)
# Mounts the state file of the module, if supported
#
module_state_mount() {
local module_name=$1
local mount_dir=$2
local state_file="/sys/kernel/debug/ecm/${module_name}/state_dev_major"
if [ -e "${mount_dir}/${module_name}" ]
then
# already mounted
return 0
fi
#echo "Mount state file for $module_name ..."
if [ ! -e "$state_file" ]
then
#echo "... $module_name does not support state"
return 1
fi
local major="`cat $state_file`"
#echo "... Mounting state $state_file with major: $major"
mknod "${mount_dir}/${module_name}" c $major 0
}
#
# main
#
ecm_is_ready || {
#echo "ECM is not running"
exit 1
}
# all state files are mounted under MOUNT_ROOT, so make sure it exists
mkdir -p ${MOUNT_ROOT}
#
# attempt to mount state files for the requested module and cat it
# if the mount succeeded
#
module_state_mount ${ECM_MODULE} ${MOUNT_ROOT} && {
cat ${MOUNT_ROOT}/${ECM_MODULE}
exit 0
}
exit 2

View File

@ -0,0 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 The Linux Foundation. All rights reserved.
[ -e "/sys/kernel/debug/ecm/ecm_db/defunct_all" ] && {
echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all
}

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# Copyright (c) 2015-2016, 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.
#
uci -q batch << EOF
delete firewall.qcanssecm
set firewall.qcanssecm=include
set firewall.qcanssecm.type=script
set firewall.qcanssecm.path=/etc/firewall.d/qca-nss-ecm
set firewall.qcanssecm.family=any
set firewall.qcanssecm.reload=1
commit firewall
EOF
exit 0

View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# Copyright (c) 2015-2016, 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.
#
iptables -A FORWARD -m physdev --physdev-is-bridged -j ACCEPT

View File

@ -0,0 +1,140 @@
#!/bin/sh /etc/rc.common
#
# Copyright (c) 2014, 2019-2020 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.
# The shebang above has an extra space intentially to avoid having
# openwrt build scripts automatically enable this package starting
# at boot.
START=19
get_front_end_mode() {
config_load "ecm"
config_get front_end global acceleration_engine "auto"
case $front_end in
auto)
echo '0'
;;
nss)
echo '1'
;;
sfe)
echo '2'
;;
*)
echo 'uci_option_acceleration_engine is invalid'
esac
}
support_bridge() {
#NSS support bridge acceleration
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && return 0
#SFE doesn't support bridge acceleration
[ -d /sys/kernel/debug/ecm/ecm_sfe_ipv4 ] && return 1
}
load_sfe() {
local kernel_version=$(uname -r)
[ -e "/lib/modules/$kernel_version/shortcut-fe.ko" ] && {
[ -d /sys/module/shortcut_fe ] || insmod shortcut-fe
}
[ -e "/lib/modules/$kernel_version/shortcut-fe-ipv6.ko" ] && {
[ -d /sys/module/shortcut_fe_ipv6 ] || insmod shortcut-fe-ipv6
}
[ -e "/lib/modules/$kernel_version/shortcut-fe-drv.ko" ] && {
[ -d /sys/module/shortcut_fe_drv ] || insmod shortcut-fe-drv
}
}
load_ecm() {
[ -d /sys/module/ecm ] || {
[ ! -e /proc/device-tree/MP_256 ] && load_sfe
insmod ecm front_end_selection=$(get_front_end_mode)
}
support_bridge && {
sysctl -w net.bridge.bridge-nf-call-ip6tables=1
sysctl -w net.bridge.bridge-nf-call-iptables=1
}
}
unload_ecm() {
sysctl -w net.bridge.bridge-nf-call-ip6tables=0
sysctl -w net.bridge.bridge-nf-call-iptables=0
if [ -d /sys/module/ecm ]; then
#
# Stop ECM frontends
#
echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop
echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop
#
# Defunct the connections
#
echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all
sleep 5;
rmmod ecm
sleep 1
fi
}
start() {
# If SFE CM is loaded, return.
if [ -d /sys/module/shortcut_fe_cm ]; then
echo "shortcut_fe CM is loaded, unload it first"
echo "cmd: /etc/init.d/shortcut_fe stop"
return
fi
load_ecm
# If the acceleration engine is NSS, enable wifi redirect.
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=1
support_bridge && {
echo 'net.bridge.bridge-nf-call-ip6tables=1' >> /etc/sysctl.d/qca-nss-ecm.conf
echo 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.d/qca-nss-ecm.conf
}
if [ -d /sys/module/qca_ovsmgr ]; then
insmod ecm_ovs
fi
}
stop() {
# If ECM is already not loaded, just return.
if [ ! -d /sys/module/ecm ]; then
return
fi
# If the acceleration engine is NSS, disable wifi redirect.
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=0
sed '/net.bridge.bridge-nf-call-ip6tables=1/d' -i /etc/sysctl.d/qca-nss-ecm.conf
sed '/net.bridge.bridge-nf-call-iptables=1/d' -i /etc/sysctl.d/qca-nss-ecm.conf
if [ -d /sys/module/ecm_ovs ]; then
rmmod ecm_ovs
fi
unload_ecm
}

View File

@ -0,0 +1,2 @@
# nf_conntrack_tcp_no_window_check is 0 by default, set it to 1
net.netfilter.nf_conntrack_tcp_no_window_check=1

View File

@ -0,0 +1,2 @@
config ecm 'global'
option acceleration_engine 'auto'

View File

@ -0,0 +1,335 @@
From 73345c87b28a473b35b57e673f8de963c3d73da1 Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Wed, 19 May 2021 02:38:53 +0200
Subject: [PATCH] treewide: componentize the module even more
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
Makefile | 56 +++++++++++++++++++++++++-------
ecm_db/ecm_db_connection.c | 8 +++++
ecm_db/ecm_db_node.c | 4 +++
ecm_interface.c | 8 +++++
frontends/ecm_front_end_common.c | 7 ++++
5 files changed, 72 insertions(+), 11 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -82,10 +82,18 @@ ccflags-$(ECM_INTERFACE_BOND_ENABLE) +=
# Define ECM_INTERFACE_PPPOE_ENABLE=y in order
# to enable support for PPPoE acceleration.
# #############################################################################
-ECM_INTERFACE_PPPOE_ENABLE=y
+ifndef $(ECM_INTERFACE_PPPOE_ENABLE)
+ ECM_INTERFACE_PPPOE_ENABLE=y
+endif
ccflags-$(ECM_INTERFACE_PPPOE_ENABLE) += -DECM_INTERFACE_PPPOE_ENABLE
# #############################################################################
+# Define ECM_INTERFACE_L2TPV2_PPTP_ENABLE=y in order
+# to enable support for l2tpv2 or PPTP detection.
+# #############################################################################
+ccflags-$(ECM_INTERFACE_L2TPV2_PPTP_ENABLE) += -DECM_INTERFACE_L2TPV2_PPTP_ENABLE
+
+# #############################################################################
# Define ECM_INTERFACE_L2TPV2_ENABLE=y in order
# to enable support for l2tpv2 acceleration.
# #############################################################################
@@ -118,6 +126,12 @@ ccflags-$(ECM_INTERFACE_PPP_ENABLE) += -
ccflags-$(ECM_INTERFACE_MAP_T_ENABLE) += -DECM_INTERFACE_MAP_T_ENABLE
# #############################################################################
+# Define ECM_INTERFACE_GRE_ENABLE=y in order
+# to enable support for GRE detection.
+# #############################################################################
+ccflags-$(ECM_INTERFACE_GRE_ENABLE) += -DECM_INTERFACE_GRE_ENABLE
+
+# #############################################################################
# Define ECM_INTERFACE_GRE_TAP_ENABLE=y in order
# to enable support for GRE TAP interface.
# #############################################################################
@@ -186,7 +200,9 @@ ccflags-$(ECM_INTERFACE_OVS_BRIDGE_ENABL
# #############################################################################
# Define ECM_INTERFACE_VLAN_ENABLE=y in order to enable support for VLAN
# #############################################################################
-ECM_INTERFACE_VLAN_ENABLE=y
+ifndef $(ECM_INTERFACE_VLAN_ENABLE)
+ ECM_INTERFACE_VLAN_ENABLE=y
+endif
ccflags-$(ECM_INTERFACE_VLAN_ENABLE) += -DECM_INTERFACE_VLAN_ENABLE
# #############################################################################
@@ -228,7 +244,9 @@ ccflags-$(ECM_CLASSIFIER_OVS_ENABLE) +=
# #############################################################################
# Define ECM_CLASSIFIER_MARK_ENABLE=y in order to enable mark classifier.
# #############################################################################
-ECM_CLASSIFIER_MARK_ENABLE=y
+ifndef $(ECM_CLASSIFIER_MARK_ENABLE)
+ ECM_CLASSIFIER_MARK_ENABLE=y
+endif
ecm-$(ECM_CLASSIFIER_MARK_ENABLE) += ecm_classifier_mark.o
ccflags-$(ECM_CLASSIFIER_MARK_ENABLE) += -DECM_CLASSIFIER_MARK_ENABLE
@@ -247,7 +265,9 @@ ccflags-$(ECM_CLASSIFIER_NL_ENABLE) += -
# #############################################################################
# Define ECM_CLASSIFIER_DSCP_ENABLE=y in order to enable DSCP classifier.
# #############################################################################
-ECM_CLASSIFIER_DSCP_ENABLE=y
+ifndef $(ECM_CLASSIFIER_DSCP_ENABLE)
+ ECM_CLASSIFIER_DSCP_ENABLE=y
+endif
ecm-$(ECM_CLASSIFIER_DSCP_ENABLE) += ecm_classifier_dscp.o
ccflags-$(ECM_CLASSIFIER_DSCP_ENABLE) += -DECM_CLASSIFIER_DSCP_ENABLE
ccflags-$(ECM_CLASSIFIER_DSCP_IGS) += -DECM_CLASSIFIER_DSCP_IGS
@@ -274,7 +294,9 @@ endif
# the Parental Controls subsystem classifier in ECM. Currently disabled until
# customers require it / if they need to integrate their Parental Controls with it.
# #############################################################################
-ECM_CLASSIFIER_PCC_ENABLE=y
+ifndef $(ECM_CLASSIFIER_PCC_ENABLE)
+ ECM_CLASSIFIER_PCC_ENABLE=y
+endif
ecm-$(ECM_CLASSIFIER_PCC_ENABLE) += ecm_classifier_pcc.o
ccflags-$(ECM_CLASSIFIER_PCC_ENABLE) += -DECM_CLASSIFIER_PCC_ENABLE
@@ -301,28 +323,36 @@ ccflags-$(ECM_NON_PORTED_SUPPORT_ENABLE)
# #############################################################################
# Define ECM_STATE_OUTPUT_ENABLE=y to support XML state output
# #############################################################################
-ECM_STATE_OUTPUT_ENABLE=y
+ifndef $(ECM_STATE_OUTPUT_ENABLE)
+ ECM_STATE_OUTPUT_ENABLE=y
+endif
ecm-$(ECM_STATE_OUTPUT_ENABLE) += ecm_state.o
ccflags-$(ECM_STATE_OUTPUT_ENABLE) += -DECM_STATE_OUTPUT_ENABLE
# #############################################################################
# Define ECM_DB_ADVANCED_STATS_ENABLE to support XML state output
# #############################################################################
-ECM_DB_ADVANCED_STATS_ENABLE=y
+ifndef $(ECM_DB_ADVANCED_STATS_ENABLE)
+ ECM_DB_ADVANCED_STATS_ENABLE=y
+endif
ccflags-$(ECM_DB_ADVANCED_STATS_ENABLE) += -DECM_DB_ADVANCED_STATS_ENABLE
# #############################################################################
# Define ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE=y in order to enable
# the database to track relationships between objects.
# #############################################################################
-ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE=y
+ifndef $(ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE)
+ ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE=y
+endif
ccflags-$(ECM_DB_CONNECTION_CROSS_REFERENCING_ENABLE) += -DECM_DB_XREF_ENABLE
# #############################################################################
# Define ECM_TRACKER_DPI_SUPPORT_ENABLE=y in order to enable support for
# deep packet inspection and tracking of data with the trackers.
# #############################################################################
-ECM_TRACKER_DPI_SUPPORT_ENABLE=y
+ifndef $(ECM_TRACKER_DPI_SUPPORT_ENABLE)
+ ECM_TRACKER_DPI_SUPPORT_ENABLE=y
+endif
ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE) += -DECM_TRACKER_DPI_SUPPORT_ENABLE
# #############################################################################
@@ -330,14 +360,18 @@ ccflags-$(ECM_TRACKER_DPI_SUPPORT_ENABLE
# support for the database keeping lists of connections that are assigned
# on a per TYPE of classifier basis.
# #############################################################################
-ECM_DB_CLASSIFIER_TYPE_ASSIGNMENTS_TRACK_ENABLE=y
+ifndef $(ECM_DB_CLASSIFIER_TYPE_ASSIGNMENTS_TRACK_ENABLE)
+ ECM_DB_CLASSIFIER_TYPE_ASSIGNMENTS_TRACK_ENABLE=y
+endif
ccflags-$(ECM_DB_CLASSIFIER_TYPE_ASSIGNMENTS_TRACK_ENABLE) += -DECM_DB_CTA_TRACK_ENABLE
# #############################################################################
# Define ECM_BAND_STEERING_ENABLE=y in order to enable
# band steering feature.
# #############################################################################
-ECM_BAND_STEERING_ENABLE=y
+ifndef $(ECM_BAND_STEERING_ENABLE)
+ ECM_BAND_STEERING_ENABLE=y
+endif
ccflags-$(ECM_BAND_STEERING_ENABLE) += -DECM_BAND_STEERING_ENABLE
# #############################################################################
--- a/ecm_db/ecm_db_connection.c
+++ b/ecm_db/ecm_db_connection.c
@@ -430,7 +430,9 @@ EXPORT_SYMBOL(ecm_db_connection_make_def
*/
void ecm_db_connection_data_totals_update(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets)
{
+#ifdef ECM_DB_ADVANCED_STATS_ENABLE
int32_t i;
+#endif
DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed\n", ci);
@@ -529,7 +531,9 @@ EXPORT_SYMBOL(ecm_db_connection_data_tot
*/
void ecm_db_connection_data_totals_update_dropped(struct ecm_db_connection_instance *ci, bool is_from, uint64_t size, uint64_t packets)
{
+#ifdef ECM_DB_ADVANCED_STATS_ENABLE
int32_t i;
+#endif
DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed\n", ci);
@@ -1508,6 +1512,7 @@ void ecm_db_connection_defunct_all(void)
}
EXPORT_SYMBOL(ecm_db_connection_defunct_all);
+#ifdef ECM_INTERFACE_OVS_BRIDGE_ENABLE
/*
* ecm_db_connection_defunct_by_classifier()
* Make defunct based on masked fields
@@ -1667,6 +1672,7 @@ next_ci:
ECM_IP_ADDR_TO_OCTAL(dest_addr_mask), dest_port_mask, proto_mask, cnt);
}
}
+#endif
/*
* ecm_db_connection_defunct_by_port()
@@ -1956,6 +1962,7 @@ struct ecm_db_node_instance *ecm_db_conn
}
EXPORT_SYMBOL(ecm_db_connection_node_get_and_ref);
+#ifdef ECM_DB_XREF_ENABLE
/*
* ecm_db_connection_mapping_get_and_ref_next()
* Return reference to next connection in the mapping chain in the specified direction.
@@ -1997,6 +2004,7 @@ struct ecm_db_connection_instance *ecm_d
return nci;
}
EXPORT_SYMBOL(ecm_db_connection_iface_get_and_ref_next);
+#endif
/*
* ecm_db_connection_mapping_get_and_ref()
--- a/ecm_db/ecm_db_node.c
+++ b/ecm_db/ecm_db_node.c
@@ -224,9 +224,11 @@ EXPORT_SYMBOL(ecm_db_node_get_and_ref_ne
*/
int ecm_db_node_deref(struct ecm_db_node_instance *ni)
{
+#ifdef ECM_DB_XREF_ENABLE
#if (DEBUG_LEVEL >= 1)
int dir;
#endif
+#endif
DEBUG_CHECK_MAGIC(ni, ECM_DB_NODE_INSTANCE_MAGIC, "%px: magic failed\n", ni);
spin_lock_bh(&ecm_db_lock);
@@ -486,9 +488,11 @@ EXPORT_SYMBOL(ecm_db_node_iface_get_and_
void ecm_db_node_add(struct ecm_db_node_instance *ni, struct ecm_db_iface_instance *ii, uint8_t *address,
ecm_db_node_final_callback_t final, void *arg)
{
+#ifdef ECM_DB_XREF_ENABLE
#if (DEBUG_LEVEL >= 1)
int dir;
#endif
+#endif
ecm_db_node_hash_t hash_index;
struct ecm_db_listener_instance *li;
--- a/ecm_interface.c
+++ b/ecm_interface.c
@@ -1343,6 +1343,7 @@ struct neighbour *ecm_interface_ipv6_nei
*/
bool ecm_interface_is_pptp(struct sk_buff *skb, const struct net_device *out)
{
+#ifdef ECM_INTERFACE_PPTP_ENABLE
struct net_device *in;
/*
@@ -1367,6 +1368,7 @@ bool ecm_interface_is_pptp(struct sk_buf
}
dev_put(in);
+#endif
return false;
}
@@ -1379,6 +1381,7 @@ bool ecm_interface_is_pptp(struct sk_buf
*/
bool ecm_interface_is_l2tp_packet_by_version(struct sk_buff *skb, const struct net_device *out, int ver)
{
+#ifdef ECM_INTERFACE_L2TPV2_PPTP_ENABLE
uint32_t flag = 0;
struct net_device *in;
@@ -1411,6 +1414,7 @@ bool ecm_interface_is_l2tp_packet_by_ver
}
dev_put(in);
+#endif
return false;
}
@@ -1423,6 +1427,7 @@ bool ecm_interface_is_l2tp_packet_by_ver
*/
bool ecm_interface_is_l2tp_pptp(struct sk_buff *skb, const struct net_device *out)
{
+#ifdef ECM_INTERFACE_L2TPV2_PPTP_ENABLE
struct net_device *in;
/*
@@ -1445,6 +1450,7 @@ bool ecm_interface_is_l2tp_pptp(struct s
}
dev_put(in);
+#endif
return false;
}
@@ -6630,6 +6636,7 @@ static void ecm_interface_regenerate_con
return;
}
+#ifdef ECM_DB_XREF_ENABLE
for (dir = 0; dir < ECM_DB_OBJ_DIR_MAX; dir++) {
/*
* Re-generate all connections associated with this interface
@@ -6645,6 +6652,7 @@ static void ecm_interface_regenerate_con
ci[dir] = cin;
}
}
+#endif
#ifdef ECM_MULTICAST_ENABLE
/*
--- a/frontends/ecm_front_end_common.c
+++ b/frontends/ecm_front_end_common.c
@@ -106,6 +106,7 @@ bool ecm_front_end_gre_proto_is_accel_al
struct nf_conntrack_tuple *tuple,
int ip_version)
{
+#ifdef ECM_INTERFACE_GRE_ENABLE
struct net_device *dev;
struct gre_base_hdr *greh;
@@ -117,10 +118,12 @@ bool ecm_front_end_gre_proto_is_accel_al
/*
* Case 1: PPTP locally terminated
*/
+#ifdef ECM_INTERFACE_PPTP_ENABLE
if (ecm_interface_is_pptp(skb, outdev)) {
DEBUG_TRACE("%px: PPTP GRE locally terminated - allow acceleration\n", skb);
return true;
}
+#endif
/*
* Case 2: PPTP pass through
@@ -223,6 +226,10 @@ bool ecm_front_end_gre_proto_is_accel_al
*/
DEBUG_TRACE("%px: GRE IPv%d pass through - allow acceleration\n", skb, ip_version);
return true;
+#else
+ DEBUG_TRACE("%px: GRE%d feature is disabled - do not allow acceleration\n", skb, ip_version);
+ return false;
+#endif
}
#ifdef ECM_CLASSIFIER_DSCP_ENABLE

View File

@ -0,0 +1,831 @@
From e8b642c23af9146c973e828a7f4e0fb56cfc8d0b Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Sat, 15 May 2021 03:51:14 +0200
Subject: [PATCH] add support for kernel 5.10
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
ecm_classifier_default.c | 24 +++---------
ecm_classifier_dscp.c | 8 +---
ecm_classifier_emesh.c | 16 ++------
ecm_classifier_hyfi.c | 7 +---
ecm_classifier_mark.c | 8 +---
ecm_classifier_ovs.c | 8 +---
ecm_classifier_pcc.c | 8 +---
ecm_conntrack_notifier.c | 8 +---
ecm_db/ecm_db_connection.c | 7 +---
ecm_db/ecm_db_host.c | 7 +---
ecm_db/ecm_db_iface.c | 7 +---
ecm_db/ecm_db_mapping.c | 7 +---
ecm_db/ecm_db_node.c | 7 +---
ecm_interface.c | 4 +-
ecm_state.c | 14 ++-----
frontends/ecm_front_end_common.c | 4 +-
frontends/ecm_front_end_ipv4.c | 7 +---
frontends/ecm_front_end_ipv6.c | 7 +---
frontends/nss/ecm_nss_bond_notifier.c | 8 +---
frontends/nss/ecm_nss_ipv4.c | 49 +++++++------------------
frontends/nss/ecm_nss_ipv6.c | 49 +++++++------------------
frontends/nss/ecm_nss_multicast_ipv4.c | 7 +---
frontends/nss/ecm_nss_multicast_ipv6.c | 7 +---
frontends/nss/ecm_nss_non_ported_ipv4.c | 7 +---
frontends/nss/ecm_nss_non_ported_ipv6.c | 7 +---
frontends/nss/ecm_nss_ported_ipv4.c | 8 +---
frontends/nss/ecm_nss_ported_ipv6.c | 8 +---
frontends/sfe/ecm_sfe_ipv4.c | 49 +++++++------------------
frontends/sfe/ecm_sfe_ipv6.c | 49 +++++++------------------
frontends/sfe/ecm_sfe_non_ported_ipv4.c | 7 +---
frontends/sfe/ecm_sfe_non_ported_ipv6.c | 7 +---
frontends/sfe/ecm_sfe_ported_ipv4.c | 8 +---
frontends/sfe/ecm_sfe_ported_ipv6.c | 8 +---
33 files changed, 122 insertions(+), 314 deletions(-)
--- a/ecm_classifier_default.c
+++ b/ecm_classifier_default.c
@@ -776,26 +776,14 @@ int ecm_classifier_default_init(struct d
return -1;
}
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry,
- (u32 *)&ecm_classifier_default_enabled)) {
- DEBUG_ERROR("Failed to create ecm deafult classifier enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_default_dentry);
- return -1;
- }
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry,
+ (u32 *)&ecm_classifier_default_enabled);
- if (!debugfs_create_u32("accel_mode", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry,
- (u32 *)&ecm_classifier_default_accel_mode)) {
- DEBUG_ERROR("Failed to create ecm deafult classifier accel_mode file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_default_dentry);
- return -1;
- }
+ debugfs_create_u32("accel_mode", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry,
+ (u32 *)&ecm_classifier_default_accel_mode);
- if (!debugfs_create_u32("accel_delay_pkts", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry,
- (u32 *)&ecm_classifier_accel_delay_pkts)) {
- DEBUG_ERROR("Failed to create accel delay packet counts in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_default_dentry);
- return -1;
- }
+ debugfs_create_u32("accel_delay_pkts", S_IRUGO | S_IWUSR, ecm_classifier_default_dentry,
+ (u32 *)&ecm_classifier_accel_delay_pkts);
return 0;
}
--- a/ecm_classifier_dscp.c
+++ b/ecm_classifier_dscp.c
@@ -747,12 +747,8 @@ int ecm_classifier_dscp_init(struct dent
return -1;
}
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_dscp_dentry,
- (u32 *)&ecm_classifier_dscp_enabled)) {
- DEBUG_ERROR("Failed to create dscp enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_dscp_dentry);
- return -1;
- }
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_dscp_dentry,
+ (u32 *)&ecm_classifier_dscp_enabled);
return 0;
}
--- a/ecm_classifier_emesh.c
+++ b/ecm_classifier_emesh.c
@@ -977,19 +977,11 @@ int ecm_classifier_emesh_init(struct den
return -1;
}
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
- (u32 *)&ecm_classifier_emesh_enabled)) {
- DEBUG_ERROR("Failed to create ecm emesh classifier enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_emesh_dentry);
- return -1;
- }
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
+ (u32 *)&ecm_classifier_emesh_enabled);
- if (!debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
- (u32 *)&ecm_classifier_emesh_latency_config_enabled)) {
- DEBUG_ERROR("Failed to create ecm emesh classifier latency config enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_emesh_dentry);
- return -1;
- }
+ debugfs_create_u32("latency_config_enabled", S_IRUGO | S_IWUSR, ecm_classifier_emesh_dentry,
+ (u32 *)&ecm_classifier_emesh_latency_config_enabled);
/*
* Register for service prioritization notification update.
--- a/ecm_classifier_hyfi.c
+++ b/ecm_classifier_hyfi.c
@@ -1099,11 +1099,8 @@ int ecm_classifier_hyfi_rules_init(struc
goto classifier_task_cleanup;
}
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_hyfi_dentry,
- (u32 *)&ecm_classifier_hyfi_enabled)) {
- DEBUG_ERROR("Failed to create ecm hyfi classifier enabled file in debugfs\n");
- goto classifier_task_cleanup;
- }
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_hyfi_dentry,
+ (u32 *)&ecm_classifier_hyfi_enabled);
if (!debugfs_create_file("cmd", S_IWUSR, ecm_classifier_hyfi_dentry,
NULL, &ecm_classifier_hyfi_cmd_fops)) {
--- a/ecm_classifier_mark.c
+++ b/ecm_classifier_mark.c
@@ -753,12 +753,8 @@ int ecm_classifier_mark_init(struct dent
return -1;
}
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_mark_dentry,
- (u32 *)&ecm_classifier_mark_enabled)) {
- DEBUG_ERROR("Failed to create mark enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_mark_dentry);
- return -1;
- }
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_mark_dentry,
+ (u32 *)&ecm_classifier_mark_enabled);
return 0;
}
--- a/ecm_classifier_ovs.c
+++ b/ecm_classifier_ovs.c
@@ -2200,12 +2200,8 @@ int ecm_classifier_ovs_init(struct dentr
return -1;
}
- if (!debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_ovs_dentry,
- (u32 *)&ecm_classifier_ovs_enabled)) {
- DEBUG_ERROR("Failed to create ovs enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_ovs_dentry);
- return -1;
- }
+ debugfs_create_u32("enabled", S_IRUGO | S_IWUSR, ecm_classifier_ovs_dentry,
+ (u32 *)&ecm_classifier_ovs_enabled);
return 0;
}
--- a/ecm_classifier_pcc.c
+++ b/ecm_classifier_pcc.c
@@ -1308,12 +1308,8 @@ int ecm_classifier_pcc_init(struct dentr
return -1;
}
- if (!debugfs_create_u32("enabled", S_IRUGO, ecm_classifier_pcc_dentry,
- (u32 *)&ecm_classifier_pcc_enabled)) {
- DEBUG_ERROR("Failed to create pcc enabled file in debugfs\n");
- debugfs_remove_recursive(ecm_classifier_pcc_dentry);
- return -1;
- }
+ debugfs_create_u32("enabled", S_IRUGO, ecm_classifier_pcc_dentry,
+ (u32 *)&ecm_classifier_pcc_enabled);
return 0;
}
--- a/ecm_conntrack_notifier.c
+++ b/ecm_conntrack_notifier.c
@@ -414,12 +414,8 @@ int ecm_conntrack_notifier_init(struct d
return -1;
}
- if (!debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_conntrack_notifier_dentry,
- (u32 *)&ecm_conntrack_notifier_stopped)) {
- DEBUG_ERROR("Failed to create ecm conntrack notifier stopped file in debugfs\n");
- debugfs_remove_recursive(ecm_conntrack_notifier_dentry);
- return -1;
- }
+ debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_conntrack_notifier_dentry,
+ (u32 *)&ecm_conntrack_notifier_stopped);
#ifdef CONFIG_NF_CONNTRACK_EVENTS
/*
--- a/ecm_db/ecm_db_connection.c
+++ b/ecm_db/ecm_db_connection.c
@@ -3642,11 +3642,8 @@ static struct file_operations ecm_db_con
*/
bool ecm_db_connection_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("connection_count", S_IRUGO, dentry,
- (u32 *)&ecm_db_connection_count)) {
- DEBUG_ERROR("Failed to create ecm db connection count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("connection_count", S_IRUGO, dentry,
+ (u32 *)&ecm_db_connection_count);
if (!debugfs_create_file("connection_count_simple", S_IRUGO, dentry,
NULL, &ecm_db_connection_count_simple_fops)) {
--- a/ecm_db/ecm_db_host.c
+++ b/ecm_db/ecm_db_host.c
@@ -770,11 +770,8 @@ EXPORT_SYMBOL(ecm_db_host_alloc);
bool ecm_db_host_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("host_count", S_IRUGO, dentry,
- (u32 *)&ecm_db_host_count)) {
- DEBUG_ERROR("Failed to create ecm db host count file in debugfs\n");
- return false;;
- }
+ debugfs_create_u32("host_count", S_IRUGO, dentry,
+ (u32 *)&ecm_db_host_count);
ecm_db_host_table = vzalloc(sizeof(struct ecm_db_host_instance *) * ECM_DB_HOST_HASH_SLOTS);
if (!ecm_db_host_table) {
--- a/ecm_db/ecm_db_iface.c
+++ b/ecm_db/ecm_db_iface.c
@@ -3670,11 +3670,8 @@ EXPORT_SYMBOL(ecm_db_iface_alloc);
*/
bool ecm_db_iface_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("iface_count", S_IRUGO, dentry,
- (u32 *)&ecm_db_iface_count)) {
- DEBUG_ERROR("Failed to create ecm db iface count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("iface_count", S_IRUGO, dentry,
+ (u32 *)&ecm_db_iface_count);
return true;
}
--- a/ecm_db/ecm_db_mapping.c
+++ b/ecm_db/ecm_db_mapping.c
@@ -806,11 +806,8 @@ EXPORT_SYMBOL(ecm_db_mapping_alloc);
*/
bool ecm_db_mapping_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("mapping_count", S_IRUGO, dentry,
- (u32 *)&ecm_db_mapping_count)) {
- DEBUG_ERROR("Failed to create ecm db mapping count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("mapping_count", S_IRUGO, dentry,
+ (u32 *)&ecm_db_mapping_count);
ecm_db_mapping_table = vzalloc(sizeof(struct ecm_db_mapping_instance *) * ECM_DB_MAPPING_HASH_SLOTS);
if (!ecm_db_mapping_table) {
--- a/ecm_db/ecm_db_node.c
+++ b/ecm_db/ecm_db_node.c
@@ -1187,11 +1187,8 @@ keep_sni_conn:
*/
bool ecm_db_node_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("node_count", S_IRUGO, dentry,
- (u32 *)&ecm_db_node_count)) {
- DEBUG_ERROR("Failed to create ecm db node count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("node_count", S_IRUGO, dentry,
+ (u32 *)&ecm_db_node_count);
ecm_db_node_table = vzalloc(sizeof(struct ecm_db_node_instance *) * ECM_DB_NODE_HASH_SLOTS);
if (!ecm_db_node_table) {
--- a/ecm_interface.c
+++ b/ecm_interface.c
@@ -332,7 +332,7 @@ static struct net_device *ecm_interface_
struct net_device *dev;
ECM_IP_ADDR_TO_NIN6_ADDR(addr6, addr);
- dev = (struct net_device *)ipv6_dev_find(&init_net, &addr6, 1);
+ dev = (struct net_device *)ipv6_dev_find_and_hold(&init_net, &addr6, 1);
return dev;
}
#endif
@@ -734,7 +734,7 @@ static bool ecm_interface_mac_addr_get_i
* Get the MAC address that corresponds to IP address given.
*/
ECM_IP_ADDR_TO_NIN6_ADDR(daddr, addr);
- local_dev = ipv6_dev_find(&init_net, &daddr, 1);
+ local_dev = ipv6_dev_find_and_hold(&init_net, &daddr, 1);
if (local_dev) {
DEBUG_TRACE("%pi6 is a local address\n", &daddr);
memcpy(mac_addr, dev->dev_addr, ETH_ALEN);
--- a/ecm_state.c
+++ b/ecm_state.c
@@ -899,17 +899,11 @@ int ecm_state_init(struct dentry *dentry
return -1;
}
- if (!debugfs_create_u32("state_dev_major", S_IRUGO, ecm_state_dentry,
- (u32 *)&ecm_state_dev_major_id)) {
- DEBUG_ERROR("Failed to create ecm state dev major file in debugfs\n");
- goto init_cleanup;
- }
+ debugfs_create_u32("state_dev_major", S_IRUGO, ecm_state_dentry,
+ (u32 *)&ecm_state_dev_major_id);
- if (!debugfs_create_u32("state_file_output_mask", S_IRUGO | S_IWUSR, ecm_state_dentry,
- (u32 *)&ecm_state_file_output_mask)) {
- DEBUG_ERROR("Failed to create ecm state output mask file in debugfs\n");
- goto init_cleanup;
- }
+ debugfs_create_u32("state_file_output_mask", S_IRUGO | S_IWUSR, ecm_state_dentry,
+ (u32 *)&ecm_state_file_output_mask);
/*
* Register a char device that we will use to provide a dump of our state
--- a/frontends/ecm_front_end_common.c
+++ b/frontends/ecm_front_end_common.c
@@ -192,7 +192,7 @@ bool ecm_front_end_gre_proto_is_accel_al
return false;
}
} else {
- dev = ipv6_dev_find(&init_net, &(tuple->src.u3.in6), 1);
+ dev = ipv6_dev_find_and_hold(&init_net, &(tuple->src.u3.in6), 1);
if (dev) {
/*
* Source IP address is local
@@ -202,7 +202,7 @@ bool ecm_front_end_gre_proto_is_accel_al
return false;
}
- dev = ipv6_dev_find(&init_net, &(tuple->dst.u3.in6), 1);
+ dev = ipv6_dev_find_and_hold(&init_net, &(tuple->dst.u3.in6), 1);
if (dev) {
/*
* Destination IP address is local
--- a/frontends/ecm_front_end_ipv4.c
+++ b/frontends/ecm_front_end_ipv4.c
@@ -376,11 +376,8 @@ void ecm_front_end_ipv4_stop(int num)
*/
int ecm_front_end_ipv4_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("front_end_ipv4_stop", S_IRUGO | S_IWUSR, dentry,
- (u32 *)&ecm_front_end_ipv4_stopped)) {
- DEBUG_ERROR("Failed to create ecm front end ipv4 stop file in debugfs\n");
- return -1;
- }
+ debugfs_create_u32("front_end_ipv4_stop", S_IRUGO | S_IWUSR, dentry,
+ (u32 *)&ecm_front_end_ipv4_stopped);
switch (ecm_front_end_type_get()) {
case ECM_FRONT_END_TYPE_NSS:
--- a/frontends/ecm_front_end_ipv6.c
+++ b/frontends/ecm_front_end_ipv6.c
@@ -255,11 +255,8 @@ void ecm_front_end_ipv6_stop(int num)
*/
int ecm_front_end_ipv6_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("front_end_ipv6_stop", S_IRUGO | S_IWUSR, dentry,
- (u32 *)&ecm_front_end_ipv6_stopped)) {
- DEBUG_ERROR("Failed to create ecm front end ipv6 stop file in debugfs\n");
- return -1;
- }
+ debugfs_create_u32("front_end_ipv6_stop", S_IRUGO | S_IWUSR, dentry,
+ (u32 *)&ecm_front_end_ipv6_stopped);
switch (ecm_front_end_type_get()) {
case ECM_FRONT_END_TYPE_NSS:
--- a/frontends/nss/ecm_nss_bond_notifier.c
+++ b/frontends/nss/ecm_nss_bond_notifier.c
@@ -240,12 +240,8 @@ int ecm_nss_bond_notifier_init(struct de
return -1;
}
- if (!debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_nss_bond_notifier_dentry,
- (u32 *)&ecm_nss_bond_notifier_stopped)) {
- DEBUG_ERROR("Failed to create ecm bond notifier stopped file in debugfs\n");
- debugfs_remove_recursive(ecm_nss_bond_notifier_dentry);
- return -1;
- }
+ debugfs_create_u32("stop", S_IRUGO | S_IWUSR, ecm_nss_bond_notifier_dentry,
+ (u32 *)&ecm_nss_bond_notifier_stopped);
/*
* Register Link Aggregation callbacks with the bonding driver
--- a/frontends/nss/ecm_nss_ipv4.c
+++ b/frontends/nss/ecm_nss_ipv4.c
@@ -2802,41 +2802,23 @@ int ecm_nss_ipv4_init(struct dentry *den
return result;
}
- if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_no_action_limit_default)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 no_action_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_no_action_limit_default);
- if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_driver_fail_limit_default)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 driver_fail_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_driver_fail_limit_default);
- if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_nack_limit_default)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 nack_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_nack_limit_default);
- if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 accelerated_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_accelerated_count);
- if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_pending_accel_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 pending_accel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_pending_accel_count);
- if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_pending_decel_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 pending_decel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_pending_decel_count);
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
NULL, &ecm_nss_ipv4_accel_limit_mode_fops)) {
@@ -2867,11 +2849,8 @@ int ecm_nss_ipv4_init(struct dentry *den
goto task_cleanup;
}
- if (!debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
- (u32 *)&ecm_nss_ipv4_vlan_passthrough_enable)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 vlan passthrough file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv4_dentry,
+ (u32 *)&ecm_nss_ipv4_vlan_passthrough_enable);
#ifdef ECM_NON_PORTED_SUPPORT_ENABLE
if (!ecm_nss_non_ported_ipv4_debugfs_init(ecm_nss_ipv4_dentry)) {
--- a/frontends/nss/ecm_nss_ipv6.c
+++ b/frontends/nss/ecm_nss_ipv6.c
@@ -2542,41 +2542,23 @@ int ecm_nss_ipv6_init(struct dentry *den
return result;
}
- if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_no_action_limit_default)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 no_action_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_no_action_limit_default);
- if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_driver_fail_limit_default)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 driver_fail_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_driver_fail_limit_default);
- if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_nack_limit_default)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 nack_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_nack_limit_default);
- if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 accelerated_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("accelerated_count", S_IRUGO, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_accelerated_count);
- if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_pending_accel_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 pending_accel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_pending_accel_count);
- if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_pending_decel_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 pending_decel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_pending_decel_count);
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
NULL, &ecm_nss_ipv6_accel_limit_mode_fops)) {
@@ -2607,11 +2589,8 @@ int ecm_nss_ipv6_init(struct dentry *den
goto task_cleanup;
}
- if (!debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
- (u32 *)&ecm_nss_ipv6_vlan_passthrough_enable)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 vlan passthrough file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("vlan_passthrough_set", S_IRUGO | S_IWUSR, ecm_nss_ipv6_dentry,
+ (u32 *)&ecm_nss_ipv6_vlan_passthrough_enable);
#ifdef ECM_NON_PORTED_SUPPORT_ENABLE
if (!ecm_nss_non_ported_ipv6_debugfs_init(ecm_nss_ipv6_dentry)) {
--- a/frontends/nss/ecm_nss_multicast_ipv4.c
+++ b/frontends/nss/ecm_nss_multicast_ipv4.c
@@ -4139,11 +4139,8 @@ void ecm_nss_multicast_ipv4_stop(int num
*/
int ecm_nss_multicast_ipv4_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("ecm_nss_multicast_ipv4_stop", S_IRUGO | S_IWUSR, dentry,
- (u32 *)&ecm_front_end_ipv4_mc_stopped)) {
- DEBUG_ERROR("Failed to create ecm front end ipv4 mc stop file in debugfs\n");
- return -1;
- }
+ debugfs_create_u32("ecm_nss_multicast_ipv4_stop", S_IRUGO | S_IWUSR, dentry,
+ (u32 *)&ecm_front_end_ipv4_mc_stopped);
/*
* Register multicast update callback to MCS snooper
--- a/frontends/nss/ecm_nss_multicast_ipv6.c
+++ b/frontends/nss/ecm_nss_multicast_ipv6.c
@@ -3939,11 +3939,8 @@ void ecm_nss_multicast_ipv6_stop(int num
*/
int ecm_nss_multicast_ipv6_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("ecm_nss_multicast_ipv6_stop", S_IRUGO | S_IWUSR, dentry,
- (u32 *)&ecm_front_end_ipv6_mc_stopped)) {
- DEBUG_ERROR("Failed to create ecm front end ipv6 mc stop file in debugfs\n");
- return -1;
- }
+ debugfs_create_u32("ecm_nss_multicast_ipv6_stop", S_IRUGO | S_IWUSR, dentry,
+ (u32 *)&ecm_front_end_ipv6_mc_stopped);
/*
* Register multicast update callback to MCS snooper
--- a/frontends/nss/ecm_nss_non_ported_ipv4.c
+++ b/frontends/nss/ecm_nss_non_ported_ipv4.c
@@ -2615,11 +2615,8 @@ done:
*/
bool ecm_nss_non_ported_ipv4_debugfs_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
- (u32 *)&ecm_nss_non_ported_ipv4_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 non_ported_accelerated_count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
+ (u32 *)&ecm_nss_non_ported_ipv4_accelerated_count);
return true;
}
--- a/frontends/nss/ecm_nss_non_ported_ipv6.c
+++ b/frontends/nss/ecm_nss_non_ported_ipv6.c
@@ -2329,11 +2329,8 @@ done:
*/
bool ecm_nss_non_ported_ipv6_debugfs_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
- (u32 *)&ecm_nss_non_ported_ipv6_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 non_ported_accelerated_count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
+ (u32 *)&ecm_nss_non_ported_ipv6_accelerated_count);
return true;
}
--- a/frontends/nss/ecm_nss_ported_ipv4.c
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
@@ -2944,12 +2944,8 @@ bool ecm_nss_ported_ipv4_debugfs_init(st
return false;
}
- if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
- &ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_TCP])) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 tcp_accelerated_count file in debugfs\n");
- debugfs_remove(udp_dentry);
- return false;
- }
+ debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
+ &ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_TCP]);
return true;
}
--- a/frontends/nss/ecm_nss_ported_ipv6.c
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
@@ -2732,12 +2732,8 @@ bool ecm_nss_ported_ipv6_debugfs_init(st
return false;
}
- if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
- &ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_TCP])) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 tcp_accelerated_count file in debugfs\n");
- debugfs_remove(udp_dentry);
- return false;
- }
+ debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
+ &ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_TCP]);
return true;
}
--- a/frontends/sfe/ecm_sfe_ipv4.c
+++ b/frontends/sfe/ecm_sfe_ipv4.c
@@ -1808,48 +1808,27 @@ int ecm_sfe_ipv4_init(struct dentry *den
}
#ifdef CONFIG_XFRM
- if (!debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_reject_acceleration_for_ipsec)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 reject_acceleration_for_ipsec file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_reject_acceleration_for_ipsec);
#endif
- if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_no_action_limit_default)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 no_action_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_no_action_limit_default);
- if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_driver_fail_limit_default)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 driver_fail_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_driver_fail_limit_default);
- if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_nack_limit_default)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 nack_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_nack_limit_default);
- if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 accelerated_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_accelerated_count);
- if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_pending_accel_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 pending_accel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_pending_accel_count);
- if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv4_dentry,
- (u32 *)&ecm_sfe_ipv4_pending_decel_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 pending_decel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv4_dentry,
+ (u32 *)&ecm_sfe_ipv4_pending_decel_count);
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_sfe_ipv4_dentry,
NULL, &ecm_sfe_ipv4_accel_limit_mode_fops)) {
--- a/frontends/sfe/ecm_sfe_ipv6.c
+++ b/frontends/sfe/ecm_sfe_ipv6.c
@@ -1532,48 +1532,27 @@ int ecm_sfe_ipv6_init(struct dentry *den
}
#ifdef CONFIG_XFRM
- if (!debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_reject_acceleration_for_ipsec)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 reject_acceleration_for_ipsec file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("reject_acceleration_for_ipsec", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_reject_acceleration_for_ipsec);
#endif
- if (!debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_no_action_limit_default)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 no_action_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("no_action_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_no_action_limit_default);
- if (!debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_driver_fail_limit_default)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 driver_fail_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("driver_fail_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_driver_fail_limit_default);
- if (!debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_nack_limit_default)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 nack_limit_default file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("nack_limit_default", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_nack_limit_default);
- if (!debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 accelerated_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("accelerated_count", S_IRUGO, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_accelerated_count);
- if (!debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_pending_accel_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 pending_accel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_accel_count", S_IRUGO, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_pending_accel_count);
- if (!debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv6_dentry,
- (u32 *)&ecm_sfe_ipv6_pending_decel_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 pending_decel_count file in debugfs\n");
- goto task_cleanup;
- }
+ debugfs_create_u32("pending_decel_count", S_IRUGO, ecm_sfe_ipv6_dentry,
+ (u32 *)&ecm_sfe_ipv6_pending_decel_count);
if (!debugfs_create_file("accel_limit_mode", S_IRUGO | S_IWUSR, ecm_sfe_ipv6_dentry,
NULL, &ecm_sfe_ipv6_accel_limit_mode_fops)) {
--- a/frontends/sfe/ecm_sfe_non_ported_ipv4.c
+++ b/frontends/sfe/ecm_sfe_non_ported_ipv4.c
@@ -2284,11 +2284,8 @@ done:
*/
bool ecm_sfe_non_ported_ipv4_debugfs_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
- (u32 *)&ecm_sfe_non_ported_ipv4_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 non_ported_accelerated_count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
+ (u32 *)&ecm_sfe_non_ported_ipv4_accelerated_count);
return true;
}
--- a/frontends/sfe/ecm_sfe_non_ported_ipv6.c
+++ b/frontends/sfe/ecm_sfe_non_ported_ipv6.c
@@ -2083,11 +2083,8 @@ done:
*/
bool ecm_sfe_non_ported_ipv6_debugfs_init(struct dentry *dentry)
{
- if (!debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
- (u32 *)&ecm_sfe_non_ported_ipv6_accelerated_count)) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 non_ported_accelerated_count file in debugfs\n");
- return false;
- }
+ debugfs_create_u32("non_ported_accelerated_count", S_IRUGO, dentry,
+ (u32 *)&ecm_sfe_non_ported_ipv6_accelerated_count);
return true;
}
--- a/frontends/sfe/ecm_sfe_ported_ipv4.c
+++ b/frontends/sfe/ecm_sfe_ported_ipv4.c
@@ -2528,12 +2528,8 @@ bool ecm_sfe_ported_ipv4_debugfs_init(st
return false;
}
- if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
- &ecm_sfe_ported_ipv4_accelerated_count[ECM_SFE_PORTED_IPV4_PROTO_TCP])) {
- DEBUG_ERROR("Failed to create ecm sfe ipv4 tcp_accelerated_count file in debugfs\n");
- debugfs_remove(udp_dentry);
- return false;
- }
+ debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
+ &ecm_sfe_ported_ipv4_accelerated_count[ECM_SFE_PORTED_IPV4_PROTO_TCP]);
return true;
}
--- a/frontends/sfe/ecm_sfe_ported_ipv6.c
+++ b/frontends/sfe/ecm_sfe_ported_ipv6.c
@@ -2374,12 +2374,8 @@ bool ecm_sfe_ported_ipv6_debugfs_init(st
return false;
}
- if (!debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
- &ecm_sfe_ported_ipv6_accelerated_count[ECM_SFE_PORTED_IPV6_PROTO_TCP])) {
- DEBUG_ERROR("Failed to create ecm sfe ipv6 tcp_accelerated_count file in debugfs\n");
- debugfs_remove(udp_dentry);
- return false;
- }
+ debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
+ &ecm_sfe_ported_ipv6_accelerated_count[ECM_SFE_PORTED_IPV6_PROTO_TCP]);
return true;
}

View File

@ -0,0 +1,25 @@
--- a/ecm_conntrack_notifier.c
+++ b/ecm_conntrack_notifier.c
@@ -421,7 +421,11 @@ int ecm_conntrack_notifier_init(struct d
/*
* Eventing subsystem is available so we register a notifier hook to get fast notifications of expired connections
*/
+#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
+ result = nf_conntrack_register_chain_notifier(&init_net, &ecm_conntrack_notifier);
+#else
result = nf_conntrack_register_notifier(&init_net, &ecm_conntrack_notifier);
+#endif
if (result < 0) {
DEBUG_ERROR("Can't register nf notifier hook.\n");
debugfs_remove_recursive(ecm_conntrack_notifier_dentry);
@@ -439,7 +443,9 @@ EXPORT_SYMBOL(ecm_conntrack_notifier_ini
void ecm_conntrack_notifier_exit(void)
{
DEBUG_INFO("ECM Conntrack Notifier exit\n");
-#ifdef CONFIG_NF_CONNTRACK_EVENTS
+#ifdef CONFIG_NF_CONNTRACK_CHAIN_EVENTS
+ nf_conntrack_unregister_chain_notifier(&init_net, &ecm_conntrack_notifier);
+#else
nf_conntrack_unregister_notifier(&init_net, &ecm_conntrack_notifier);
#endif
/*

View File

@ -0,0 +1,58 @@
From e6d701c0d454d841366c556b2ef07a5203ffb35d Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Fri, 21 May 2021 21:41:31 +0200
Subject: [PATCH] More compile fixes
More runtime compile fixes.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
frontends/nss/ecm_nss_ported_ipv4.c | 12 +++---------
frontends/nss/ecm_nss_ported_ipv6.c | 12 +++---------
2 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/frontends/nss/ecm_nss_ported_ipv4.c b/frontends/nss/ecm_nss_ported_ipv4.c
index 3522f0f..7f5fcd1 100644
--- a/frontends/nss/ecm_nss_ported_ipv4.c
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
@@ -2935,14 +2935,8 @@ done:
*/
bool ecm_nss_ported_ipv4_debugfs_init(struct dentry *dentry)
{
- struct dentry *udp_dentry;
-
- udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
+ debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
&ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_UDP]);
- if (!udp_dentry) {
- DEBUG_ERROR("Failed to create ecm nss ipv4 udp_accelerated_count file in debugfs\n");
- return false;
- }
debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
&ecm_nss_ported_ipv4_accelerated_count[ECM_NSS_PORTED_IPV4_PROTO_TCP]);
diff --git a/frontends/nss/ecm_nss_ported_ipv6.c b/frontends/nss/ecm_nss_ported_ipv6.c
index f43ac95..e0f779c 100644
--- a/frontends/nss/ecm_nss_ported_ipv6.c
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
/*
* ecm_nss_ported_ipv6_connection_callback()
@@ -2723,14 +2723,8 @@ done:
*/
bool ecm_nss_ported_ipv6_debugfs_init(struct dentry *dentry)
{
- struct dentry *udp_dentry;
-
- udp_dentry = debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
+ debugfs_create_u32("udp_accelerated_count", S_IRUGO, dentry,
&ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_UDP]);
- if (!udp_dentry) {
- DEBUG_ERROR("Failed to create ecm nss ipv6 udp_accelerated_count file in debugfs\n");
- return false;
- }
debugfs_create_u32("tcp_accelerated_count", S_IRUGO, dentry,
&ecm_nss_ported_ipv6_accelerated_count[ECM_NSS_PORTED_IPV6_PROTO_TCP]);
--
2.31.1

View File

@ -44,7 +44,7 @@ define KernelPackage/qca-nss-ecm/Default
+TARGET_ipq_ipq50xx:kmod-qca-nss-drv \
+TARGET_ipq_ipq50xx_64:kmod-qca-nss-drv \
+iptables-mod-extra +kmod-ipt-conntrack \
+kmod-pppoe @!LINUX_3_18 \
+kmod-pppoe @LINUX_5_4 \
+kmod-ipsec
TITLE:=QCA NSS Enhanced Connection Manager (ECM)
FILES:=$(PKG_BUILD_DIR)/*.ko $(FILES_EXAMPLES)
@ -241,6 +241,8 @@ endef
define KernelPackage/qca-nss-ecm-premium/config
menu "ECM Configuration"
depends on PACKAGE_kmod_qca-nss-ecm-premium
config QCA_NSS_ECM_EXAMPLES_PCC
bool "Build PCC usage example"
help

View File

@ -15,7 +15,7 @@ define KernelPackage/qca-nss-gmac
SECTION:=kernel
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x @!LINUX_3_18
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x @LINUX_5_4
TITLE:=Kernel driver for NSS gmac
FILES:=$(PKG_BUILD_DIR)/ipq806x/qca-nss-gmac.ko
AUTOLOAD:=$(call AutoLoad,31,qca-nss-gmac)

View File

@ -15,6 +15,6 @@ DEFAULT_PACKAGES += \
kmod-usb3 kmod-usb-dwc3 kmod-usb-dwc3-qcom \
kmod-leds-gpio kmod-gpio-button-hotplug \
ath11k-firmware-ipq8074 kmod-ath11k-ahb \
wpad-openssl kmod-qca-nss-dp
wpad-openssl kmod-qca-nss-dp kmod-qca-nss-drv-64 kmod-qca-nss-drv-pppoe-64 kmod-qca-nss-ecm-64
$(eval $(call BuildTarget))