qca-nss-drv: add option to configure NSS memory profile

Similar to how memory profile is assignable for ath11k, introduce a
config option to set NSS memory profile. Default was always set to
512MB in upstream for ipq807x even though the platform is available in
256MB/512MB/1GB.

This option primarily limits the default number of offloaded
connections, and for low memory profile, empty buffer pool size

Default number of connections for each IPv4 and IPv6
* NSS_MEM_PROFILE_HIGH    4096
* NSS_MEM_PROFILE_MEDIUM  2048
* NSS_MEM_PROFILE_LOW     512

MAX Connection shared between IPv4 and IPv6
* NSS_MEM_PROFILE_HIGH    8192
* NSS_MEM_PROFILE_MEDIUM  4096
* NSS_MEM_PROFILE_LOW     1024
This commit is contained in:
Qosmio 2024-02-16 18:26:28 -05:00
parent 5d30819182
commit a6f3128889
2 changed files with 82 additions and 18 deletions

View File

@ -3,192 +3,250 @@ menu "Configuration"
comment "Build Options" comment "Build Options"
choice
prompt "Memory Profile"
default NSS_MEM_PROFILE_MEDIUM
help
This option allows you to select the memory profile.
It should correspond to the total RAM of your board.
config NSS_MEM_PROFILE_HIGH
bool "Use 1G memory profile"
help
This allows configuring NSS boards with 1GB+ memory.
config NSS_MEM_PROFILE_MEDIUM
bool "Use 512MB memory profile"
help
This allows configuring NSS for boards with 512M memory.
config NSS_MEM_PROFILE_LOW
bool "Use 256MB memory profile"
help
This allows configuring NSS for boards with 256M memory.
endchoice
config NSS_DRV_BRIDGE_ENABLE config NSS_DRV_BRIDGE_ENABLE
bool bool
default n default n
prompt "Enable BRIDGE" prompt "Enable BRIDGE"
config NSS_DRV_CAPWAP_ENABLE config NSS_DRV_CAPWAP_ENABLE
bool bool
default n default n
prompt "Enable CAPWAP" prompt "Enable CAPWAP"
config NSS_DRV_C2C_ENABLE config NSS_DRV_C2C_ENABLE
bool bool
default n default n
prompt "Enable C2C" prompt "Enable C2C"
config NSS_DRV_CLMAP_ENABLE config NSS_DRV_CLMAP_ENABLE
bool bool
default n default n
prompt "Enable CLMAP" prompt "Enable CLMAP"
config NSS_DRV_CRYPTO_ENABLE config NSS_DRV_CRYPTO_ENABLE
bool bool
default y default y
prompt "Enable CRYPTO" prompt "Enable CRYPTO"
config NSS_DRV_DTLS_ENABLE config NSS_DRV_DTLS_ENABLE
bool bool
default n default n
prompt "Enable DTLS" prompt "Enable DTLS"
config NSS_DRV_EDMA_ENABLE config NSS_DRV_EDMA_ENABLE
bool bool
default n default n
prompt "Enable EDMA" prompt "Enable EDMA"
config NSS_DRV_GRE_ENABLE config NSS_DRV_GRE_ENABLE
bool bool
default n default n
prompt "Enable GRE" prompt "Enable GRE"
config NSS_DRV_GRE_REDIR_ENABLE config NSS_DRV_GRE_REDIR_ENABLE
bool bool
default n default n
depends on NSS_DRV_GRE_ENABLE depends on NSS_DRV_GRE_ENABLE
prompt "Enable GRE_REDIR" prompt "Enable GRE_REDIR"
config NSS_DRV_GRE_TUNNEL_ENABLE config NSS_DRV_GRE_TUNNEL_ENABLE
bool bool
default n default n
depends on NSS_DRV_GRE_ENABLE depends on NSS_DRV_GRE_ENABLE
prompt "Enable GRE_TUNNEL" prompt "Enable GRE_TUNNEL"
config NSS_DRV_IGS_ENABLE config NSS_DRV_IGS_ENABLE
bool bool
default n default n
prompt "Enable IGS" prompt "Enable IGS"
config NSS_DRV_IPSEC_ENABLE config NSS_DRV_IPSEC_ENABLE
bool bool
default n default n
prompt "Enable IPSEC" prompt "Enable IPSEC"
config NSS_DRV_IPV4_REASM_ENABLE config NSS_DRV_IPV4_REASM_ENABLE
bool bool
default n default n
prompt "Enable IPV4_REASM" prompt "Enable IPV4_REASM"
config NSS_DRV_IPV6_ENABLE
bool
default n
prompt "Enable IPV6"
config NSS_DRV_IPV6_REASM_ENABLE config NSS_DRV_IPV6_REASM_ENABLE
bool bool
default n default n
depends on NSS_DRV_IPV6_ENABLE depends on IPV6
prompt "Enable IPV6_REASM" prompt "Enable IPV6_REASM"
config NSS_DRV_L2TP_ENABLE config NSS_DRV_L2TP_ENABLE
bool bool
default n default n
prompt "Enable L2TP" prompt "Enable L2TP"
config NSS_DRV_LAG_ENABLE config NSS_DRV_LAG_ENABLE
bool bool
default n default n
prompt "Enable LAG" prompt "Enable LAG"
config NSS_DRV_MAPT_ENABLE config NSS_DRV_MAPT_ENABLE
bool bool
default n default n
prompt "Enable MAPT" prompt "Enable MAPT"
config NSS_DRV_MATCH_ENABLE config NSS_DRV_MATCH_ENABLE
bool bool
default n default n
prompt "Enable MATCH" prompt "Enable MATCH"
config NSS_DRV_MIRROR_ENABLE config NSS_DRV_MIRROR_ENABLE
bool bool
default n default n
prompt "Enable MIRROR" prompt "Enable MIRROR"
config NSS_DRV_OAM_ENABLE config NSS_DRV_OAM_ENABLE
bool bool
default n default n
prompt "Enable OAM" prompt "Enable OAM"
config NSS_DRV_PORTID_ENABLE config NSS_DRV_PORTID_ENABLE
bool bool
default n default n
prompt "Enable PORTID" prompt "Enable PORTID"
config NSS_DRV_LSO_RX_ENABLE config NSS_DRV_LSO_RX_ENABLE
bool bool
default n default n
prompt "Enable LSO RX" prompt "Enable LSO RX"
config NSS_DRV_PPE_ENABLE
bool
default n
prompt "Enable PPE"
config NSS_DRV_PPPOE_ENABLE config NSS_DRV_PPPOE_ENABLE
bool bool
default n default n
prompt "Enable PPPOE" prompt "Enable PPPOE"
config NSS_DRV_PPTP_ENABLE config NSS_DRV_PPTP_ENABLE
bool bool
default y default y
prompt "Enable PPTP" prompt "Enable PPTP"
config NSS_DRV_PVXLAN_ENABLE config NSS_DRV_PVXLAN_ENABLE
bool bool
default n default n
prompt "Enable PVXLAN" prompt "Enable PVXLAN"
config NSS_DRV_QRFS_ENABLE config NSS_DRV_QRFS_ENABLE
bool bool
default n default n
prompt "Enable QRFS" prompt "Enable QRFS"
config NSS_DRV_QVPN_ENABLE config NSS_DRV_QVPN_ENABLE
bool bool
default n default n
prompt "Enable OpenVpn (QVPN)" prompt "Enable OpenVpn (QVPN)"
config NSS_DRV_RMNET_ENABLE config NSS_DRV_RMNET_ENABLE
bool bool
default n default n
prompt "Enable RMNET" prompt "Enable RMNET"
config NSS_DRV_SHAPER_ENABLE config NSS_DRV_SHAPER_ENABLE
bool bool
default n default n
prompt "Enable SHAPER" prompt "Enable SHAPER"
config NSS_DRV_SJACK_ENABLE config NSS_DRV_SJACK_ENABLE
bool bool
default n default n
prompt "Enable SJACK" prompt "Enable SJACK"
config NSS_DRV_TLS_ENABLE config NSS_DRV_TLS_ENABLE
bool bool
default n default n
prompt "Enable TLS" prompt "Enable TLS"
config NSS_DRV_TRUSTSEC_ENABLE config NSS_DRV_TRUSTSEC_ENABLE
bool bool
default n default n
prompt "Enable TRUSTSEC" prompt "Enable TRUSTSEC"
config NSS_DRV_UDP_ST_ENABLE config NSS_DRV_UDP_ST_ENABLE
bool bool
default n default n
prompt "Enable UDP Speedtest" prompt "Enable UDP Speedtest"
config NSS_DRV_TRUSTSEC_RX_ENABLE config NSS_DRV_TRUSTSEC_RX_ENABLE
bool bool
default n default n
prompt "Enable TRUSTSEC_RX" prompt "Enable TRUSTSEC_RX"
depends on NSS_DRV_TRUSTSEC_ENABLE depends on NSS_DRV_TRUSTSEC_ENABLE
config NSS_DRV_TSTAMP_ENABLE config NSS_DRV_TSTAMP_ENABLE
bool bool
default n default n
prompt "Enable TSTAMP" prompt "Enable TSTAMP"
config NSS_DRV_TUN6RD_ENABLE config NSS_DRV_TUN6RD_ENABLE
bool bool
default n default n
prompt "Enable TUN6RD" prompt "Enable TUN6RD"
config NSS_DRV_TUNIPIP6_ENABLE config NSS_DRV_TUNIPIP6_ENABLE
bool bool
default n default n
prompt "Enable TUNIPIP6" prompt "Enable TUNIPIP6"
config NSS_DRV_VIRT_IF_ENABLE config NSS_DRV_VIRT_IF_ENABLE
bool bool
default y default y
prompt "Enable VIRT_IF" prompt "Enable VIRT_IF"
config NSS_DRV_VLAN_ENABLE config NSS_DRV_VLAN_ENABLE
bool bool
default n default n
prompt "Enable VLAN" prompt "Enable VLAN"
config NSS_DRV_VXLAN_ENABLE config NSS_DRV_VXLAN_ENABLE
bool bool
default n default n
prompt "Enable VXLAN" prompt "Enable VXLAN"
config NSS_DRV_WIFIOFFLOAD_ENABLE config NSS_DRV_WIFIOFFLOAD_ENABLE
bool bool
default n default n
prompt "Enable WIFI" prompt "Enable WIFI"
config NSS_DRV_WIFI_EXT_VDEV_ENABLE config NSS_DRV_WIFI_EXT_VDEV_ENABLE
bool bool
default n default n
depends on NSS_DRV_WIFIOFFLOAD_ENABLE depends on NSS_DRV_WIFIOFFLOAD_ENABLE
prompt "Enable WIFI EXT VDEV" prompt "Enable WIFI EXT VDEV"
config NSS_DRV_WIFI_MESH_ENABLE config NSS_DRV_WIFI_MESH_ENABLE
bool bool
default n default n
depends on NSS_DRV_WIFIOFFLOAD_ENABLE depends on NSS_DRV_WIFIOFFLOAD_ENABLE
prompt "Enable WIFI MESH" prompt "Enable WIFI MESH"
config NSS_DRV_WIFI_LEGACY_ENABLE config NSS_DRV_WIFI_LEGACY_ENABLE
bool bool
default n default n

