nss: fix warnings and dependencies

* nssinfo:
  - Fix warnings related string formatting
* qca-nss-ecm:
  - Remove unnecessary dependency on `CONFIG_NSS_DRV_WIFIOFFLOAD_ENABLE`
* qca-nss-clients(netlink):
  - Fix regression in enabling wifil. It was rename to 'CONFIG_NSS_DRV_WIFIOFFLOAD_ENABLE'
    in qca-nss-drv vs 'CONFIG_NSS_DRV_WIFI_ENABLE'
  - Modularize Makefile to only build nludp_st on platform ipq95xx/ipq50xx
* qca-nss-clients(qdisc/igs):
  - fix build igs
* qca-nss-drv:
  - Remove options to configure `CONFIG_NSS_DRV_DMA_ENABLE` and `CONFIG_NSS_DRV_EDMA_ENABLE`.
    These are always built and required on ipq807x, ipq60xx
This commit is contained in:
Qosmio 2024-02-17 17:04:37 -05:00
parent 1c4870f402
commit 07bfcd93d6
7 changed files with 127 additions and 22 deletions

View File

@ -0,0 +1,35 @@
--- a/src/nssinfo.c
+++ b/src/nssinfo.c
@@ -160,7 +160,7 @@ void nssinfo_print_all(char *node, char
break;
}
- nssinfo_stats_print("%s_%-*s = %-20llu %-s\n",
+ nssinfo_stats_print("%s_%-*s = %-20lu %-s\n",
node, maxlen, stats_info[i].stats_name, stats_val[i], type);
}
}
@@ -277,12 +277,12 @@ void nssinfo_node_stats_destroy(pthread_
static char* nssinfo_add_comma(uint64_t num)
{
if (num < 1000) {
- snprintf(buf, sizeof(buf), "%llu", num);
+ snprintf(buf, sizeof(buf), "%lu", num);
return buf;
}
nssinfo_add_comma(num/1000);
- snprintf(buf + strlen(buf), sizeof(buf[NSSINFO_STR_LEN] + strlen(buf)), ",%03llu", num % 1000);
+ snprintf(buf + strlen(buf), sizeof(buf[NSSINFO_STR_LEN] + strlen(buf)), ",%03lu", num % 1000);
return buf;
}
@@ -293,7 +293,7 @@ static char* nssinfo_add_comma(uint64_t
static char* nssinfo_add_suffix(uint64_t num)
{
if (num < 1000) {
- snprintf(buf, sizeof(buf), "%llu", num);
+ snprintf(buf, sizeof(buf), "%lu", num);
return buf;
}

View File

@ -44,8 +44,9 @@ PKG_CONFIG_DEPENDS:=\
CONFIG_NSS_DRV_TUNIPIP6_ENABLE \
CONFIG_NSS_DRV_VLAN_ENABLE \
CONFIG_NSS_DRV_VXLAN_ENABLE \
CONFIG_NSS_DRV_WIFI_ENABLE \
CONFIG_NSS_DRV_WIFI_MESH_ENABLE
CONFIG_NSS_DRV_WIFIOFFLOAD_ENABLE \
CONFIG_NSS_DRV_WIFI_MESH_ENABLE \
CONFIG_NSS_DRV_WIFI_LEGACY_ENABLE
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
@ -56,6 +57,8 @@ ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x")
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
SOC="ipq60xx_64"
subtarget:=$(SUBTARGET)
else
SOC=$(CONFIG_TARGET_BOARD)
endif
ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64"))
@ -382,7 +385,7 @@ define KernelPackage/qca-nss-drv-netlink
DEPENDS:=+@NSS_DRV_C2C_ENABLE +@NSS_DRV_GRE_ENABLE +@NSS_DRV_GRE_REDIR_ENABLE \
+@NSS_DRV_IPV4_REASM_ENABLE +@NSS_DRV_IPV6_ENABLE +@NSS_DRV_IPV6_REASM_ENABLE \
+@NSS_DRV_RMNET_ENABLE +@NSS_DRV_OAM_ENABLE +@NSS_DRV_QRFS_ENABLE +@NSS_DRV_L2TP_ENABLE +@NSS_DRV_MAPT_ENABLE \
+@NSS_DRV_CAPWAP_ENABLE +@NSS_DRV_LSO_RX_ENABLE +@NSS_DRV_UDP_ST_ENABLE +@NSS_DRV_PPTP_ENABLE +@NSS_DRV_WIFI_LEGACY_ENABLE \
+@NSS_DRV_CAPWAP_ENABLE +@NSS_DRV_LSO_RX_ENABLE +@NSS_DRV_UDP_ST_ENABLE +@NSS_DRV_PPTP_ENABLE +@NSS_DRV_WIFIOFFLOAD_ENABLE +@NSS_DRV_WIFI_LEGACY_ENABLE \
+@NSS_DRV_PPPOE_ENABLE \
+kmod-qca-nss-drv \
+kmod-ppp \
@ -520,7 +523,7 @@ define KernelPackage/qca-nss-drv-mscs
CATEGORY:=Kernel modules
SUBMENU:=Network Devices
TITLE:=Module to interface wlan host driver and ECM MSCS classifier.
DEPENDS:=@TARGET_ipq95xx +@NSS_DRV_WIFI_ENABLE \
DEPENDS:=@TARGET_ipq95xx +@NSS_DRV_WIFIOFFLOAD_ENABLE \
+kmod-qca-nss-drv
FILES:=$(PKG_BUILD_DIR)/mscs/qca-nss-mscs.ko
endef

View File

@ -0,0 +1,44 @@
--- a/netlink/Makefile
+++ b/netlink/Makefile
@@ -27,7 +27,6 @@ ccflags-y += -DCONFIG_NSS_NLPPTP=1
ccflags-y += -DCONFIG_NSS_NLCAPWAP=${CAPWAP_ENABLED}
ccflags-y += -DCONFIG_NSS_NLIPSEC=${IPSEC_ENABLED}
ccflags-y += -DCONFIG_NSS_NLDTLS=${DTLS_ENABLED}
-ccflags-y += -DCONFIG_NSS_NLUDP_ST=1
qca-nss-netlink-objs := nss_nl.o
qca-nss-netlink-objs += nss_nlgre_redir_family.o
@@ -49,7 +48,6 @@ qca-nss-netlink-objs += nss_nlmap_t.o
qca-nss-netlink-objs += nss_nlpppoe.o
qca-nss-netlink-objs += nss_nll2tpv2.o
qca-nss-netlink-objs += nss_nlpptp.o
-qca-nss-netlink-objs += nss_nludp_st.o
qca-nss-netlink-objs += nss_nlqrfs.o
ifneq (,$(filter $(capwapmgr), y))
@@ -81,4 +79,11 @@ else
ccflags-y += -DCONFIG_NSS_NLEDMA=0
endif
+ifeq ($(SoC),$(filter $(SoC),ipq95xx ipq50xx))
+ccflags-y += -DCONFIG_NSS_NLUDP_ST=1
+qca-nss-netlink-objs += nss_nludp_st.o
+else
+ccflags-y += -DCONFIG_NSS_NLUDP_ST=0
+endif
+
obj-m += qca-nss-netlink.o
--- a/netlink/nss_nludp_st.h
+++ b/netlink/nss_nludp_st.h
@@ -23,10 +23,9 @@
#ifndef __NSS_NLUDP_ST_H
#define __NSS_NLUDP_ST_H
+#if defined(CONFIG_NSS_NLUDP_ST) && CONFIG_NSS_NLUDP_ST > 0
bool nss_nludp_st_init(void);
bool nss_nludp_st_exit(void);
-
-#if defined(CONFIG_NSS_NLUDP_ST)
#define NSS_NLUDP_ST_INIT nss_nludp_st_init
#define NSS_NLUDP_ST_EXIT nss_nludp_st_exit
#else

View File

@ -56,11 +56,6 @@ config NSS_DRV_DTLS_ENABLE
default n
prompt "Enable DTLS"
config NSS_DRV_EDMA_ENABLE
bool
default n
prompt "Enable EDMA"
config NSS_DRV_GRE_ENABLE
bool
default n

View File

@ -18,9 +18,7 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_NSS_DRV_C2C_ENABLE \
CONFIG_NSS_DRV_CLMAP_ENABLE \
CONFIG_NSS_DRV_CRYPTO_ENABLE \
CONFIG_NSS_DRV_DMA_ENABLE \
CONFIG_NSS_DRV_DTLS_ENABLE \
CONFIG_NSS_DRV_EDMA_ENABLE \
CONFIG_NSS_DRV_GRE_ENABLE \
CONFIG_NSS_DRV_GRE_REDIR_ENABLE \
CONFIG_NSS_DRV_GRE_TUNNEL_ENABLE \
@ -117,8 +115,7 @@ ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64
endif
endef
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac \
-I$(STAGING_DIR)/usr/include/qca-nss-dp \
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-dp \
-I$(STAGING_DIR)/usr/include/qca-ssdk \
-Wno-unused-variable
@ -148,18 +145,10 @@ ifndef CONFIG_NSS_DRV_CRYPTO_ENABLE
DRV_MAKE_OPTS += NSS_DRV_CRYPTO_ENABLE=n
endif
ifndef CONFIG_NSS_DRV_DMA_ENABLE
DRV_MAKE_OPTS += NSS_DRV_DMA_ENABLE=n
endif
ifndef CONFIG_NSS_DRV_DTLS_ENABLE
DRV_MAKE_OPTS += NSS_DRV_DTLS_ENABLE=n
endif
ifndef CONFIG_NSS_DRV_EDMA_ENABLE
DRV_MAKE_OPTS += NSS_DRV_EDMA_ENABLE=n
endif
ifndef CONFIG_NSS_DRV_GRE_ENABLE
ifndef CONFIG_PACKAGE_kmod-gre
DRV_MAKE_OPTS += NSS_DRV_GRE_ENABLE=n

View File

@ -0,0 +1,40 @@
--- a/nss_igs.c
+++ b/nss_igs.c
@@ -163,7 +163,7 @@ EXPORT_SYMBOL(nss_igs_register_if);
* nss_igs_get_context()
* Get the IGS context.
*/
-struct nss_ctx_instance *nss_igs_get_context()
+struct nss_ctx_instance *nss_igs_get_context(void)
{
return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.igs_handler_id];
}
@@ -177,8 +177,9 @@ EXPORT_SYMBOL(nss_igs_get_context);
void nss_igs_module_save(struct tc_action_ops *act, struct module *module)
{
nss_assert(act);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
nss_assert(act->type == TCA_ACT_MIRRED_NSS);
-
+#endif
nss_igs_module = module;
}
EXPORT_SYMBOL(nss_igs_module_save);
@@ -188,7 +189,7 @@ EXPORT_SYMBOL(nss_igs_module_save);
* nss_igs_module_get()
* Get the ingress shaping module reference.
*/
-bool nss_igs_module_get()
+bool nss_igs_module_get(void)
{
nss_assert(nss_igs_module);
return try_module_get(nss_igs_module);
@@ -199,7 +200,7 @@ EXPORT_SYMBOL(nss_igs_module_get);
* nss_igs_module_put()
* Release the ingress shaping module reference.
*/
-void nss_igs_module_put()
+void nss_igs_module_put(void)
{
nss_assert(nss_igs_module);
module_put(nss_igs_module);

View File

@ -23,7 +23,6 @@ define KernelPackage/qca-nss-ecm
DEPENDS:=@(TARGET_qualcommax||TARGET_ipq60xx) \
+@NSS_DRV_IPV6_ENABLE \
+@NSS_DRV_VIRT_IF_ENABLE \
+@NSS_DRV_WIFI_ENABLE \
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
+kmod-nf-conntrack \
+PACKAGE_kmod-qca-mcs:kmod-qca-mcs \