View File

@ -70,8 +70,9 @@ define KernelPackage/qca-nss-drv
SECTION:=kernel SECTION:=kernel
CATEGORY:=Kernel modules CATEGORY:=Kernel modules
SUBMENU:=Network Devices SUBMENU:=Network Devices
DEPENDS:=@(TARGET_qualcommax||TARGET_ipq60xx) +kmod-qca-nss-dp DEPENDS:=@(TARGET_ipq806x||TARGET_qualcommax||TARGET_ipq60xx) \
TITLE:=Qualcomm NSS core driver +!TARGET_ipq806x:kmod-qca-nss-dp
TITLE:=Kernel driver for NSS (core driver)
FILES:=$(PKG_BUILD_DIR)/qca-nss-drv.ko FILES:=$(PKG_BUILD_DIR)/qca-nss-drv.ko
AUTOLOAD:=$(call AutoLoad,32,qca-nss-drv) AUTOLOAD:=$(call AutoLoad,32,qca-nss-drv)
endef endef
@ -100,11 +101,13 @@ This package contains a NSS driver for QCA chipset
endef endef
ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x") ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x")
SOC="ipq807x_64" SOC="ipq807x_64"
subtarget:=$(CONFIG_TARGET_SUBTARGET) subtarget:=$(CONFIG_TARGET_SUBTARGET)
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx") else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
SOC="ipq60xx_64" SOC="ipq60xx_64"
subtarget:=$(SUBTARGET) subtarget:=$(CONFIG_TARGET_SUBTARGET)
else
SOC=$(CONFIG_TARGET_BOARD)
endif endif
define Build/InstallDev define Build/InstallDev
@ -122,17 +125,20 @@ EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac \
-I$(STAGING_DIR)/usr/include/qca-ssdk \ -I$(STAGING_DIR)/usr/include/qca-ssdk \
-Wno-unused-variable -Wno-unused-variable
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "qualcommax" "ipq60xx")) ifdef CONFIG_NSS_MEM_PROFILE_MEDIUM
EXTRA_CFLAGS+= -DNSS_MEM_PROFILE_MEDIUM EXTRA_CFLAGS += -DNSS_MEM_PROFILE_MEDIUM
else ifdef CONFIG_NSS_MEM_PROFILE_LOW
EXTRA_CFLAGS += -DNSS_MEM_PROFILE_LOW
endif endif
DRV_MAKE_OPTS:=
ifndef CONFIG_NSS_DRV_BRIDGE_ENABLE ifndef CONFIG_NSS_DRV_BRIDGE_ENABLE
DRV_MAKE_OPTS += NSS_DRV_BRIDGE_ENABLE=n DRV_MAKE_OPTS += NSS_DRV_BRIDGE_ENABLE=n
endif endif
ifneq ($(CONFIG_TARGET_BOARD), "ipq806x")
ifndef CONFIG_NSS_DRV_C2C_ENABLE ifndef CONFIG_NSS_DRV_C2C_ENABLE
DRV_MAKE_OPTS += NSS_DRV_C2C_ENABLE=n DRV_MAKE_OPTS += NSS_DRV_C2C_ENABLE=n
endif endif
endif
ifndef CONFIG_NSS_DRV_CLMAP_ENABLE ifndef CONFIG_NSS_DRV_CLMAP_ENABLE
DRV_MAKE_OPTS += NSS_DRV_CLMAP_ENABLE=n DRV_MAKE_OPTS += NSS_DRV_CLMAP_ENABLE=n
endif endif