treewide: Initial support for kernel 6.12 + GCC 15.1

Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
Sean Khan 2025-05-08 22:49:15 -04:00
parent aeca10fbca
commit 6f823a2b34
24 changed files with 4493 additions and 41 deletions

View File

@ -1,6 +1,6 @@
--- a/mc_snooping.c
+++ b/mc_snooping.c
@@ -3112,7 +3112,6 @@ static void mc_mdb_cleanup(unsigned long
@@ -3105,7 +3105,6 @@ static void mc_mdb_cleanup(unsigned long
os_hlist_for_each_entry_rcu(mdb, mdbh, &mc->hash[i], hlist) {
struct mc_port_group *pg;
struct hlist_node *pgh;
@ -8,7 +8,7 @@
unsigned long expire_time = mc->membership_interval;
if (hlist_empty(&mdb->pslist)) {
@@ -3147,7 +3146,6 @@ static void mc_mdb_cleanup(unsigned long
@@ -3140,7 +3139,6 @@ static void mc_mdb_cleanup(unsigned long
else if (time_before(this_timer, next_timer))
next_timer = this_timer;
}

View File

@ -1,6 +1,6 @@
--- a/mc_osdep.h
+++ b/mc_osdep.h
@@ -25,7 +25,11 @@
@@ -24,7 +24,11 @@
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
static inline int os_br_pass_frame_up(struct sk_buff *skb)
{

View File

@ -0,0 +1,120 @@
--- a/mc_forward.c
+++ b/mc_forward.c
@@ -29,6 +29,9 @@
#include "mc_snooping.h"
#include "mc_osdep.h"
+int mc_forward_init(void) __maybe_unused;
+void mc_forward_exit(void) __maybe_unused;
+
static void mc_retag(void *iph, __be16 etype, __be32 dscp)
{
__be32 _dscp = MC_DSCP(dscp);
--- a/mc_netfilter.c
+++ b/mc_netfilter.c
@@ -26,6 +26,7 @@
#include "mc_private.h"
#include "mc_api.h"
#include "mc_osdep.h"
+#include "mc_netfilter.h"
/* mc_br_port_get
* get bridge port by ifindex
@@ -49,15 +50,15 @@ static struct net_bridge_port *mc_br_por
/* mc_pre_routing_hook
* prerouting hook
*/
-static unsigned int mc_pre_routing_hook(void *priv,
+unsigned int mc_pre_routing_hook(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
-static unsigned int mc_pre_routing_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
+unsigned int mc_pre_routing_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
int(*okfn)(struct sk_buff *))
#else
-static unsigned int mc_pre_routing_hook(unsigned int hooknum, struct sk_buff *skb,
+unsigned int mc_pre_routing_hook(unsigned int hooknum, struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
int(*okfn)(struct sk_buff *))
#endif
@@ -233,15 +234,15 @@ static bool mc_is_report_or_leave(struct
/* mc_forward_hook
* forward hook to the linux kernel
*/
-static unsigned int mc_forward_hook(void *priv,
+unsigned int mc_forward_hook(void *priv,
struct sk_buff *skb,
const struct nf_hook_state *state)
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
-static unsigned int mc_forward_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
+unsigned int mc_forward_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
int(*okfn)(struct sk_buff *))
#else
-static unsigned int mc_forward_hook(unsigned int hooknum, struct sk_buff *skb,
+unsigned int mc_forward_hook(unsigned int hooknum, struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
int(*okfn)(struct sk_buff *))
#endif
--- a/mc_netfilter.h
+++ b/mc_netfilter.h
@@ -23,7 +23,15 @@ void mc_netfilter_exit(void);
#include <linux/netfilter.h>
#include <linux/netdevice.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0))
+unsigned int mc_pre_routing_hook(void *priv,
+ struct sk_buff *skb,
+ const struct nf_hook_state *state);
+
+unsigned int mc_forward_hook(void *priv,
+ struct sk_buff *skb,
+ const struct nf_hook_state *state);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0))
unsigned int mc_pre_routing_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
const struct net_device *in, const struct net_device *out,
int(*okfn)(struct sk_buff *));
--- a/mc_snooping.c
+++ b/mc_snooping.c
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/spinlock.h>
@@ -28,7 +29,11 @@
#include <linux/etherdevice.h>
#include <linux/rculist.h>
#include <linux/timer.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+#include <linux/unaligned.h>
+#else
#include <asm/unaligned.h>
+#endif
#include <asm/atomic.h>
#include <linux/random.h>
#include <net/ip.h>
@@ -3240,7 +3245,6 @@ static void mc_acl_table_init(struct mc_
mc->mld_acl.pattern_count = 4;
#endif
- return;
}
/* mc_event_delay
--- a/mc_snooping.h
+++ b/mc_snooping.h
@@ -44,6 +44,8 @@ void mc_detach(struct net_device *dev);
int mc_has_more_instance(void);
+int mc_proc_create_snooper_entry(void);
+
extern void mc_nbp_change(struct mc_struct *mc, struct net_device *dev, int event);
extern void mc_fdb_change(__u8 *mac, int change);

View File

@ -0,0 +1,143 @@
--- a/cryptoapi/v2.0/nss_cryptoapi.c
+++ b/cryptoapi/v2.0/nss_cryptoapi.c
@@ -37,6 +37,9 @@
#include <linux/debugfs.h>
#include <linux/completion.h>
#include <linux/of.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0))
+#include <linux/vmalloc.h>
+#endif
#include <crypto/aes.h>
#include <crypto/des.h>
@@ -1849,6 +1852,12 @@ static struct ahash_alg cryptoapi_ahash_
},
};
+/*-------------------------------------------------------------
+ * Prototypes
+ *-------------------------------------------------------------
+ */
+bool nss_cryptoapi_is_registered(void);
+
/*
* nss_cryptoapi_copy_reverse()
* Reverse copy
@@ -1946,7 +1955,7 @@ struct nss_cryptoapi_algo_info *nss_cryp
* nss_cryptoapi_cra_name_lookup()
* Lookup the associated algorithm in NSS for the given transformation by name
*/
-struct nss_cryptoapi_algo_info *nss_cryptoapi_cra_name_lookup(const char *cra_name)
+static struct nss_cryptoapi_algo_info *nss_cryptoapi_cra_name_lookup(const char *cra_name)
{
struct nss_cryptoapi_algo_info *info = g_algo_info;
int i;
@@ -2117,7 +2126,7 @@ skip_iv:
* nss_cryptoapi_ctx_stats_read()
* CryptoAPI context statistics read function
*/
-ssize_t nss_cryptoapi_ctx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos)
+static ssize_t nss_cryptoapi_ctx_stats_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos)
{
struct nss_cryptoapi_ctx *ctx = fp->private_data;
struct nss_cryptoapi_stats *stats = &ctx->stats;
@@ -2169,7 +2178,7 @@ ssize_t nss_cryptoapi_ctx_stats_read(str
* nss_cryptoapi_ctx_info_read()
* CryptoAPI context info read function
*/
-ssize_t nss_cryptoapi_ctx_info_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos)
+static ssize_t nss_cryptoapi_ctx_info_read(struct file *fp, char __user *ubuf, size_t sz, loff_t *ppos)
{
struct nss_cryptoapi_ctx *ctx = fp->private_data;
ssize_t max_buf_len;
@@ -2244,7 +2253,7 @@ void nss_cryptoapi_add_ctx2debugfs(struc
* nss_cryptoapi_attach_user()
* register crypto core with the cryptoapi CFI
*/
-void nss_cryptoapi_attach_user(void *app_data, struct nss_crypto_user *user)
+static void nss_cryptoapi_attach_user(void *app_data, struct nss_crypto_user *user)
{
struct skcipher_alg *skcipher = cryptoapi_skcipher_algs;
struct aead_alg *aead = cryptoapi_aead_algs;
@@ -2312,7 +2321,7 @@ void nss_cryptoapi_attach_user(void *app
* nss_cryptoapi_detach_user()
* Unregister crypto core with cryptoapi CFI layer
*/
-void nss_cryptoapi_detach_user(void *app_data, struct nss_crypto_user *user)
+static void nss_cryptoapi_detach_user(void *app_data, struct nss_crypto_user *user)
{
struct skcipher_alg *skcipher = cryptoapi_skcipher_algs;
struct aead_alg *aead = cryptoapi_aead_algs;
@@ -2378,7 +2387,7 @@ EXPORT_SYMBOL(nss_cryptoapi_is_registere
* nss_cryptoapi_init()
* Initializing crypto core layer
*/
-int nss_cryptoapi_init(void)
+static int nss_cryptoapi_init(void)
{
nss_cfi_info("module loaded %s\n", NSS_CFI_BUILD_ID);
@@ -2408,7 +2417,7 @@ int nss_cryptoapi_init(void)
* nss_cryptoapi_exit()
* De-Initialize cryptoapi CFI layer
*/
-void nss_cryptoapi_exit(void)
+static void nss_cryptoapi_exit(void)
{
if (g_cryptoapi.user)
nss_crypto_unregister_user(g_cryptoapi.user);
--- a/cryptoapi/v2.0/nss_cryptoapi_aead.c
+++ b/cryptoapi/v2.0/nss_cryptoapi_aead.c
@@ -386,7 +386,7 @@ int nss_cryptoapi_aead_setauthsize(struc
* nss_cryptoapi_aead_done()
* Cipher/Auth encrypt request completion callback function
*/
-void nss_cryptoapi_aead_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t status)
+static void nss_cryptoapi_aead_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t status)
{
struct aead_request *req = (struct aead_request *)app_data;
struct crypto_aead *aead = crypto_aead_reqtfm(req);
--- a/cryptoapi/v2.0/nss_cryptoapi_ahash.c
+++ b/cryptoapi/v2.0/nss_cryptoapi_ahash.c
@@ -87,6 +87,12 @@ extern struct nss_cryptoapi g_cryptoapi;
#endif /* NSS_CFI_DEBUG */
+/*-------------------------------------------------------------
+ * Prototype
+ *-------------------------------------------------------------
+ */
+int nss_cryptoapi_ahash_ctx2session(struct crypto_ahash *ahash, uint32_t *sid);
+
/*
* nss_cryptoapi_ahash_ctx2session()
* Cryptoapi function to get the session ID for an AHASH
@@ -234,7 +240,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
* nss_cryptoapi_ahash_done()
* Hash request completion callback function
*/
-void nss_cryptoapi_ahash_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t status)
+static void nss_cryptoapi_ahash_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t status)
{
struct ahash_request *req = app_data;
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
@@ -476,8 +482,6 @@ static void nss_cryptoapi_ahash_finup_do
req->base.complete = rctx->complete;
req->base.data = rctx->data;
ahash_request_complete(req, err);
-
- return;
}
/*
--- a/cryptoapi/v2.0/nss_cryptoapi_skcipher.c
+++ b/cryptoapi/v2.0/nss_cryptoapi_skcipher.c
@@ -201,7 +201,7 @@ int nss_cryptoapi_skcipher_setkey(struct
* nss_cryptoapi_skcipher_done()
* Cipher operation completion callback function
*/
-void nss_cryptoapi_skcipher_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t status)
+static void nss_cryptoapi_skcipher_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t status)
{
struct skcipher_request *req = app_data;
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(req->base.tfm);

View File

@ -810,12 +810,16 @@ ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr),)
NSS_CLIENTS_MAKE_OPTS+=wifi-meshmgr=y
endif
EXTRA_CFLAGS+= -Wno-incompatible-pointer-types \
-Wno-missing-prototypes -Wno-int-conversion \
-Wno-missing-declarations
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)" \
EXTRA_CFLAGS="$(EXTRA_CFLAGS) -include $(PKG_BUILD_DIR)/compat.h" \
DTLSMGR_DIR="$(DTLSMGR_DIR)" \
IPSECMGR_DIR="$(IPSECMGR_DIR)" \
SoC=$(SOC) \

View File

@ -260,7 +260,7 @@
return -EFAULT;
--- a/netlink/nss_nl.c
+++ b/netlink/nss_nl.c
@@ -463,7 +463,11 @@ struct nss_nlcmn *nss_nl_get_msg(struct
@@ -462,7 +462,11 @@ struct nss_nlcmn *nss_nl_get_msg(struct
/*
* validate the common message header version & magic
*/

View File

@ -0,0 +1,720 @@
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,9 @@ qca-nss-tun6rd-objs := nss_connmgr_tun6r
ccflags-y += -DNSS_TUN6RD_DEBUG_LEVEL=0
ccflags-y += -Wall -Werror
+# Kernel 6.12 compatibility
+ccflags-y += -Wno-missing-prototypes -include $(src)/compat.h
+
KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
obj-$(bridge-mgr)+= bridge/
--- a/bridge/nss_bridge_mgr.c
+++ b/bridge/nss_bridge_mgr.c
@@ -1486,7 +1486,7 @@ static struct notifier_block nss_bridge_
* nss_bridge_mgr_wan_inf_add_handler
* Marks an interface as a WAN interface for special handling by bridge.
*/
-static int nss_bridge_mgr_wan_intf_add_handler(struct ctl_table *table,
+static int nss_bridge_mgr_wan_intf_add_handler(compat_const struct ctl_table *table,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1535,7 +1535,7 @@ static int nss_bridge_mgr_wan_intf_add_h
* nss_bridge_mgr_wan_inf_del_handler
* Un-marks an interface as a WAN interface.
*/
-static int nss_bridge_mgr_wan_intf_del_handler(struct ctl_table *table,
+static int nss_bridge_mgr_wan_intf_del_handler(compat_const struct ctl_table *table,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
--- a/dtls/v2.0/nss_dtlsmgr_ctx_dev.c
+++ b/dtls/v2.0/nss_dtlsmgr_ctx_dev.c
@@ -284,7 +284,11 @@ void nss_dtlsmgr_ctx_dev_rx_outer(struct
skb_set_transport_header(skb, sizeof(struct iphdr));
iph = ip_hdr(skb);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_dtlsmgr_warn("%px: No IPv4 route or out dev", dev);
dev_kfree_skb_any(skb);
--- a/gre/nss_connmgr_gre.c
+++ b/gre/nss_connmgr_gre.c
@@ -40,6 +40,12 @@
#define MAX_RETRY_COUNT 100
#define MAX_WIFI_HEADROOM 66
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#define TUNNEL_CSUM IP_TUNNEL_CSUM_BIT
+#define TUNNEL_SEQ IP_TUNNEL_SEQ_BIT
+#define TUNNEL_KEY IP_TUNNEL_KEY_BIT
+#endif
+
/*
* GRE connection manager context structure
*/
@@ -186,7 +192,12 @@ static int nss_connmgr_gre_dev_init(stru
if ((dev->priv_flags_ext & IFF_EXT_GRE_V4_TAP) || (dev->type == ARPHRD_IPGRE)) {
dev->needed_headroom = sizeof(struct iphdr) + sizeof(struct ethhdr) + MAX_WIFI_HEADROOM + append;
dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr) - append;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+#else
+ dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+ dev->netns_local = true;
+#endif
dev->hw_features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
return 0;
}
@@ -200,7 +211,11 @@ static int nss_connmgr_gre_dev_init(stru
dev->mtu = IPV6_MIN_MTU;
}
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
dev->features |= NETIF_F_NETNS_LOCAL;
+#else
+ dev->netns_local = true;
+#endif
return 0;
}
@@ -211,7 +226,6 @@ static int nss_connmgr_gre_dev_init(stru
static void nss_connmgr_gre_dev_uninit(struct net_device *dev)
{
free_percpu(dev->tstats);
- return;
}
/*
@@ -578,7 +592,6 @@ static void nss_connmgr_gre_tap_inner_ex
*/
skb->protocol = eth_type_trans(skb, dev);
netif_receive_skb(skb);
- return;
}
/*
@@ -724,10 +737,10 @@ static void nss_connmgr_gre_make_name(st
{
switch (cfg->mode) {
case GRE_MODE_TUN:
- strlcpy(name, "tun-%d", IFNAMSIZ);
+ strscpy(name, "tun-%d", IFNAMSIZ);
break;
case GRE_MODE_TAP:
- strlcpy(name, "tap-%d", IFNAMSIZ);
+ strscpy(name, "tap-%d", IFNAMSIZ);
break;
default:
break;
@@ -757,7 +770,7 @@ static struct net_device *__nss_connmgr_
int ret = -1, retry, next_if_num_inner = 0, next_if_num_outer = 0;
if (cfg->name) {
- strlcpy(name, cfg->name, IFNAMSIZ);
+ strscpy(name, cfg->name, IFNAMSIZ);
} else {
nss_connmgr_gre_make_name(cfg, name);
}
--- a/gre/nss_connmgr_gre_v4.c
+++ b/gre/nss_connmgr_gre_v4.c
@@ -45,7 +45,11 @@ static struct net_device *nss_connmgr_gr
struct net_device *dev;
uint32_t ip_addr __attribute__ ((unused)) = ntohl(dest_ip);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, htonl(dest_ip), 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, htonl(dest_ip), 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_connmgr_gre_warning("Unable to lookup route for %pI4\n", &ip_addr);
return NULL;
@@ -87,7 +91,11 @@ static int nss_connmgr_gre_v4_get_mac_ad
dev_put(local_dev);
nss_connmgr_gre_info("Src MAC address for %pI4 is %pM\n", &laddr, src_mac);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, raddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, raddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_connmgr_gre_warning("route look up failed for %pI4\n", &raddr);
return GRE_ERR_RADDR_ROUTE_LOOKUP;
@@ -210,7 +218,7 @@ int nss_connmgr_gre_v4_set_config(struct
nss_connmgr_gre_set_gre_flags(cfg, &t->parms.o_flags, &t->parms.i_flags);
- strlcpy(t->parms.name, dev->name, IFNAMSIZ);
+ strscpy(t->parms.name, dev->name, IFNAMSIZ);
t->dev = dev;
return GRE_SUCCESS;
}
--- a/ipsecmgr/v1.0/nss_ipsecmgr.c
+++ b/ipsecmgr/v1.0/nss_ipsecmgr.c
@@ -526,7 +526,11 @@ static struct net_device *nss_ipsecmgr_t
}
if (!is_encap) {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
--- a/ipsecmgr/v1.0/nss_ipsecmgr_flow.c
+++ b/ipsecmgr/v1.0/nss_ipsecmgr_flow.c
@@ -915,7 +915,11 @@ bool nss_ipsecmgr_flow_process_pmtu(stru
if (unlikely(skb_dst(skb)))
goto send_icmp;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ip_hdr(skb)->daddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ip_hdr(skb)->daddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return false;
}
--- a/ipsecmgr/v2.0/nss_ipsecmgr_ctx.c
+++ b/ipsecmgr/v2.0/nss_ipsecmgr_ctx.c
@@ -230,7 +230,11 @@ static void nss_ipsecmgr_ctx_notify_ipv4
* flow that coming in for the first time. We should query
* the Linux to see the associated NETDEV
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
dev_kfree_skb_any(skb);
ctx->hstats.v4_notify_drop++;
@@ -258,7 +262,11 @@ static void nss_ipsecmgr_ctx_route_ipv4(
struct iphdr *iph = ip_hdr(skb);
struct rtable *rt;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ipsecmgr_warn("%pK: No route, drop packet.\n", skb);
dev_kfree_skb_any(skb);
--- a/ipsecmgr/v2.0/plugins/xfrm/nss_ipsec_xfrm_tunnel.c
+++ b/ipsecmgr/v2.0/plugins/xfrm/nss_ipsec_xfrm_tunnel.c
@@ -149,7 +149,11 @@ static void nss_ipsec_xfrm_tunnel_rx_out
if (ip_hdr(skb)->version == IPVERSION) {
struct iphdr *iph = ip_hdr(skb);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
struct rtable *rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0);
+#else
+ struct rtable *rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ipsec_xfrm_warn("%px: Failed to handle ipv4 exception after encap; No route\n", skb);
goto drop;
@@ -285,7 +289,11 @@ struct nss_ipsec_xfrm_tunnel *nss_ipsec_
switch (family) {
case AF_INET:
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, remote->a4, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, remote->a4, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_ipsec_xfrm_err("%p:Failed to allocate tunnel; No IPv4 dst found\n", drv);
return NULL;
--- a/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
+++ b/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
@@ -319,7 +319,7 @@ static struct nss_connmgr_l2tpv2_session
*/
dev_hold(dev);
l2tpv2_session_data->dev = dev;
- strlcpy(session->ifname, dev->name, IFNAMSIZ);
+ strscpy(session->ifname, dev->name, IFNAMSIZ);
/*
* There is no need for protecting simultaneous addition &
@@ -417,7 +417,11 @@ static void nss_connmgr_l2tpv2_exception
/*
* set skb_iif
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph_inner->saddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph_inner->saddr, 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_connmgr_l2tpv2_warning("Martian packets !!!");
} else {
@@ -865,7 +869,7 @@ EXPORT_SYMBOL(l2tpmgr_unregister_ipsecmg
* nss_connmgr_l2tpv2_proc_handler()
* Read and write handler for sysctl.
*/
-static int nss_connmgr_l2tpv2_proc_handler(struct ctl_table *ctl,
+static int nss_connmgr_l2tpv2_proc_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
--- a/l2tp/l2tpv2/nss_l2tpv2_stats.c
+++ b/l2tp/l2tpv2/nss_l2tpv2_stats.c
@@ -129,7 +129,11 @@ void nss_l2tpv2_update_dev_stats(struct
dev_put(dev);
return;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
session = l2tp_tunnel_get_session(tunnel, data.l2tpv2.session.session_id);
+#else
+ session = l2tp_v2_session_get(dev_net(dev), data.l2tpv2.tunnel.tunnel_id, data.l2tpv2.session.session_id);
+#endif
if (!session) {
tunnel_put(tunnel);
dev_put(dev);
--- a/match/nss_match_cmd.c
+++ b/match/nss_match_cmd.c
@@ -124,7 +124,7 @@ static enum nss_match_profile_type nss_m
* nss_match_cmd_procfs_config_handler()
* Handles command input by user to create and configure match instance.
*/
-static int nss_match_cmd_procfs_config_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_config_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
char *command_str, *token, *param, *value;
char *input_msg, *input_msg_orig;
@@ -451,7 +451,7 @@ fail:
* nss_match_cmd_procfs_reset_nexthop
* Reset to default nexthop of an interface
*/
-static int nss_match_cmd_procfs_reset_nexthop(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_reset_nexthop(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct net_device *dev;
uint32_t if_num, type = 0;
@@ -521,7 +521,7 @@ static int nss_match_cmd_procfs_reset_ne
* Set next hop of an interface to a match instance.
* Only VAP and physical interfaces are supported as of now.
*/
-static int nss_match_cmd_procfs_set_if_nexthop(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_set_if_nexthop(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct net_device *dev;
uint32_t if_num, type = 0;
@@ -632,7 +632,7 @@ static int nss_match_cmd_procfs_set_if_n
* nss_match_cmd_procfs_read_help()
* Display help for commands.
*/
-static int nss_match_cmd_procfs_read_help(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_read_help(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
--- a/mirror/nss_mirror_ctl.c
+++ b/mirror/nss_mirror_ctl.c
@@ -132,7 +132,7 @@ static int nss_mirror_ctl_get_netdev_by_
{
char dev_name[IFNAMSIZ] = {0};
- strlcpy(dev_name, name, IFNAMSIZ);
+ strscpy(dev_name, name, IFNAMSIZ);
if (dev_name[strlen(dev_name) - 1] == '\n') {
dev_name[strlen(dev_name) - 1] = '\0';
}
@@ -357,7 +357,7 @@ static int nss_mirror_ctl_parse_display_
return -1;
}
- strlcpy(dev_name, value, IFNAMSIZ);
+ strscpy(dev_name, value, IFNAMSIZ);
if (dev_name[strlen(dev_name) - 1] == '\n') {
dev_name[strlen(dev_name) - 1] = '\0';
}
@@ -754,7 +754,7 @@ static int32_t nss_mirror_ctl_parse_cmd(
* nss_mirror_ctl_config_handler()
* Mirror sysctl config handler.
*/
-static int nss_mirror_ctl_config_handler(struct ctl_table *ctl, int write,
+static int nss_mirror_ctl_config_handler(compat_const struct ctl_table *ctl, int write,
void __user *buf, size_t *lenp, loff_t *ppos)
{
char *buffer, *pfree;
--- a/netlink/nss_nlipv4.c
+++ b/netlink/nss_nlipv4.c
@@ -129,7 +129,11 @@ static struct neighbour *nss_nlipv4_get_
/*
* search for route entry
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ip_addr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ip_addr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
--- a/netlink/nss_nludp_st.c
+++ b/netlink/nss_nludp_st.c
@@ -446,7 +446,11 @@ static struct neighbour *nss_nludp_st_ge
/*
* search for route entry
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ip_addr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ip_addr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
--- a/nss_qdisc/nss_bf.c
+++ b/nss_qdisc/nss_bf.c
@@ -385,7 +385,11 @@ static int nss_bf_graft_class(struct Qdi
*/
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = cl->nq.qos_tag;
if (nss_qdisc_node_detach(&cl->nq, nq_old, &nim_detach,
--- a/nss_qdisc/nss_qdisc.c
+++ b/nss_qdisc/nss_qdisc.c
@@ -375,7 +375,7 @@ static int nss_qdisc_refresh_bshaper_ass
br_update.port_list_count = 0;
br_update.unassign_count = 0;
- read_lock(&dev_base_lock);
+ /* read_lock(&dev_base_lock); */
dev = first_net_device(&init_net);
while(dev) {
@@ -422,7 +422,7 @@ static int nss_qdisc_refresh_bshaper_ass
nextdev:
dev = next_net_device(dev);
}
- read_unlock(&dev_base_lock);
+ /* read_unlock(&dev_base_lock); */
nss_qdisc_info("List count %d\n", br_update.port_list_count);
--- a/nss_qdisc/nss_tbl.c
+++ b/nss_qdisc/nss_tbl.c
@@ -360,7 +360,11 @@ static int nss_tbl_graft(struct Qdisc *s
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = q->nq.qos_tag;
if (nss_qdisc_node_detach(&q->nq, nq_old, &nim_detach,
--- a/openvpn/plugins/nss_ovpn_sk.c
+++ b/openvpn/plugins/nss_ovpn_sk.c
@@ -225,7 +225,11 @@ static int nss_ovpn_sk_update_ipv4_tuple
{
struct rtable *rt;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(dev_net(pinfo->dev), tun_data->tun_hdr.dst_ip[0], 0, 0, 0);
+#else
+ rt = ip_route_output(dev_net(pinfo->dev), tun_data->tun_hdr.dst_ip[0], 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ovpn_sk_warn("%px: Failed to find IPv4 route.\n", pinfo);
return -EINVAL;
--- a/openvpn/src/nss_ovpnmgr_tun.c
+++ b/openvpn/src/nss_ovpnmgr_tun.c
@@ -69,7 +69,11 @@ static void nss_ovpnmgr_tun_ipv4_forward
skb_reset_network_header(skb);
iph = ip_hdr(skb);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(dev_net(app->dev), iph->daddr, iph->saddr, 0, 0);
+#else
+ rt = ip_route_output(dev_net(app->dev), iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ovpnmgr_warn("%px: Failed to find IPv4 route.\n", skb);
tun->outer.stats.host_pkt_drop++;
--- a/tunipip6/nss_connmgr_tunipip6.c
+++ b/tunipip6/nss_connmgr_tunipip6.c
@@ -174,7 +174,11 @@ static void nss_tunipip6_encap_exception
nss_tunipip6_info("%px: received - %d bytes name %s ver %x\n",
skb, skb->len, dev->name, iph->version);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_tunipip6_info("%px: Failed to find IPv4 route for dest %pI4 src %pI4\n", skb, &iph->daddr, &iph->saddr);
dev_kfree_skb_any(skb);
@@ -283,7 +287,11 @@ static void nss_tunipip6_decap_exception
iph = ip_hdr(skb);
nss_tunipip6_assert(iph->version == 4);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_tunipip6_info("%px: Failed to find IPv4 route for %pI4\n", skb, &iph->daddr);
dev_kfree_skb_any(skb);
--- a/tunipip6/nss_connmgr_tunipip6_sysctl.c
+++ b/tunipip6/nss_connmgr_tunipip6_sysctl.c
@@ -52,7 +52,7 @@ enum nss_tunipip6_sysctl_mode {
};
-static int nss_tunipip6_data_parser(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos, enum nss_tunipip6_sysctl_mode mode)
+static int nss_tunipip6_data_parser(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos, enum nss_tunipip6_sysctl_mode mode)
{
char dev_name[NETDEV_STR_LEN] = {0}, ipv6_prefix_str[PREFIX_STR_LEN] = {0}, ipv6_suffix_str[PREFIX_STR_LEN] = {0}, ipv4_prefix_str[PREFIX_STR_LEN] = {0};
uint32_t ipv6_prefix[4], ipv6_prefix_len, ipv6_suffix[4], ipv6_suffix_len, ipv4_prefix, ipv4_prefix_len, ea_len, psid_offset;
@@ -108,7 +108,7 @@ static int nss_tunipip6_data_parser(stru
*/
if (!strcmp(param, "netdev")) {
- strlcpy(dev_name, value, 30);
+ strscpy(dev_name, value, 30);
dev = dev_get_by_name(&init_net, dev_name);
if (!dev) {
kfree(pfree);
@@ -147,7 +147,7 @@ static int nss_tunipip6_data_parser(stru
}
if (!strcmp(param, "ipv4_prefix")) {
- strlcpy(ipv4_prefix_str, value, 30);
+ strscpy(ipv4_prefix_str, value, 30);
ret = in4_pton(ipv4_prefix_str, -1, (uint8_t *)&ipv4_prefix, -1, NULL);
if (ret != 1) {
kfree(pfree);
@@ -173,7 +173,7 @@ static int nss_tunipip6_data_parser(stru
}
if (!strcmp(param, "ipv6_prefix")) {
- strlcpy(ipv6_prefix_str, value, 100);
+ strscpy(ipv6_prefix_str, value, 100);
ret = in6_pton(ipv6_prefix_str, -1, (uint8_t *)&ipv6_prefix, -1, NULL);
if (ret != 1) {
kfree(pfree);
@@ -199,7 +199,7 @@ static int nss_tunipip6_data_parser(stru
}
if (!strcmp(param, "ipv6_suffix")) {
- strlcpy(ipv6_suffix_str, value, 100);
+ strscpy(ipv6_suffix_str, value, 100);
ret = in6_pton(ipv6_suffix_str, -1, (uint8_t *)&ipv6_suffix, -1, NULL);
if (ret != 1) {
kfree(pfree);
@@ -368,27 +368,27 @@ fail:
return 0;
}
-static int nss_tunipip6_cmd_procfs_add_maprule(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_add_maprule(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_ADD_MAPRULE);
}
-static int nss_tunipip6_cmd_procfs_del_maprule(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_del_maprule(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_DEL_MAPRULE);
}
-static int nss_tunipip6_cmd_procfs_flush_fmr_rule(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_flush_fmr_rule(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_FLUSH_FMR_RULE);
}
-static int nss_tunipip6_cmd_procfs_enable_frag_id(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_enable_frag_id(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_FRAG_ID);
}
-static int nss_tunipip6_cmd_procfs_read_help(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_read_help(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
--- a/vlan/nss_vlan_mgr.c
+++ b/vlan/nss_vlan_mgr.c
@@ -1549,7 +1549,7 @@ static int nss_vlan_mgr_update_ppe_tpid(
* nss_vlan_mgr_tpid_proc_handler()
* Sets customer TPID and service TPID
*/
-static int nss_vlan_mgr_tpid_proc_handler(struct ctl_table *ctl,
+static int nss_vlan_mgr_tpid_proc_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
--- a/nss_qdisc/nss_htb.c
+++ b/nss_qdisc/nss_htb.c
@@ -647,7 +647,11 @@ static int nss_htb_graft_class(struct Qd
nss_qdisc_info("grafting old: %x with new: %x\n", (*old)->handle, new->handle);
if (*old != &noop_qdisc) {
nss_qdisc_trace("detaching old: %x\n", (*old)->handle);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
nq_old = qdisc_priv(*old);
+#else
+ nq_old = qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = cl->nq.qos_tag;
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.snc.htb_group_detach.child_qos_tag = nq_old->qos_tag;
if (nss_qdisc_node_detach(&cl->nq, nq_old, &nim_detach,
--- a/nss_qdisc/nss_wrr.c
+++ b/nss_qdisc/nss_wrr.c
@@ -492,7 +492,11 @@ static int nss_wrr_graft_class(struct Qd
*/
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_child = qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_child = qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = cl->nq.qos_tag;
if (nss_qdisc_node_detach(&cl->nq, nq_child, &nim_detach,
--- a/gre/test/nss_connmgr_gre_test.c
+++ b/gre/test/nss_connmgr_gre_test.c
@@ -143,7 +143,7 @@ static ssize_t nss_connmgr_gre_test_writ
* parameter parsing for delete command
*/
if (!strcmp(param, "dev")) {
- strlcpy(dev_name, value, IFNAMSIZ);
+ strscpy(dev_name, value, IFNAMSIZ);
dev_name_valid = true;
break;
}
@@ -153,19 +153,19 @@ static ssize_t nss_connmgr_gre_test_writ
* tap create command
*/
if (!strcmp(param, "next_dev")) {
- strlcpy(dev_name, value, IFNAMSIZ);
+ strscpy(dev_name, value, IFNAMSIZ);
dev_name_valid = true;
continue;
}
if (!strcmp(param, "saddr")) {
- strlcpy(saddr, value, 20);
+ strscpy(saddr, value, 20);
saddr_valid = true;
continue;
}
if (!strcmp(param, "daddr")) {
- strlcpy(daddr, value, 20);
+ strscpy(daddr, value, 20);
daddr_valid = true;
continue;
}
--- a/clmapmgr/nss_clmapmgr.c
+++ b/clmapmgr/nss_clmapmgr.c
@@ -185,7 +185,7 @@ static void nss_clmapmgr_setup(struct ne
{
char name[IFNAMSIZ] = {0};
- strlcpy(name, "nssclmap%d", IFNAMSIZ);
+ strscpy(name, "nssclmap%d", IFNAMSIZ);
memcpy(dev->name, name, IFNAMSIZ);
dev->netdev_ops = &nss_clmapmgr_ops;
eth_hw_addr_random(dev);
--- a/portifmgr/nss_portifmgr.c
+++ b/portifmgr/nss_portifmgr.c
@@ -266,7 +266,7 @@ struct net_device *nss_portifmgr_create_
ndev->vlan_features |= NSS_PORTIFMGR_SUPPORTED_FEATURES;
ndev->wanted_features |= NSS_PORTIFMGR_SUPPORTED_FEATURES;
ndev->mtu = real_dev->mtu - NSS_PORTIFMGR_EXTRA_HEADER_SIZE;
- strlcpy(ndev->name, name, IFNAMSIZ);
+ strscpy(ndev->name, name, IFNAMSIZ);
/*
* Setup temp mac address, this can be changed with ifconfig later
--- a/profiler/profile.c
+++ b/profiler/profile.c
@@ -138,7 +138,7 @@ int profile_register_performance_counter
}
profile_counter[i] = counter;
- strlcpy(profile_name[i], name, PROFILE_COUNTER_NAME_LENGTH);
+ strscpy(profile_name[i], name, PROFILE_COUNTER_NAME_LENGTH);
profile_name[i][PROFILE_COUNTER_NAME_LENGTH - 1] = 0;
return 1;
@@ -317,7 +317,7 @@ static int profile_make_stats_packet(cha
counter_ptr = (struct profile_counter *)ptr;
for (n = 0; n < profile_num_counters; ++n) {
counter_ptr->value = htonl(*profile_counter[n]);
- strlcpy(counter_ptr->name, profile_name[n],
+ strscpy(counter_ptr->name, profile_name[n],
PROFILE_COUNTER_NAME_LENGTH);
counter_ptr++;
}
--- a/gre/nss_connmgr_gre_v6.c
+++ b/gre/nss_connmgr_gre_v6.c
@@ -324,7 +324,7 @@ int nss_connmgr_gre_v6_set_config(struct
nss_connmgr_gre_set_gre_flags(cfg, &t->parms.o_flags, &t->parms.i_flags);
- strlcpy(t->parms.name, dev->name, IFNAMSIZ);
+ strscpy(t->parms.name, dev->name, IFNAMSIZ);
t->dev = dev;
return GRE_SUCCESS;
}
--- /dev/null
+++ b/compat.h
@@ -0,0 +1,15 @@
+// compat.h
+#ifndef _COMPAT_H
+#define _COMPAT_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#define compat_const const
+#define strlcpy strscpy
+#else
+#define compat_const
+#endif
+
+#endif /* _COMPAT_H */
--- a/nss_qdisc/nss_prio.c
+++ b/nss_qdisc/nss_prio.c
@@ -350,7 +350,11 @@ static int nss_prio_graft(struct Qdisc *
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_old = qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_old = qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = q->nq.qos_tag;

View File

@ -1,7 +1,7 @@
--- a/match/nss_match_cmd.c
+++ b/match/nss_match_cmd.c
@@ -127,29 +127,30 @@ static enum nss_match_profile_type nss_m
static int nss_match_cmd_procfs_config_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
static int nss_match_cmd_procfs_config_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
char *command_str, *token, *param, *value;
- char *input_msg, *input_msg_orig;

View File

@ -0,0 +1,836 @@
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,9 @@ qca-nss-tun6rd-objs := nss_connmgr_tun6r
ccflags-y += -DNSS_TUN6RD_DEBUG_LEVEL=0
ccflags-y += -Wall -Werror
+# Kernel 6.12 compatibility
+ccflags-y += -Wno-missing-prototypes -include $(src)/compat.h
+
KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
obj-$(bridge-mgr)+= bridge/
--- a/bridge/nss_bridge_mgr.c
+++ b/bridge/nss_bridge_mgr.c
@@ -1486,7 +1486,7 @@ static struct notifier_block nss_bridge_
* nss_bridge_mgr_wan_inf_add_handler
* Marks an interface as a WAN interface for special handling by bridge.
*/
-static int nss_bridge_mgr_wan_intf_add_handler(struct ctl_table *table,
+static int nss_bridge_mgr_wan_intf_add_handler(compat_const struct ctl_table *table,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1535,7 +1535,7 @@ static int nss_bridge_mgr_wan_intf_add_h
* nss_bridge_mgr_wan_inf_del_handler
* Un-marks an interface as a WAN interface.
*/
-static int nss_bridge_mgr_wan_intf_del_handler(struct ctl_table *table,
+static int nss_bridge_mgr_wan_intf_del_handler(compat_const struct ctl_table *table,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1593,8 +1593,7 @@ static struct ctl_table nss_bridge_mgr_t
.maxlen = sizeof(char) * IFNAMSIZ,
.mode = 0644,
.proc_handler = &nss_bridge_mgr_wan_intf_del_handler,
- },
- { }
+ }
};
/*
--- a/dtls/v2.0/nss_dtlsmgr_ctx_dev.c
+++ b/dtls/v2.0/nss_dtlsmgr_ctx_dev.c
@@ -284,7 +284,11 @@ void nss_dtlsmgr_ctx_dev_rx_outer(struct
skb_set_transport_header(skb, sizeof(struct iphdr));
iph = ip_hdr(skb);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_dtlsmgr_warn("%px: No IPv4 route or out dev", dev);
dev_kfree_skb_any(skb);
--- a/gre/nss_connmgr_gre.c
+++ b/gre/nss_connmgr_gre.c
@@ -40,6 +40,12 @@
#define MAX_RETRY_COUNT 100
#define MAX_WIFI_HEADROOM 66
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#define TUNNEL_CSUM IP_TUNNEL_CSUM_BIT
+#define TUNNEL_SEQ IP_TUNNEL_SEQ_BIT
+#define TUNNEL_KEY IP_TUNNEL_KEY_BIT
+#endif
+
/*
* GRE connection manager context structure
*/
@@ -186,7 +192,12 @@ static int nss_connmgr_gre_dev_init(stru
if ((dev->priv_flags_ext & IFF_EXT_GRE_V4_TAP) || (dev->type == ARPHRD_IPGRE)) {
dev->needed_headroom = sizeof(struct iphdr) + sizeof(struct ethhdr) + MAX_WIFI_HEADROOM + append;
dev->mtu = ETH_DATA_LEN - sizeof(struct iphdr) - append;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
dev->features |= NETIF_F_NETNS_LOCAL | NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+#else
+ dev->features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
+ dev->netns_local = true;
+#endif
dev->hw_features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA;
return 0;
}
@@ -200,7 +211,11 @@ static int nss_connmgr_gre_dev_init(stru
dev->mtu = IPV6_MIN_MTU;
}
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
dev->features |= NETIF_F_NETNS_LOCAL;
+#else
+ dev->netns_local = true;
+#endif
return 0;
}
@@ -211,7 +226,6 @@ static int nss_connmgr_gre_dev_init(stru
static void nss_connmgr_gre_dev_uninit(struct net_device *dev)
{
free_percpu(dev->tstats);
- return;
}
/*
@@ -578,7 +592,6 @@ static void nss_connmgr_gre_tap_inner_ex
*/
skb->protocol = eth_type_trans(skb, dev);
netif_receive_skb(skb);
- return;
}
/*
@@ -724,10 +737,10 @@ static void nss_connmgr_gre_make_name(st
{
switch (cfg->mode) {
case GRE_MODE_TUN:
- strlcpy(name, "tun-%d", IFNAMSIZ);
+ strscpy(name, "tun-%d", IFNAMSIZ);
break;
case GRE_MODE_TAP:
- strlcpy(name, "tap-%d", IFNAMSIZ);
+ strscpy(name, "tap-%d", IFNAMSIZ);
break;
default:
break;
@@ -757,7 +770,7 @@ static struct net_device *__nss_connmgr_
int ret = -1, retry, next_if_num_inner = 0, next_if_num_outer = 0;
if (cfg->name) {
- strlcpy(name, cfg->name, IFNAMSIZ);
+ strscpy(name, cfg->name, IFNAMSIZ);
} else {
nss_connmgr_gre_make_name(cfg, name);
}
--- a/gre/nss_connmgr_gre_v4.c
+++ b/gre/nss_connmgr_gre_v4.c
@@ -45,7 +45,11 @@ static struct net_device *nss_connmgr_gr
struct net_device *dev;
uint32_t ip_addr __attribute__ ((unused)) = ntohl(dest_ip);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, htonl(dest_ip), 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, htonl(dest_ip), 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_connmgr_gre_warning("Unable to lookup route for %pI4\n", &ip_addr);
return NULL;
@@ -87,7 +91,11 @@ static int nss_connmgr_gre_v4_get_mac_ad
dev_put(local_dev);
nss_connmgr_gre_info("Src MAC address for %pI4 is %pM\n", &laddr, src_mac);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, raddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, raddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_connmgr_gre_warning("route look up failed for %pI4\n", &raddr);
return GRE_ERR_RADDR_ROUTE_LOOKUP;
@@ -218,7 +226,7 @@ int nss_connmgr_gre_v4_set_config(struct
nss_connmgr_gre_set_gre_flags(cfg, &t->parms.o_flags, &t->parms.i_flags);
- strlcpy(t->parms.name, dev->name, IFNAMSIZ);
+ strscpy(t->parms.name, dev->name, IFNAMSIZ);
t->dev = dev;
return GRE_SUCCESS;
}
--- a/ipsecmgr/v1.0/nss_ipsecmgr.c
+++ b/ipsecmgr/v1.0/nss_ipsecmgr.c
@@ -526,7 +526,11 @@ static struct net_device *nss_ipsecmgr_t
}
if (!is_encap) {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
--- a/ipsecmgr/v1.0/nss_ipsecmgr_flow.c
+++ b/ipsecmgr/v1.0/nss_ipsecmgr_flow.c
@@ -915,7 +915,11 @@ bool nss_ipsecmgr_flow_process_pmtu(stru
if (unlikely(skb_dst(skb)))
goto send_icmp;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ip_hdr(skb)->daddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ip_hdr(skb)->daddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return false;
}
--- a/ipsecmgr/v2.0/nss_ipsecmgr_ctx.c
+++ b/ipsecmgr/v2.0/nss_ipsecmgr_ctx.c
@@ -230,7 +230,11 @@ static void nss_ipsecmgr_ctx_notify_ipv4
* flow that coming in for the first time. We should query
* the Linux to see the associated NETDEV
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->saddr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
dev_kfree_skb_any(skb);
ctx->hstats.v4_notify_drop++;
@@ -258,7 +262,11 @@ static void nss_ipsecmgr_ctx_route_ipv4(
struct iphdr *iph = ip_hdr(skb);
struct rtable *rt;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ipsecmgr_warn("%pK: No route, drop packet.\n", skb);
dev_kfree_skb_any(skb);
--- a/ipsecmgr/v2.0/plugins/xfrm/nss_ipsec_xfrm_tunnel.c
+++ b/ipsecmgr/v2.0/plugins/xfrm/nss_ipsec_xfrm_tunnel.c
@@ -149,7 +149,11 @@ static void nss_ipsec_xfrm_tunnel_rx_out
if (ip_hdr(skb)->version == IPVERSION) {
struct iphdr *iph = ip_hdr(skb);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
struct rtable *rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0);
+#else
+ struct rtable *rt = ip_route_output(&init_net, iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ipsec_xfrm_warn("%px: Failed to handle ipv4 exception after encap; No route\n", skb);
goto drop;
@@ -285,7 +289,11 @@ struct nss_ipsec_xfrm_tunnel *nss_ipsec_
switch (family) {
case AF_INET:
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, remote->a4, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, remote->a4, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
nss_ipsec_xfrm_err("%p:Failed to allocate tunnel; No IPv4 dst found\n", drv);
return NULL;
--- a/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
+++ b/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
@@ -319,7 +319,7 @@ static struct nss_connmgr_l2tpv2_session
*/
dev_hold(dev);
l2tpv2_session_data->dev = dev;
- strlcpy(session->ifname, dev->name, IFNAMSIZ);
+ strscpy(session->ifname, dev->name, IFNAMSIZ);
/*
* There is no need for protecting simultaneous addition &
@@ -417,7 +417,11 @@ static void nss_connmgr_l2tpv2_exception
/*
* set skb_iif
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph_inner->saddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph_inner->saddr, 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_connmgr_l2tpv2_warning("Martian packets !!!");
} else {
@@ -859,7 +863,7 @@ EXPORT_SYMBOL(l2tpmgr_unregister_ipsecmg
* nss_connmgr_l2tpv2_proc_handler()
* Read and write handler for sysctl.
*/
-static int nss_connmgr_l2tpv2_proc_handler(struct ctl_table *ctl,
+static int nss_connmgr_l2tpv2_proc_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -979,8 +983,7 @@ static struct ctl_table nss_connmgr_l2tp
.maxlen = L2TP_SYSCTL_STR_LEN_MAX,
.mode = 0644,
.proc_handler = &nss_connmgr_l2tpv2_proc_handler,
- },
- { }
+ }
};
/*
@@ -991,8 +994,7 @@ static struct ctl_table nss_connmgr_l2tp
.procname = "l2tpv2",
.mode = 0555,
.child = nss_connmgr_l2tpv2_table,
- },
- { }
+ }
};
/*
@@ -1003,8 +1005,7 @@ static struct ctl_table nss_connmgr_l2tp
.procname = "nss",
.mode = 0555,
.child = nss_connmgr_l2tpv2_dir,
- },
- { }
+ }
};
#endif
--- a/l2tp/l2tpv2/nss_l2tpv2_stats.c
+++ b/l2tp/l2tpv2/nss_l2tpv2_stats.c
@@ -129,7 +129,11 @@ void nss_l2tpv2_update_dev_stats(struct
dev_put(dev);
return;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
session = l2tp_tunnel_get_session(tunnel, data.l2tpv2.session.session_id);
+#else
+ session = l2tp_v2_session_get(dev_net(dev), data.l2tpv2.tunnel.tunnel_id, data.l2tpv2.session.session_id);
+#endif
if (!session) {
tunnel_put(tunnel);
dev_put(dev);
--- a/match/nss_match_cmd.c
+++ b/match/nss_match_cmd.c
@@ -124,7 +124,7 @@ static enum nss_match_profile_type nss_m
* nss_match_cmd_procfs_config_handler()
* Handles command input by user to create and configure match instance.
*/
-static int nss_match_cmd_procfs_config_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_config_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
char *command_str, *token, *param, *value;
char *input_msg, *input_msg_orig;
@@ -451,7 +451,7 @@ fail:
* nss_match_cmd_procfs_reset_nexthop
* Reset to default nexthop of an interface
*/
-static int nss_match_cmd_procfs_reset_nexthop(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_reset_nexthop(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct net_device *dev;
uint32_t if_num, type = 0;
@@ -521,7 +521,7 @@ static int nss_match_cmd_procfs_reset_ne
* Set next hop of an interface to a match instance.
* Only VAP and physical interfaces are supported as of now.
*/
-static int nss_match_cmd_procfs_set_if_nexthop(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_set_if_nexthop(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct net_device *dev;
uint32_t if_num, type = 0;
@@ -632,7 +632,7 @@ static int nss_match_cmd_procfs_set_if_n
* nss_match_cmd_procfs_read_help()
* Display help for commands.
*/
-static int nss_match_cmd_procfs_read_help(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_match_cmd_procfs_read_help(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -688,8 +688,7 @@ static struct ctl_table nss_match_table[
.maxlen = sizeof(nss_match_data),
.mode = 0400,
.proc_handler = &nss_match_cmd_procfs_read_help,
- },
- { }
+ }
};
static struct ctl_table_header *nss_match_ctl_header;
--- a/mirror/nss_mirror_ctl.c
+++ b/mirror/nss_mirror_ctl.c
@@ -132,7 +132,7 @@ static int nss_mirror_ctl_get_netdev_by_
{
char dev_name[IFNAMSIZ] = {0};
- strlcpy(dev_name, name, IFNAMSIZ);
+ strscpy(dev_name, name, IFNAMSIZ);
if (dev_name[strlen(dev_name) - 1] == '\n') {
dev_name[strlen(dev_name) - 1] = '\0';
}
@@ -357,7 +357,7 @@ static int nss_mirror_ctl_parse_display_
return -1;
}
- strlcpy(dev_name, value, IFNAMSIZ);
+ strscpy(dev_name, value, IFNAMSIZ);
if (dev_name[strlen(dev_name) - 1] == '\n') {
dev_name[strlen(dev_name) - 1] = '\0';
}
@@ -754,7 +754,7 @@ static int32_t nss_mirror_ctl_parse_cmd(
* nss_mirror_ctl_config_handler()
* Mirror sysctl config handler.
*/
-static int nss_mirror_ctl_config_handler(struct ctl_table *ctl, int write,
+static int nss_mirror_ctl_config_handler(compat_const struct ctl_table *ctl, int write,
void __user *buf, size_t *lenp, loff_t *ppos)
{
char *buffer, *pfree;
@@ -914,8 +914,7 @@ static struct ctl_table nss_mirror_table
.maxlen = sizeof(nss_mirror_config_data),
.mode = 0644,
.proc_handler = &nss_mirror_ctl_config_handler,
- },
- { }
+ }
};
/*
--- a/netlink/nss_nlipv4.c
+++ b/netlink/nss_nlipv4.c
@@ -129,7 +129,11 @@ static struct neighbour *nss_nlipv4_get_
/*
* search for route entry
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ip_addr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ip_addr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
--- a/netlink/nss_nludp_st.c
+++ b/netlink/nss_nludp_st.c
@@ -749,7 +749,11 @@ static struct neighbour *nss_nludp_st_ge
/*
* search for route entry
*/
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ip_addr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ip_addr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
--- a/nss_qdisc/nss_bf.c
+++ b/nss_qdisc/nss_bf.c
@@ -381,7 +381,11 @@ static int nss_bf_graft_class(struct Qdi
*/
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = cl->nq.qos_tag;
if (nss_qdisc_node_detach(&cl->nq, nq_old, &nim_detach,
--- a/nss_qdisc/nss_qdisc.c
+++ b/nss_qdisc/nss_qdisc.c
@@ -374,7 +374,7 @@ static int nss_qdisc_refresh_bshaper_ass
br_update.port_list_count = 0;
br_update.unassign_count = 0;
- read_lock(&dev_base_lock);
+ /* read_lock(&dev_base_lock); */
dev = first_net_device(&init_net);
while(dev) {
@@ -421,7 +421,7 @@ static int nss_qdisc_refresh_bshaper_ass
nextdev:
dev = next_net_device(dev);
}
- read_unlock(&dev_base_lock);
+ /* read_unlock(&dev_base_lock); */
nss_qdisc_info("List count %d\n", br_update.port_list_count);
--- a/nss_qdisc/nss_tbl.c
+++ b/nss_qdisc/nss_tbl.c
@@ -350,7 +350,11 @@ static int nss_tbl_graft(struct Qdisc *s
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_old = (struct nss_qdisc *)qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = q->nq.qos_tag;
if (nss_qdisc_node_detach(&q->nq, nq_old, &nim_detach,
--- a/openvpn/plugins/nss_ovpn_sk.c
+++ b/openvpn/plugins/nss_ovpn_sk.c
@@ -225,7 +225,11 @@ static int nss_ovpn_sk_update_ipv4_tuple
{
struct rtable *rt;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(dev_net(pinfo->dev), tun_data->tun_hdr.dst_ip[0], 0, 0, 0);
+#else
+ rt = ip_route_output(dev_net(pinfo->dev), tun_data->tun_hdr.dst_ip[0], 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ovpn_sk_warn("%px: Failed to find IPv4 route.\n", pinfo);
return -EINVAL;
--- a/openvpn/src/nss_ovpnmgr_tun.c
+++ b/openvpn/src/nss_ovpnmgr_tun.c
@@ -69,7 +69,11 @@ static void nss_ovpnmgr_tun_ipv4_forward
skb_reset_network_header(skb);
iph = ip_hdr(skb);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(dev_net(app->dev), iph->daddr, iph->saddr, 0, 0);
+#else
+ rt = ip_route_output(dev_net(app->dev), iph->daddr, iph->saddr, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_ovpnmgr_warn("%px: Failed to find IPv4 route.\n", skb);
tun->outer.stats.host_pkt_drop++;
--- a/tunipip6/nss_connmgr_tunipip6.c
+++ b/tunipip6/nss_connmgr_tunipip6.c
@@ -174,7 +174,11 @@ static void nss_tunipip6_encap_exception
nss_tunipip6_info("%px: received - %d bytes name %s ver %x\n",
skb, skb->len, dev->name, iph->version);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_tunipip6_info("%px: Failed to find IPv4 route for dest %pI4 src %pI4\n", skb, &iph->daddr, &iph->saddr);
dev_kfree_skb_any(skb);
@@ -284,7 +288,11 @@ static void nss_tunipip6_decap_exception
iph = ip_hdr(skb);
nss_tunipip6_assert(iph->version == 4);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, iph->daddr, 0, 0, 0, 0);
+#endif
if (unlikely(IS_ERR(rt))) {
nss_tunipip6_info("%px: Failed to find IPv4 route for %pI4\n", skb, &iph->daddr);
dev_kfree_skb_any(skb);
--- a/tunipip6/nss_connmgr_tunipip6_sysctl.c
+++ b/tunipip6/nss_connmgr_tunipip6_sysctl.c
@@ -52,7 +52,7 @@ enum nss_tunipip6_sysctl_mode {
};
-static int nss_tunipip6_data_parser(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos, enum nss_tunipip6_sysctl_mode mode)
+static int nss_tunipip6_data_parser(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos, enum nss_tunipip6_sysctl_mode mode)
{
char dev_name[NETDEV_STR_LEN] = {0}, ipv6_prefix_str[PREFIX_STR_LEN] = {0}, ipv6_suffix_str[PREFIX_STR_LEN] = {0}, ipv4_prefix_str[PREFIX_STR_LEN] = {0};
uint32_t ipv6_prefix[4], ipv6_prefix_len, ipv6_suffix[4], ipv6_suffix_len, ipv4_prefix, ipv4_prefix_len, ea_len, psid_offset;
@@ -108,7 +108,7 @@ static int nss_tunipip6_data_parser(stru
*/
if (!strcmp(param, "netdev")) {
- strlcpy(dev_name, value, 30);
+ strscpy(dev_name, value, 30);
dev = dev_get_by_name(&init_net, dev_name);
if (!dev) {
kfree(pfree);
@@ -147,7 +147,7 @@ static int nss_tunipip6_data_parser(stru
}
if (!strcmp(param, "ipv4_prefix")) {
- strlcpy(ipv4_prefix_str, value, 30);
+ strscpy(ipv4_prefix_str, value, 30);
ret = in4_pton(ipv4_prefix_str, -1, (uint8_t *)&ipv4_prefix, -1, NULL);
if (ret != 1) {
kfree(pfree);
@@ -173,7 +173,7 @@ static int nss_tunipip6_data_parser(stru
}
if (!strcmp(param, "ipv6_prefix")) {
- strlcpy(ipv6_prefix_str, value, 100);
+ strscpy(ipv6_prefix_str, value, 100);
ret = in6_pton(ipv6_prefix_str, -1, (uint8_t *)&ipv6_prefix, -1, NULL);
if (ret != 1) {
kfree(pfree);
@@ -199,7 +199,7 @@ static int nss_tunipip6_data_parser(stru
}
if (!strcmp(param, "ipv6_suffix")) {
- strlcpy(ipv6_suffix_str, value, 100);
+ strscpy(ipv6_suffix_str, value, 100);
ret = in6_pton(ipv6_suffix_str, -1, (uint8_t *)&ipv6_suffix, -1, NULL);
if (ret != 1) {
kfree(pfree);
@@ -368,27 +368,27 @@ fail:
return 0;
}
-static int nss_tunipip6_cmd_procfs_add_maprule(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_add_maprule(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_ADD_MAPRULE);
}
-static int nss_tunipip6_cmd_procfs_del_maprule(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_del_maprule(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_DEL_MAPRULE);
}
-static int nss_tunipip6_cmd_procfs_flush_fmr_rule(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_flush_fmr_rule(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_FLUSH_FMR_RULE);
}
-static int nss_tunipip6_cmd_procfs_enable_frag_id(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_enable_frag_id(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_tunipip6_data_parser(ctl, write, buffer, lenp, ppos, NSS_TUNIPIP6_SYSCTL_FRAG_ID);
}
-static int nss_tunipip6_cmd_procfs_read_help(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_tunipip6_cmd_procfs_read_help(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -445,8 +445,7 @@ static struct ctl_table nss_tunipip6_tab
.maxlen = sizeof(nss_tunipip6_data),
.mode = 0400,
.proc_handler = &nss_tunipip6_cmd_procfs_read_help,
- },
- { }
+ }
};
static struct ctl_table_header *nss_tunipip6_ctl_header;
--- a/vlan/nss_vlan_mgr.c
+++ b/vlan/nss_vlan_mgr.c
@@ -1549,7 +1549,7 @@ static int nss_vlan_mgr_update_ppe_tpid(
* nss_vlan_mgr_tpid_proc_handler()
* Sets customer TPID and service TPID
*/
-static int nss_vlan_mgr_tpid_proc_handler(struct ctl_table *ctl,
+static int nss_vlan_mgr_tpid_proc_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1577,8 +1577,7 @@ static struct ctl_table nss_vlan_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_vlan_mgr_tpid_proc_handler,
- },
- { }
+ }
};
/*
--- a/nss_qdisc/nss_htb.c
+++ b/nss_qdisc/nss_htb.c
@@ -642,7 +642,11 @@ static int nss_htb_graft_class(struct Qd
nss_qdisc_info("grafting old: %x with new: %x\n", (*old)->handle, new->handle);
if (*old != &noop_qdisc) {
nss_qdisc_trace("detaching old: %x\n", (*old)->handle);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
nq_old = qdisc_priv(*old);
+#else
+ nq_old = qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = cl->nq.qos_tag;
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.snc.htb_group_detach.child_qos_tag = nq_old->qos_tag;
if (nss_qdisc_node_detach(&cl->nq, nq_old, &nim_detach,
--- a/nss_qdisc/nss_wrr.c
+++ b/nss_qdisc/nss_wrr.c
@@ -488,7 +488,11 @@ static int nss_wrr_graft_class(struct Qd
*/
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_child = qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_child = qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = cl->nq.qos_tag;
if (nss_qdisc_node_detach(&cl->nq, nq_child, &nim_detach,
--- a/gre/test/nss_connmgr_gre_test.c
+++ b/gre/test/nss_connmgr_gre_test.c
@@ -143,7 +143,7 @@ static ssize_t nss_connmgr_gre_test_writ
* parameter parsing for delete command
*/
if (!strcmp(param, "dev")) {
- strlcpy(dev_name, value, IFNAMSIZ);
+ strscpy(dev_name, value, IFNAMSIZ);
dev_name_valid = true;
break;
}
@@ -153,19 +153,19 @@ static ssize_t nss_connmgr_gre_test_writ
* tap create command
*/
if (!strcmp(param, "next_dev")) {
- strlcpy(dev_name, value, IFNAMSIZ);
+ strscpy(dev_name, value, IFNAMSIZ);
dev_name_valid = true;
continue;
}
if (!strcmp(param, "saddr")) {
- strlcpy(saddr, value, 20);
+ strscpy(saddr, value, 20);
saddr_valid = true;
continue;
}
if (!strcmp(param, "daddr")) {
- strlcpy(daddr, value, 20);
+ strscpy(daddr, value, 20);
daddr_valid = true;
continue;
}
--- a/clmapmgr/nss_clmapmgr.c
+++ b/clmapmgr/nss_clmapmgr.c
@@ -185,7 +185,7 @@ static void nss_clmapmgr_setup(struct ne
{
char name[IFNAMSIZ] = {0};
- strlcpy(name, "nssclmap%d", IFNAMSIZ);
+ strscpy(name, "nssclmap%d", IFNAMSIZ);
memcpy(dev->name, name, IFNAMSIZ);
dev->netdev_ops = &nss_clmapmgr_ops;
eth_hw_addr_random(dev);
--- a/portifmgr/nss_portifmgr.c
+++ b/portifmgr/nss_portifmgr.c
@@ -266,7 +266,7 @@ struct net_device *nss_portifmgr_create_
ndev->vlan_features |= NSS_PORTIFMGR_SUPPORTED_FEATURES;
ndev->wanted_features |= NSS_PORTIFMGR_SUPPORTED_FEATURES;
ndev->mtu = real_dev->mtu - NSS_PORTIFMGR_EXTRA_HEADER_SIZE;
- strlcpy(ndev->name, name, IFNAMSIZ);
+ strscpy(ndev->name, name, IFNAMSIZ);
/*
* Setup temp mac address, this can be changed with ifconfig later
--- a/profiler/profile.c
+++ b/profiler/profile.c
@@ -138,7 +138,7 @@ int profile_register_performance_counter
}
profile_counter[i] = counter;
- strlcpy(profile_name[i], name, PROFILE_COUNTER_NAME_LENGTH);
+ strscpy(profile_name[i], name, PROFILE_COUNTER_NAME_LENGTH);
profile_name[i][PROFILE_COUNTER_NAME_LENGTH - 1] = 0;
return 1;
@@ -317,7 +317,7 @@ static int profile_make_stats_packet(cha
counter_ptr = (struct profile_counter *)ptr;
for (n = 0; n < profile_num_counters; ++n) {
counter_ptr->value = htonl(*profile_counter[n]);
- strlcpy(counter_ptr->name, profile_name[n],
+ strscpy(counter_ptr->name, profile_name[n],
PROFILE_COUNTER_NAME_LENGTH);
counter_ptr++;
}
--- a/gre/nss_connmgr_gre_v6.c
+++ b/gre/nss_connmgr_gre_v6.c
@@ -324,7 +324,7 @@ int nss_connmgr_gre_v6_set_config(struct
nss_connmgr_gre_set_gre_flags(cfg, &t->parms.o_flags, &t->parms.i_flags);
- strlcpy(t->parms.name, dev->name, IFNAMSIZ);
+ strscpy(t->parms.name, dev->name, IFNAMSIZ);
t->dev = dev;
return GRE_SUCCESS;
}
--- /dev/null
+++ b/compat.h
@@ -0,0 +1,15 @@
+// compat.h
+#ifndef _COMPAT_H
+#define _COMPAT_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#define compat_const const
+#define strlcpy strscpy
+#else
+#define compat_const
+#endif
+
+#endif /* _COMPAT_H */
--- a/nss_qdisc/nss_prio.c
+++ b/nss_qdisc/nss_prio.c
@@ -341,7 +341,11 @@ static int nss_prio_graft(struct Qdisc *
nss_qdisc_info("Grafting old: %px with new: %px\n", *old, new);
if (*old != &noop_qdisc) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 8, 0)
struct nss_qdisc *nq_old = qdisc_priv(*old);
+#else
+ struct nss_qdisc *nq_old = qdisc_priv(((struct Qdisc *)(*old)));
+#endif
nss_qdisc_info("Detaching old: %px\n", *old);
nim_detach.msg.shaper_configure.config.msg.shaper_node_config.qos_tag = q->nq.qos_tag;
--- a/netlink/nss_nldtls.c
+++ b/netlink/nss_nldtls.c
@@ -1108,7 +1108,7 @@ static ssize_t nss_nldtls_tunnel_stats_r
list_for_each_entry(entry, &gbl_ctx.dtls_list_head, list) {
spin_lock_bh(&gbl_ctx.lock);
memcpy(&stats, &entry->stats, sizeof(stats));
- strlcpy(dev_name, entry->dev_name, IFNAMSIZ);
+ strscpy(dev_name, entry->dev_name, IFNAMSIZ);
spin_unlock_bh(&gbl_ctx.lock);
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "\n--------------------------------");
--- a/netlink/nss_nlipsec.c
+++ b/netlink/nss_nlipsec.c
@@ -394,7 +394,7 @@ static int nss_nlipsec_op_create_tunnel(
* the tunnel I/F name into the same rule and send it
* as part of the response for the create operation
*/
- strlcpy(nl_rule->ifname, dev->name, IFNAMSIZ);
+ strscpy(nl_rule->ifname, dev->name, IFNAMSIZ);
/*
* Send to userspace
--- a/openvpn/src/nss_ovpnmgr_app.c
+++ b/openvpn/src/nss_ovpnmgr_app.c
@@ -51,7 +51,11 @@ static struct net_device *nss_ovpnmgr_ap
struct rtable *rt4;
if (rt->ip_version == IPVERSION) {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
rt4 = ip_route_output(&init_net, rt->ip_addr[0], 0, 0, 0);
+#else
+ rt4 = ip_route_output(&init_net, rt->ip_addr[0], 0, 0, 0, 0);
+#endif
if (IS_ERR(rt4)) {
return NULL;
}

View File

@ -1,7 +1,7 @@
--- a/match/nss_match_cmd.c
+++ b/match/nss_match_cmd.c
@@ -127,29 +127,30 @@ static enum nss_match_profile_type nss_m
static int nss_match_cmd_procfs_config_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
static int nss_match_cmd_procfs_config_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
char *command_str, *token, *param, *value;
- char *input_msg, *input_msg_orig;

View File

@ -0,0 +1,374 @@
--- a/v2.0/src/nss_crypto_ctrl.c
+++ b/v2.0/src/nss_crypto_ctrl.c
@@ -831,7 +831,7 @@ void nss_crypto_process_event(void *app_
* nss_crypto_free()
* Free crypto context
*/
-void nss_crypto_free(struct nss_crypto_ctx *ctx)
+static void nss_crypto_free(struct nss_crypto_ctx *ctx)
{
struct nss_crypto_ctrl *ctrl = &g_control;
int32_t status;
@@ -891,7 +891,7 @@ free:
* possible that the host to NSS queue is busy in which
* case we need to retry.
*/
-void nss_crypto_delayed_free(struct work_struct *work)
+static void nss_crypto_delayed_free(struct work_struct *work)
{
struct nss_crypto_ctrl *ctrl = &g_control;
struct nss_crypto_ctx *ctx;
@@ -1242,7 +1242,7 @@ void nss_crypto_engine_free(struct nss_c
* nss_crypto_ndev_setup()
* setup the dummy netdevice
*/
-void nss_crypto_ndev_setup(struct net_device *dev)
+static void nss_crypto_ndev_setup(struct net_device *dev)
{
nss_crypto_info("%px: dummy netdevice for crypto\n", dev);
}
@@ -1573,11 +1573,10 @@ static int nss_crypto_device_probe(struc
* nss_crypto_device_remove()
* remove crypto device and deregister everything
*/
-static int nss_crypto_device_remove(struct platform_device *pdev)
+static void nss_crypto_device_remove(struct platform_device *pdev)
{
nss_crypto_hw_deinit(pdev);
nss_crypto_node_free(platform_get_drvdata(pdev));
- return 0;
};
/*
@@ -1654,7 +1653,7 @@ static int nss_crypto_probe(struct platf
* nss_crypto_remove()
* remove the crypto driver
*/
-static int nss_crypto_remove(struct platform_device *pdev)
+static void nss_crypto_remove(struct platform_device *pdev)
{
struct nss_crypto_ctrl *ctrl = platform_get_drvdata(pdev);
@@ -1668,7 +1667,6 @@ static int nss_crypto_remove(struct plat
* Clear the active state of driver
*/
ctrl->active = false;
- return 0;
}
/*
@@ -1689,7 +1687,7 @@ static struct platform_driver nss_crypto
* nss_crypto_delayed_probe()
* delayed sequence to initialize crypto after NSS FW is initialized
*/
-void nss_crypto_delayed_probe(struct work_struct *work)
+static void nss_crypto_delayed_probe(struct work_struct *work)
{
struct nss_crypto_ctrl *ctrl;
struct nss_crypto_user *user;
--- a/v2.0/tool/nss_crypto_bench.c
+++ b/v2.0/tool/nss_crypto_bench.c
@@ -717,7 +717,7 @@ static int32_t crypto_bench_prep_buf(str
return CRYPTO_BENCH_OK;
}
-void crypto_bench_mcmp(void)
+static void crypto_bench_mcmp(void)
{
struct crypto_op *op;
struct list_head *ptr;
@@ -844,7 +844,7 @@ static int crypto_bench_tx(void *arg)
/*
* Context should be ATOMIC
*/
-void crypto_bench_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t error)
+static void crypto_bench_done(void *app_data, struct nss_crypto_hdr *ch, uint8_t error)
{
struct nss_crypto_buf *buf;
struct crypto_op *op;
@@ -914,7 +914,7 @@ static const struct file_operations cmd_
.write = crypto_bench_cmd_write,
};
-void crypto_bench_attach(void *app_data, struct nss_crypto_user *user)
+static void crypto_bench_attach(void *app_data, struct nss_crypto_user *user)
{
spin_lock_init(&op_lock);
@@ -960,13 +960,13 @@ void crypto_bench_attach(void *app_data
debugfs_create_u32("enqueue_errors", CRYPTO_BENCH_PERM_RO, droot, &param.tx_err);
}
-void crypto_bench_detach(void *app_data, struct nss_crypto_user *user)
+static void crypto_bench_detach(void *app_data, struct nss_crypto_user *user)
{
crypto_bench_flush();
kmem_cache_destroy(crypto_op_zone);
}
-int __init crypto_bench_init(void)
+static int __init crypto_bench_init(void)
{
ctx = kmalloc(sizeof(struct nss_crypto_user_ctx), GFP_KERNEL);
if (!ctx) {
@@ -980,7 +980,7 @@ int __init crypto_bench_init(void)
ctx->attach = crypto_bench_attach;
ctx->detach = crypto_bench_detach;
- strlcpy(ctx->name, "bench", sizeof(ctx->name));
+ strscpy(ctx->name, "bench", sizeof(ctx->name));
ctx->hdr_pool_sz = 1024;
ctx->default_hdr_sz = 512;
ctx->timeout_ticks = 1;
@@ -991,7 +991,7 @@ int __init crypto_bench_init(void)
return 0;
}
-void __exit crypto_bench_exit(void)
+static void __exit crypto_bench_exit(void)
{
crypto_bench_info("Crypto bench unloaded\n");
--- a/v2.0/src/hal/ipq60xx/nss_crypto_eip197.h
+++ b/v2.0/src/hal/ipq60xx/nss_crypto_eip197.h
@@ -19,7 +19,9 @@
#ifndef __NSS_CRYPTO_EIP197_H
#define __NSS_CRYPTO_EIP197_H
+#include <linux/of_platform.h>
#include <linux/types.h>
+#include <linux/fs.h>
/*
* Common configuration data for command and result
--- a/v2.0/src/hal/ipq60xx/nss_crypto_hw.c
+++ b/v2.0/src/hal/ipq60xx/nss_crypto_hw.c
@@ -15,8 +15,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <linux/of.h>
#include <linux/of_platform.h>
#include "nss_crypto_eip197.h"
+#include "nss_crypto_hw.h"
/*
* nss_crypto_hw_deinit()
@@ -27,7 +29,6 @@ void nss_crypto_hw_deinit(struct platfor
/*
* TODO: Add support for putting HW into reset
*/
- return;
}
/*
--- a/v2.0/src/hal/ipq60xx/nss_crypto_eip197.c
+++ b/v2.0/src/hal/ipq60xx/nss_crypto_eip197.c
@@ -455,7 +455,7 @@ free:
* nss_crypto_eip197_ctx_fill()
* Fill context record specific information
*/
-int nss_crypto_eip197_ctx_fill(struct nss_crypto_ctx *ctx, struct nss_crypto_session_data *data,
+static int nss_crypto_eip197_ctx_fill(struct nss_crypto_ctx *ctx, struct nss_crypto_session_data *data,
struct nss_crypto_cmn_ctx *msg)
{
if (data->algo > NSS_CRYPTO_CMN_ALGO_MAX)
@@ -477,7 +477,7 @@ int nss_crypto_eip197_ctx_fill(struct ns
* nss_crypto_eip197_engine_init()
* allocate & initialize engine
*/
-int nss_crypto_eip197_engine_init(struct platform_device *pdev, struct device_node *np,
+static int nss_crypto_eip197_engine_init(struct platform_device *pdev, struct device_node *np,
struct resource *res, uint32_t offset)
{
struct nss_crypto_node *node = platform_get_drvdata(pdev);
@@ -545,7 +545,7 @@ int nss_crypto_eip197_engine_init(struct
* nss_crypto_eip197_node_init()
* allocate & initialize eip197 node
*/
-int nss_crypto_eip197_node_init(struct platform_device *pdev, const char *name)
+static int nss_crypto_eip197_node_init(struct platform_device *pdev, const char *name)
{
struct device_node *np = of_node_get(pdev->dev.of_node);
struct nss_crypto_node *node;
--- a/v2.0/src/hal/ipq807x/nss_crypto_eip197.h
+++ b/v2.0/src/hal/ipq807x/nss_crypto_eip197.h
@@ -20,6 +20,8 @@
#define __NSS_CRYPTO_EIP197_H
#include <linux/types.h>
+#include <linux/fs.h>
+#include <linux/of_platform.h>
/*
* Common configuration data for command and result
--- a/v2.0/src/hal/ipq807x/nss_crypto_hw.c
+++ b/v2.0/src/hal/ipq807x/nss_crypto_hw.c
@@ -15,8 +15,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <linux/of.h>
#include <linux/of_platform.h>
#include "nss_crypto_eip197.h"
+#include "nss_crypto_hw.h"
/*
* nss_crypto_hw_deinit()
@@ -27,7 +29,6 @@ void nss_crypto_hw_deinit(struct platfor
/*
* TODO: Add support for putting HW into reset
*/
- return;
}
/*
--- a/v2.0/src/hal/ipq95xx/nss_crypto_eip197.h
+++ b/v2.0/src/hal/ipq95xx/nss_crypto_eip197.h
@@ -20,6 +20,7 @@
#define __NSS_CRYPTO_EIP197_H
#include <linux/types.h>
+#include <linux/fs.h>
/*
* Common configuration data for command and result
--- a/v2.0/src/hal/ipq95xx/nss_crypto_hw.c
+++ b/v2.0/src/hal/ipq95xx/nss_crypto_hw.c
@@ -16,8 +16,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#include <linux/of.h>
#include <linux/of_platform.h>
#include "nss_crypto_eip197.h"
+#include "nss_crypto_hw.h"
/*
* nss_crypto_hw_deinit()
@@ -28,7 +30,6 @@ void nss_crypto_hw_deinit(struct platfor
/*
* TODO: Add support for putting HW into reset
*/
- return;
}
/*
--- a/v2.0/src/hal/ipq807x/nss_crypto_eip197.c
+++ b/v2.0/src/hal/ipq807x/nss_crypto_eip197.c
@@ -455,7 +455,7 @@ free:
* nss_crypto_eip197_ctx_fill()
* Fill context record specific information
*/
-int nss_crypto_eip197_ctx_fill(struct nss_crypto_ctx *ctx, struct nss_crypto_session_data *data,
+static int nss_crypto_eip197_ctx_fill(struct nss_crypto_ctx *ctx, struct nss_crypto_session_data *data,
struct nss_crypto_cmn_ctx *msg)
{
if (data->algo > NSS_CRYPTO_CMN_ALGO_MAX)
@@ -477,7 +477,7 @@ int nss_crypto_eip197_ctx_fill(struct ns
* nss_crypto_eip197_engine_init()
* allocate & initialize engine
*/
-int nss_crypto_eip197_engine_init(struct platform_device *pdev, struct device_node *np,
+static int nss_crypto_eip197_engine_init(struct platform_device *pdev, struct device_node *np,
struct resource *res, uint32_t offset)
{
struct nss_crypto_node *node = platform_get_drvdata(pdev);
@@ -545,7 +545,7 @@ int nss_crypto_eip197_engine_init(struct
* nss_crypto_eip197_node_init()
* allocate & initialize eip197 node
*/
-int nss_crypto_eip197_node_init(struct platform_device *pdev, const char *name)
+static int nss_crypto_eip197_node_init(struct platform_device *pdev, const char *name)
{
struct device_node *np = of_node_get(pdev->dev.of_node);
struct nss_crypto_node *node;
--- a/v2.0/src/hal/ipq95xx/nss_crypto_eip197.c
+++ b/v2.0/src/hal/ipq95xx/nss_crypto_eip197.c
@@ -456,7 +456,7 @@ free:
* nss_crypto_eip197_ctx_fill()
* Fill context record specific information
*/
-int nss_crypto_eip197_ctx_fill(struct nss_crypto_ctx *ctx, struct nss_crypto_session_data *data,
+static int nss_crypto_eip197_ctx_fill(struct nss_crypto_ctx *ctx, struct nss_crypto_session_data *data,
struct nss_crypto_cmn_ctx *msg)
{
if (data->algo > NSS_CRYPTO_CMN_ALGO_MAX)
@@ -478,7 +478,7 @@ int nss_crypto_eip197_ctx_fill(struct ns
* nss_crypto_eip197_engine_init()
* allocate & initialize engine
*/
-int nss_crypto_eip197_engine_init(struct platform_device *pdev, struct device_node *np,
+static int nss_crypto_eip197_engine_init(struct platform_device *pdev, struct device_node *np,
struct resource *res, uint32_t offset)
{
struct nss_crypto_node *node = platform_get_drvdata(pdev);
@@ -546,7 +546,7 @@ int nss_crypto_eip197_engine_init(struct
* nss_crypto_eip197_node_init()
* allocate & initialize eip197 node
*/
-int nss_crypto_eip197_node_init(struct platform_device *pdev, const char *name)
+static int nss_crypto_eip197_node_init(struct platform_device *pdev, const char *name)
{
struct device_node *np = of_node_get(pdev->dev.of_node);
struct nss_crypto_node *node;
--- a/v2.0/src/hal/ipq807x/nss_crypto_eip197_init.c
+++ b/v2.0/src/hal/ipq807x/nss_crypto_eip197_init.c
@@ -404,7 +404,7 @@ static void nss_crypto_eip197_hw_setup_c
* nss_crypto_eip197_hw_setup_cache()
* setup EIP197 flow and transform cache
*/
-void nss_crypto_eip197_hw_setup_cache(void __iomem *base_addr)
+static void nss_crypto_eip197_hw_setup_cache(void __iomem *base_addr)
{
void __iomem *addr;
uint32_t val;
@@ -785,7 +785,7 @@ static void nss_crypto_eip197_hw_disable
* nss_crypto_eip197_hw_setup()
* Pre initialization function for eip197
*/
-void nss_crypto_eip197_hw_setup(void __iomem *base_addr)
+static void nss_crypto_eip197_hw_setup(void __iomem *base_addr)
{
/*
* Reset EIP blocks and check if reset is complete
--- a/v2.0/src/hal/ipq60xx/nss_crypto_eip197_init.c
+++ b/v2.0/src/hal/ipq60xx/nss_crypto_eip197_init.c
@@ -437,7 +437,7 @@ static void nss_crypto_eip197_hw_setup_c
* nss_crypto_eip197_hw_setup_cache()
* setup EIP197 flow and transform cache
*/
-void nss_crypto_eip197_hw_setup_cache(void __iomem *base_addr)
+static void nss_crypto_eip197_hw_setup_cache(void __iomem *base_addr)
{
void __iomem *addr;
uint32_t val;
@@ -823,7 +823,7 @@ static void nss_crypto_eip197_hw_disable
* nss_crypto_eip197_hw_setup()
* Pre initialization function for eip197
*/
-void nss_crypto_eip197_hw_setup(void __iomem *base_addr)
+static void nss_crypto_eip197_hw_setup(void __iomem *base_addr)
{
/*
* Reset EIP blocks and check if reset is complete
--- a/v2.0/src/hal/ipq95xx/nss_crypto_eip197_init.c
+++ b/v2.0/src/hal/ipq95xx/nss_crypto_eip197_init.c
@@ -437,7 +437,7 @@ static void nss_crypto_eip197_hw_setup_c
* nss_crypto_eip197_hw_setup_cache()
* setup EIP197 flow and transform cache
*/
-void nss_crypto_eip197_hw_setup_cache(void __iomem *base_addr)
+static void nss_crypto_eip197_hw_setup_cache(void __iomem *base_addr)
{
void __iomem *addr;
uint32_t val;
@@ -827,7 +827,7 @@ static void nss_crypto_eip197_hw_disable
* nss_crypto_eip197_hw_setup()
* Pre initialization function for eip197
*/
-void nss_crypto_eip197_hw_setup(void __iomem *base_addr)
+static void nss_crypto_eip197_hw_setup(void __iomem *base_addr)
{
/*
* Reset EIP blocks and check if reset is complete

View File

@ -7,7 +7,7 @@ PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-11-13
PKG_SOURCE_VERSION:=d5ee67b
PKG_MIRROR_HASH:=1b1caab382e257728b00638231301af712c3ac351e449ea30f9bb1a89f961580
PKG_MIRROR_HASH:=4969320b2315eb07aefec4e189973800dd909c487794cc8383417fd2f97e689f
QSDK_VERSION:=12.5
PKG_VERSION:=$(QSDK_VERSION).$(subst -,.,$(PKG_SOURCE_DATE))~$(PKG_SOURCE_VERSION)

View File

@ -837,6 +837,54 @@
* nss_qrfs_register_handler()
*/
void nss_qrfs_register_handler(struct nss_ctx_instance *nss_ctx)
--- a/exports/nss_qrfs.h
+++ b/exports/nss_qrfs.h
@@ -1,6 +1,6 @@
/*
**************************************************************************
- * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, 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.
@@ -110,6 +110,7 @@ struct nss_qrfs_msg {
} msg; /**< Message payload. */
};
+#ifdef __KERNEL__
/**
* Callback function for receiving QRFS messages.
*
@@ -176,6 +177,23 @@ void nss_qrfs_notify_unregister(int core
* Status of the Tx operation.
*/
nss_tx_status_t nss_qrfs_set_flow_rule(struct sk_buff *skb, uint32_t cpu, uint32_t action);
+/**
+ * nss_qrfs_configure_flow_rule
+ * Configures and sends a QRFS message to the NSS core to configure(add/remove) the flow rule.
+ *
+ * @param[in] dst_addr Destination IP address.
+ * @param[in] src_addr Source IP address.
+ * @param[in] dst_port Destination port.
+ * @param[in] src_port Source port.
+ * @param[in] version IP version.
+ * @param[in] proto Protocol.
+ * @param[in] cpu CPU number to be offloaded to.
+ * @param[in] type Type of action to perform on the flow table, can be add or delete.
+ *
+ * @return
+ * Status of the Tx operation.
+ */
+nss_tx_status_t nss_qrfs_configure_flow_rule(uint32_t *dst_addr, uint32_t *src_addr, uint16_t dst_port, uint16_t src_port, uint32_t version, uint16_t proto, uint16_t cpu, enum nss_qrfs_msg_types type);
/**
* nss_qrfs_init
@@ -190,4 +208,5 @@ void nss_qrfs_init(void);
* @}
*/
+#endif
#endif /* __NSS_QRFS_H */
--- a/nss_rmnet_rx.c
+++ b/nss_rmnet_rx.c
@@ -243,6 +243,8 @@ static int nss_rmnet_rx_handle_destroy_s

View File

@ -0,0 +1,799 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -35,34 +35,16 @@
#endif
#endif
#include <linux/etherdevice.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0))
+#include <linux/skbuff_ref.h>
+#endif
#include "nss_tx_rx_common.h"
#include "nss_data_plane.h"
#define NSS_CORE_JUMBO_LINEAR_BUF_SIZE 128
#if (NSS_SKB_REUSE_SUPPORT == 1)
-/*
- * We have validated the skb recycling code within the NSS for the
- * following kernel versions. Before enabling the driver in new kernels,
- * the skb recycle code must be checked against Linux skb handling.
- *
- * Tested on: 3.4, 3.10, 3.14, 3.18, 4.4 and 5.4
- */
-#if (!( \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)))) || \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)))) || \
-(((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, 10, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)))) || \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)))) || \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 14, 0))))))
-#error "Check skb recycle code in this file to match Linux version"
-#endif
-
static atomic_t max_reuse = ATOMIC_INIT(PAGE_SIZE);
-
#endif /* NSS_SKB_REUSE_SUPPORT */
static int max_ipv4_conn = NSS_DEFAULT_NUM_CONN;
--- a/Makefile
+++ b/Makefile
@@ -547,7 +547,7 @@ ccflags-y += -I$(obj)/nss_hal/include -I
ccflags-y += -I$(obj)/nss_data_plane/hal/include
ccflags-y += -DNSS_PM_DEBUG_LEVEL=0 -DNSS_SKB_REUSE_SUPPORT=1
-ccflags-y += -Wall -Werror
+ccflags-y += -Wall -Werror -Wno-missing-declarations -Wno-missing-prototypes
KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
@@ -579,6 +579,8 @@ qca-nss-drv-objs += \
ccflags-y += -DNSS_FREQ_SCALE_SUPPORT=1
endif
+ccflags-y += -include $(obj)/compat.h
+
ccflags-y += $(NSS_CCFLAGS)
export NSS_CCFLAGS
--- a/nss_init.c
+++ b/nss_init.c
@@ -115,10 +115,17 @@ static inline int nss_probe(struct platf
* nss_remove()
* HLOS device remove callback
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
static inline int nss_remove(struct platform_device *nss_dev)
{
return nss_hal_remove(nss_dev);
}
+#else
+static inline void nss_remove(struct platform_device *nss_dev)
+{
+ nss_hal_remove(nss_dev);
+}
+#endif
#if (NSS_DT_SUPPORT == 1)
/*
@@ -128,7 +135,6 @@ struct of_device_id nss_dt_ids[] = {
{ .compatible = "qcom,nss" },
{ .compatible = "qcom,nss0" },
{ .compatible = "qcom,nss1" },
- {},
};
MODULE_DEVICE_TABLE(of, nss_dt_ids);
#endif
@@ -168,7 +174,7 @@ static void nss_reset_frequency_stats_sa
* nss_current_freq_handler()
* Handle Userspace Frequency Change Requests
*/
-static int nss_current_freq_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_current_freq_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, i;
@@ -228,7 +234,7 @@ static int nss_current_freq_handler(stru
* nss_auto_scale_handler()
* Enables or Disable Auto Scaling
*/
-static int nss_auto_scale_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_auto_scale_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -293,7 +299,7 @@ static int nss_auto_scale_handler(struct
* nss_get_freq_table_handler()
* Display Support Freq and Ex how to Change.
*/
-static int nss_get_freq_table_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_freq_table_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, i;
@@ -322,7 +328,7 @@ static int nss_get_freq_table_handler(st
* nss_get_average_inst_handler()
* Display AVG Inst Per Ms.
*/
-static int nss_get_average_inst_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_average_inst_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -344,7 +350,7 @@ static int nss_get_average_inst_handler(
* nss_debug_handler()
* Enable NSS debug output
*/
-static int nss_debug_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_debug_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -364,7 +370,7 @@ static int nss_debug_handler(struct ctl_
* nss_coredump_handler()
* Send Signal To Coredump NSS Cores
*/
-static int nss_coredump_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_coredump_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[NSS_CORE_0];
int ret;
@@ -389,7 +395,7 @@ static int nss_coredump_handler(struct c
* nss_jumbo_mru_handler()
* Sysctl to modify nss_jumbo_mru
*/
-static int nss_jumbo_mru_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_jumbo_mru_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -410,7 +416,7 @@ static int nss_jumbo_mru_handler(struct
* Sysctl to modify nss_paged_mode.
*/
-static int nss_paged_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_paged_mode_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -432,7 +438,7 @@ static int nss_paged_mode_handler(struct
* nss_get_min_reuse_handler()
* Sysctl to get min reuse sizes
*/
-static int nss_get_min_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_min_reuse_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
struct nss_ctx_instance *nss_ctx = NULL;
@@ -459,7 +465,7 @@ static int nss_get_min_reuse_handler(str
* nss_max_reuse_handler()
* Sysctl to modify nss_max_reuse
*/
-static int nss_max_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_max_reuse_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -494,8 +500,7 @@ static struct ctl_table nss_skb_reuse_ta
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_max_reuse_handler,
- },
- { }
+ }
};
#endif
@@ -531,8 +536,7 @@ static struct ctl_table nss_freq_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_get_average_inst_handler,
- },
- { }
+ }
};
#endif
@@ -580,8 +584,7 @@ static struct ctl_table nss_general_tabl
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_paged_mode_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_clock_header;
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -70,7 +70,7 @@ static size_t nss_stats_spacing(uint64_t
* nss_stats_nonzero_handler()
* Handler to take nonzero stats print configuration.
*/
-static int nss_stats_nonzero_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_stats_nonzero_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -84,8 +84,7 @@ static struct ctl_table nss_stats_table[
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_stats_nonzero_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_stats_header;
@@ -228,7 +227,7 @@ size_t nss_stats_banner(char *lbuf, size
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "<");
}
- strlcpy(node_upr, node, NSS_STATS_NODE_NAME_MAX);
+ strscpy(node_upr, node, NSS_STATS_NODE_NAME_MAX + 1);
for (i = 0; node_upr[i] != '\0' && i < NSS_STATS_NODE_NAME_MAX; i++) {
node_upr[i] = toupper(node_upr[i]);
}
@@ -293,7 +292,7 @@ size_t nss_stats_print(char *node, char
continue;
}
- strlcpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
+ strscpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
/*
* Converting uppercase to lower case.
@@ -302,7 +301,7 @@ size_t nss_stats_print(char *node, char
stats_string[j] = tolower(stats_string[j]);
}
- strlcpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX);
+ strscpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX + 1);
for (j = 0; node_lwr[j] != '\0' && j < NSS_STATS_NODE_NAME_MAX; j++) {
node_lwr[j] = tolower(node_lwr[j]);
}
--- a/nss_tunipip6_stats.c
+++ b/nss_tunipip6_stats.c
@@ -16,6 +16,10 @@
**************************************************************************
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#endif
+
#include "nss_core.h"
#include "nss_tunipip6.h"
#include "nss_stats.h"
--- /dev/null
+++ b/compat.h
@@ -0,0 +1,14 @@
+// compat.h
+#ifndef _COMPAT_H
+#define _COMPAT_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#define compat_const const
+#else
+#define compat_const
+#endif
+
+#endif /* _COMPAT_H */
--- a/nss_c2c_tx.c
+++ b/nss_c2c_tx.c
@@ -284,7 +284,7 @@ EXPORT_SYMBOL(nss_c2c_tx_msg_init);
* nss_c2c_tx_performance_test_handler()
* Handles the performance test.
*/
-static int nss_c2c_tx_performance_test_handler(struct ctl_table *ctl, int write,
+static int nss_c2c_tx_performance_test_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -330,8 +330,7 @@ static struct ctl_table nss_c2c_tx_table
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_c2c_tx_performance_test_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_c2c_tx_header;
--- a/nss_dma.c
+++ b/nss_dma.c
@@ -284,7 +284,7 @@ EXPORT_SYMBOL(nss_dma_get_context);
* nss_dma_test_handler()
* Handles the performance test.
*/
-static int nss_dma_test_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_dma_test_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_dma_get_context();
int cur_state = test_cfg.run.val;
@@ -374,8 +374,7 @@ static struct ctl_table nss_dma_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
static struct ctl_table_header *nss_dma_header;
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -599,7 +599,7 @@ void nss_ipv4_free_conn_tables(void)
* nss_ipv4_accel_mode_cfg_handler()
* Configure acceleration mode for IPv4
*/
-static int nss_ipv4_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_accel_mode_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -643,7 +643,7 @@ static int nss_ipv4_accel_mode_cfg_handl
* nss_ipv4_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv4_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_dscp_map_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -708,8 +708,7 @@ static struct ctl_table nss_ipv4_table[]
.maxlen = sizeof(struct nss_dscp_map_entry),
.mode = 0644,
.proc_handler = &nss_ipv4_dscp_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_ipv4_header;
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -595,7 +595,7 @@ void nss_ipv6_free_conn_tables(void)
* nss_ipv6_accel_mode_cfg_handler()
* Configure acceleration mode for IPv6
*/
-static int nss_ipv6_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_accel_mode_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -639,7 +639,7 @@ static int nss_ipv6_accel_mode_cfg_handl
* nss_ipv6_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv6_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_dscp_map_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -703,8 +703,7 @@ static struct ctl_table nss_ipv6_table[]
.maxlen = sizeof(struct nss_dscp_map_entry),
.mode = 0644,
.proc_handler = &nss_ipv6_dscp_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_ipv6_header;
--- a/nss_log.c
+++ b/nss_log.c
@@ -524,7 +524,7 @@ fail:
* nss_logbuffer_handler()
* Enable NSS debug output
*/
-int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+int nss_logbuffer_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
int core_status;
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -344,7 +344,7 @@ static int nss_n2h_get_paged_payload_inf
* nss_n2h_set_empty_buf_pool()
* Sets empty pool buffer
*/
-static int nss_n2h_set_empty_buf_pool(struct ctl_table *ctl, int write,
+static int nss_n2h_set_empty_buf_pool(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
nss_ptr_t core_num, int *new_val)
@@ -446,7 +446,7 @@ failure:
* nss_n2h_set_empty_paged_pool_buf()
* Sets empty paged pool buffer
*/
-static int nss_n2h_set_empty_paged_pool_buf(struct ctl_table *ctl, int write,
+static int nss_n2h_set_empty_paged_pool_buf(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
nss_ptr_t core_num, int *new_val)
@@ -548,7 +548,7 @@ failure:
* nss_n2h_set_water_mark()
* Sets water mark for N2H SOS
*/
-static int nss_n2h_set_water_mark(struct ctl_table *ctl, int write,
+static int nss_n2h_set_water_mark(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
uint32_t core_num, int *low, int *high)
@@ -662,7 +662,7 @@ failure:
* nss_n2h_set_paged_water_mark()
* Sets water mark for paged pool N2H SOS
*/
-static int nss_n2h_set_paged_water_mark(struct ctl_table *ctl, int write,
+static int nss_n2h_set_paged_water_mark(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
uint32_t core_num, int *low, int *high)
@@ -776,7 +776,7 @@ failure:
* nss_n2h_cfg_wifi_pool()
* Sets number of wifi payloads to adjust high water mark for N2H SoS
*/
-static int nss_n2h_cfg_wifi_pool(struct ctl_table *ctl, int write,
+static int nss_n2h_cfg_wifi_pool(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
int *payloads)
@@ -873,7 +873,7 @@ failure:
* nss_n2h_empty_pool_buf_core1_handler()
* Sets the number of empty buffer for core 1
*/
-static int nss_n2h_empty_pool_buf_cfg_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_pool_buf_cfg_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -885,7 +885,7 @@ static int nss_n2h_empty_pool_buf_cfg_co
* nss_n2h_empty_pool_buf_core0_handler()
* Sets the number of empty buffer for core 0
*/
-static int nss_n2h_empty_pool_buf_cfg_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_pool_buf_cfg_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -897,7 +897,7 @@ static int nss_n2h_empty_pool_buf_cfg_co
* nss_n2h_empty_paged_pool_buf_cfg_core1_handler()
* Sets the number of empty paged buffer for core 1
*/
-static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -909,7 +909,7 @@ static int nss_n2h_empty_paged_pool_buf_
* nss_n2h_empty_paged_pool_buf_cfg_core0_handler()
* Sets the number of empty paged buffer for core 0
*/
-static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -921,7 +921,7 @@ static int nss_n2h_empty_paged_pool_buf_
* nss_n2h_water_mark_core1_handler()
* Sets water mark for core 1
*/
-static int nss_n2h_water_mark_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_water_mark_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -934,7 +934,7 @@ static int nss_n2h_water_mark_core1_hand
* nss_n2h_water_mark_core0_handler()
* Sets water mark for core 0
*/
-static int nss_n2h_water_mark_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_water_mark_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -947,7 +947,7 @@ static int nss_n2h_water_mark_core0_hand
* nss_n2h_paged_water_mark_core1_handler()
* Sets paged water mark for core 1
*/
-static int nss_n2h_paged_water_mark_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_paged_water_mark_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -960,7 +960,7 @@ static int nss_n2h_paged_water_mark_core
* nss_n2h_paged_water_mark_core0_handler()
* Sets paged water mark for core 0
*/
-static int nss_n2h_paged_water_mark_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_paged_water_mark_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -973,7 +973,7 @@ static int nss_n2h_paged_water_mark_core
* nss_n2h_wifi_payloads_handler()
* Sets number of wifi payloads
*/
-static int nss_n2h_wifi_payloads_handler(struct ctl_table *ctl,
+static int nss_n2h_wifi_payloads_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1250,7 +1250,7 @@ failure:
* nss_mitigation_handler()
* Enable NSS MITIGATION
*/
-static int nss_n2h_mitigationcfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_mitigationcfg_core0_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0];
@@ -1281,7 +1281,7 @@ static int nss_n2h_mitigationcfg_core0_h
* nss_mitigation_handler()
* Enable NSS MITIGATION
*/
-static int nss_n2h_mitigationcfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_mitigationcfg_core1_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1];
@@ -1312,7 +1312,7 @@ static int nss_n2h_mitigationcfg_core1_h
* nss_buf_handler()
* Add extra NSS bufs from host memory
*/
-static int nss_n2h_buf_cfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_buf_cfg_core0_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0];
@@ -1351,7 +1351,7 @@ static int nss_n2h_buf_cfg_core0_handler
* nss_n2h_buf_handler()
* Add extra NSS bufs from host memory
*/
-static int nss_n2h_buf_cfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_buf_cfg_core1_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1];
@@ -1404,7 +1404,7 @@ static void nss_n2h_queue_limit_callback
* nss_n2h_set_queue_limit_sync()
* Sets the n2h queue size limit synchronously.
*/
-static int nss_n2h_set_queue_limit_sync(struct ctl_table *ctl, int write, void __user *buffer,
+static int nss_n2h_set_queue_limit_sync(compat_const struct ctl_table *ctl, int write, void __user *buffer,
size_t *lenp, loff_t *ppos, uint32_t core_id)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -1481,7 +1481,7 @@ static int nss_n2h_set_queue_limit_sync(
* nss_n2h_queue_limit_core0_handler()
* Sets the n2h queue size limit for core0
*/
-static int nss_n2h_queue_limit_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_queue_limit_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1493,7 +1493,7 @@ static int nss_n2h_queue_limit_core0_han
* nss_n2h_queue_limit_core1_handler()
* Sets the n2h queue size limit for core1
*/
-static int nss_n2h_queue_limit_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_queue_limit_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1571,7 +1571,7 @@ static nss_tx_status_t nss_n2h_host_bp_c
* nss_n2h_host_bp_cfg_handler()
* Enable n2h back pressure.
*/
-static int nss_n2h_host_bp_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos, uint32_t core_id)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -1609,7 +1609,7 @@ static int nss_n2h_host_bp_cfg_handler(s
* nss_n2h_host_bp_cfg_core0_handler()
* Enable n2h back pressure in core 0.
*/
-static int nss_n2h_host_bp_cfg_core0_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_core0_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_0);
@@ -1619,7 +1619,7 @@ static int nss_n2h_host_bp_cfg_core0_han
* nss_n2h_host_bp_cfg_core1_handler()
* Enable n2h back pressure in core 1.
*/
-static int nss_n2h_host_bp_cfg_core1_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_core1_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_1);
@@ -1702,9 +1702,7 @@ static struct ctl_table nss_n2h_table_si
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_n2h_host_bp_cfg_core0_handler,
- },
-
- { }
+ }
};
static struct ctl_table nss_n2h_table_multi_core[] = {
@@ -1855,8 +1853,7 @@ static struct ctl_table nss_n2h_table_mu
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_n2h_host_bp_cfg_core1_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_n2h_header;
--- a/nss_ppe_vp.c
+++ b/nss_ppe_vp.c
@@ -215,7 +215,7 @@ static void nss_ppe_vp_callback(void *ap
* Since ath0 has only one type i.e. ath0 is NSS_DYNAMIC_INTERFACE_TYPE_VAP, the above command can be rewritten as
* echo ath0 > /proc/sys/nss/ppe_vp/create => Here 6 can be ignored.
*/
-static nss_if_num_t nss_ppe_vp_parse_vp_cmd(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static nss_if_num_t nss_ppe_vp_parse_vp_cmd(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int32_t if_num;
struct net_device *dev;
@@ -693,7 +693,7 @@ static void nss_ppe_vp_handler(struct ns
* nss_ppe_vp_destroy_handler()
* PPE VP destroy handler.
*/
-static int nss_ppe_vp_destroy_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ppe_vp_destroy_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context();
int32_t if_num;
@@ -730,7 +730,7 @@ static int nss_ppe_vp_destroy_handler(st
* nss_ppe_vp_create_handler()
* PPE VP create handler.
*/
-static int nss_ppe_vp_create_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ppe_vp_create_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int32_t if_num;
struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context();
--- a/nss_pppoe.c
+++ b/nss_pppoe.c
@@ -203,7 +203,7 @@ static void nss_pppoe_handler(struct nss
* nss_pppoe_br_accel_mode_handler()
* Enable/disable pppoe bridge acceleration in NSS
*/
-int nss_pppoe_br_accel_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+int nss_pppoe_br_accel_mode_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context();
struct nss_pppoe_msg npm;
@@ -349,8 +349,7 @@ static struct ctl_table nss_pppoe_table[
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_pppoe_br_accel_mode_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_pppoe_header;
--- a/nss_project.c
+++ b/nss_project.c
@@ -229,7 +229,7 @@ static void nss_project_msg_handler(stru
* Uses proc_dointvec to process data. For a write operation, also sends worker
* thread stats enable messages containing the new value to each NSS core.
*/
-static int nss_project_wt_stats_handler(struct ctl_table *ctl, int write,
+static int nss_project_wt_stats_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -275,8 +275,7 @@ static struct ctl_table nss_project_tabl
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_project_wt_stats_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_project_header;
--- a/nss_rps.c
+++ b/nss_rps.c
@@ -401,7 +401,7 @@ static nss_tx_status_t nss_rps_pri_map_c
* nss_rps_cfg_handler()
* Enable NSS RPS.
*/
-static int nss_rps_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -452,7 +452,7 @@ static int nss_rps_cfg_handler(struct ct
* nss_rps_hash_bitmap_cfg_handler()
* Configure NSS rps_hash_bitmap
*/
-static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_hash_bitmap_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -515,7 +515,7 @@ static int nss_rps_hash_bitmap_cfg_handl
/* nss_rps_pri_map_cfg_handler()
* Configure NSS rps_pri_map
*/
-static int nss_rps_pri_map_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_pri_map_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -568,8 +568,7 @@ static struct ctl_table nss_rps_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_rps_pri_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_rps_header;
--- a/nss_core.h
+++ b/nss_core.h
@@ -990,7 +990,7 @@ extern void nss_stats_clean(void);
*/
extern void nss_log_init(void);
extern bool nss_debug_log_buffer_alloc(uint8_t nss_id, uint32_t nentry);
-extern int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos);
+extern int nss_logbuffer_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos);
/*
* APIs to set jumbo_mru & paged_mode
--- a/nss_dscp_map.h
+++ b/nss_dscp_map.h
@@ -46,7 +46,7 @@ struct nss_dscp_map_parse {
* nss_dscp_map_print()
* Sysctl handler for printing dscp/pri mapping.
*/
-static int nss_dscp_map_print(struct ctl_table *ctl, void *buffer, size_t *lenp,
+static int nss_dscp_map_print(compat_const struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_entry *mapping)
{
char *r_buf;
@@ -115,7 +115,7 @@ static int nss_dscp_map_print(struct ctl
* nss_dscp_map_parse()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_dscp_map_parse(struct ctl_table *ctl, void *buffer, size_t *lenp,
+static int nss_dscp_map_parse(compat_const struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_parse *out)
{
int count;
--- a/nss_n2h_stats.c
+++ b/nss_n2h_stats.c
@@ -43,6 +43,7 @@ static ssize_t nss_n2h_stats_read(struct
size_t size_wr = 0;
ssize_t bytes_read = 0;
uint64_t *stats_shadow;
+ char n2h_tag[7];
char *lbuf = kzalloc(size_al, GFP_KERNEL);
if (unlikely(lbuf == NULL)) {
@@ -66,7 +67,8 @@ static ssize_t nss_n2h_stats_read(struct
stats_shadow[i] = nss_n2h_stats[core][i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr += nss_stats_banner(lbuf, size_wr, size_al, "n2h", core);
+ snprintf(n2h_tag, 7, "N2H %d", core);
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, n2h_tag, NSS_STATS_SINGLE_CORE);
size_wr += nss_stats_print("n2h", NULL, NSS_STATS_SINGLE_INSTANCE
, nss_n2h_strings_stats
, stats_shadow

View File

@ -1,6 +1,6 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -2233,12 +2233,16 @@ static void nss_core_handle_cause_nonque
@@ -2215,12 +2215,16 @@ static void nss_core_handle_cause_nonque
* of processor will prevent any excessive penalties.
*/
if (unlikely(nss_ctx->state == NSS_CORE_STATE_UNINITIALIZED)) {

View File

@ -0,0 +1,788 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -38,6 +38,9 @@
#endif
#endif
#include <linux/etherdevice.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0))
+#include <linux/skbuff_ref.h>
+#endif
#include "nss_tx_rx_common.h"
#ifdef NSS_DATA_PLANE_GENERIC_SUPPORT
@@ -50,26 +53,7 @@
#define NSS_CORE_JUMBO_LINEAR_BUF_SIZE 128
#if (NSS_SKB_REUSE_SUPPORT == 1)
-/*
- * We have validated the skb recycling code within the NSS for the
- * following kernel versions. Before enabling the driver in new kernels,
- * the skb recycle code must be checked against Linux skb handling.
- *
- * Tested on: 3.4, 3.10, 3.14, 3.18, 4.4, 5.4 and 6.6
- */
-#if (!( \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)))) || \
-(((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)))) || \
-(((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(6, 6, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0))))))
-#error "Check skb recycle code in this file to match Linux version"
-#endif
-
static atomic_t max_reuse = ATOMIC_INIT(PAGE_SIZE);
-
#endif /* NSS_SKB_REUSE_SUPPORT */
static int max_ipv4_conn = NSS_DEFAULT_NUM_CONN;
--- a/Makefile
+++ b/Makefile
@@ -598,7 +598,7 @@ ccflags-y += -I$(obj)/nss_hal/include -I
ccflags-y += -I$(obj)/nss_data_plane/hal/include
ccflags-y += -DNSS_PM_DEBUG_LEVEL=0 -DNSS_SKB_REUSE_SUPPORT=1
-ccflags-y += -Wall -Werror
+ccflags-y += -Wall -Werror -Wno-missing-declarations -Wno-missing-prototypes
KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
@@ -630,6 +630,8 @@ qca-nss-drv-objs += \
ccflags-y += -DNSS_FREQ_SCALE_SUPPORT=1
endif
+ccflags-y += -include $(obj)/compat.h
+
ccflags-y += $(NSS_CCFLAGS)
export NSS_CCFLAGS
--- a/nss_init.c
+++ b/nss_init.c
@@ -123,10 +123,17 @@ static inline int nss_probe(struct platf
* nss_remove()
* HLOS device remove callback
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
static inline int nss_remove(struct platform_device *nss_dev)
{
return nss_hal_remove(nss_dev);
}
+#else
+static inline void nss_remove(struct platform_device *nss_dev)
+{
+ nss_hal_remove(nss_dev);
+}
+#endif
#if (NSS_DT_SUPPORT == 1)
/*
@@ -136,7 +143,6 @@ struct of_device_id nss_dt_ids[] = {
{ .compatible = "qcom,nss" },
{ .compatible = "qcom,nss0" },
{ .compatible = "qcom,nss1" },
- {},
};
MODULE_DEVICE_TABLE(of, nss_dt_ids);
#endif
@@ -176,7 +182,7 @@ static void nss_reset_frequency_stats_sa
* nss_current_freq_handler()
* Handle Userspace Frequency Change Requests
*/
-static int nss_current_freq_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_current_freq_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, i;
@@ -236,7 +242,7 @@ static int nss_current_freq_handler(stru
* nss_auto_scale_handler()
* Enables or Disable Auto Scaling
*/
-static int nss_auto_scale_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_auto_scale_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -301,7 +307,7 @@ static int nss_auto_scale_handler(struct
* nss_get_freq_table_handler()
* Display Support Freq and Ex how to Change.
*/
-static int nss_get_freq_table_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_freq_table_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret, i;
@@ -330,7 +336,7 @@ static int nss_get_freq_table_handler(st
* nss_get_average_inst_handler()
* Display AVG Inst Per Ms.
*/
-static int nss_get_average_inst_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_average_inst_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -352,7 +358,7 @@ static int nss_get_average_inst_handler(
* nss_debug_handler()
* Enable NSS debug output
*/
-static int nss_debug_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_debug_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -372,7 +378,7 @@ static int nss_debug_handler(struct ctl_
* nss_coredump_handler()
* Send Signal To Coredump NSS Cores
*/
-static int nss_coredump_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_coredump_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[NSS_CORE_0];
int ret;
@@ -397,7 +403,7 @@ static int nss_coredump_handler(struct c
* nss_jumbo_mru_handler()
* Sysctl to modify nss_jumbo_mru
*/
-static int nss_jumbo_mru_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_jumbo_mru_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -418,7 +424,7 @@ static int nss_jumbo_mru_handler(struct
* Sysctl to modify nss_paged_mode.
*/
-static int nss_paged_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_paged_mode_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -440,7 +446,7 @@ static int nss_paged_mode_handler(struct
* nss_get_min_reuse_handler()
* Sysctl to get min reuse sizes
*/
-static int nss_get_min_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_get_min_reuse_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
struct nss_ctx_instance *nss_ctx = NULL;
@@ -467,7 +473,7 @@ static int nss_get_min_reuse_handler(str
* nss_max_reuse_handler()
* Sysctl to modify nss_max_reuse
*/
-static int nss_max_reuse_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_max_reuse_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -502,8 +508,7 @@ static struct ctl_table nss_skb_reuse_ta
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_max_reuse_handler,
- },
- { }
+ }
};
#endif
@@ -539,8 +544,7 @@ static struct ctl_table nss_freq_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_get_average_inst_handler,
- },
- { }
+ }
};
#endif
@@ -588,8 +592,7 @@ static struct ctl_table nss_general_tabl
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_paged_mode_handler,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
--- a/nss_stats.c
+++ b/nss_stats.c
@@ -70,7 +70,7 @@ static size_t nss_stats_spacing(uint64_t
* nss_stats_nonzero_handler()
* Handler to take nonzero stats print configuration.
*/
-static int nss_stats_nonzero_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_stats_nonzero_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -84,8 +84,7 @@ static struct ctl_table nss_stats_table[
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_stats_nonzero_handler,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
@@ -261,7 +260,7 @@ size_t nss_stats_banner(char *lbuf, size
size_wr += scnprintf(lbuf + size_wr, size_al - size_wr, "<");
}
- strlcpy(node_upr, node, NSS_STATS_NODE_NAME_MAX);
+ strscpy(node_upr, node, NSS_STATS_NODE_NAME_MAX + 1);
for (i = 0; node_upr[i] != '\0' && i < NSS_STATS_NODE_NAME_MAX; i++) {
node_upr[i] = toupper(node_upr[i]);
}
@@ -326,7 +325,7 @@ size_t nss_stats_print(char *node, char
continue;
}
- strlcpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
+ strscpy(stats_string, stats_info[i].stats_name, NSS_STATS_MAX_STR_LENGTH);
/*
* Converting uppercase to lower case.
@@ -335,7 +334,7 @@ size_t nss_stats_print(char *node, char
stats_string[j] = tolower(stats_string[j]);
}
- strlcpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX);
+ strscpy(node_lwr, node, NSS_STATS_NODE_NAME_MAX + 1);
for (j = 0; node_lwr[j] != '\0' && j < NSS_STATS_NODE_NAME_MAX; j++) {
node_lwr[j] = tolower(node_lwr[j]);
}
--- a/nss_tunipip6_stats.c
+++ b/nss_tunipip6_stats.c
@@ -17,6 +17,10 @@
**************************************************************************
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#endif
+
#include "nss_core.h"
#include "nss_tunipip6.h"
#include "nss_stats.h"
--- /dev/null
+++ b/compat.h
@@ -0,0 +1,14 @@
+// compat.h
+#ifndef _COMPAT_H
+#define _COMPAT_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 10, 0)
+#include <linux/vmalloc.h>
+#define compat_const const
+#else
+#define compat_const
+#endif
+
+#endif /* _COMPAT_H */
--- a/nss_c2c_tx.c
+++ b/nss_c2c_tx.c
@@ -284,7 +284,7 @@ EXPORT_SYMBOL(nss_c2c_tx_msg_init);
* nss_c2c_tx_performance_test_handler()
* Handles the performance test.
*/
-static int nss_c2c_tx_performance_test_handler(struct ctl_table *ctl, int write,
+static int nss_c2c_tx_performance_test_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -330,8 +330,7 @@ static struct ctl_table nss_c2c_tx_table
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_c2c_tx_performance_test_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_c2c_tx_header;
--- a/nss_dma.c
+++ b/nss_dma.c
@@ -285,7 +285,7 @@ EXPORT_SYMBOL(nss_dma_get_context);
* nss_dma_test_handler()
* Handles the performance test.
*/
-static int nss_dma_test_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_dma_test_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_dma_get_context();
int cur_state = test_cfg.run.val;
@@ -375,8 +375,7 @@ static struct ctl_table nss_dma_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -599,7 +599,7 @@ void nss_ipv4_free_conn_tables(void)
* nss_ipv4_accel_mode_cfg_handler()
* Configure acceleration mode for IPv4
*/
-static int nss_ipv4_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_accel_mode_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -643,7 +643,7 @@ static int nss_ipv4_accel_mode_cfg_handl
* nss_ipv4_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv4_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv4_dscp_map_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -708,8 +708,7 @@ static struct ctl_table nss_ipv4_table[]
.maxlen = sizeof(struct nss_dscp_map_entry),
.mode = 0644,
.proc_handler = &nss_ipv4_dscp_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_ipv4_header;
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -595,7 +595,7 @@ void nss_ipv6_free_conn_tables(void)
* nss_ipv6_accel_mode_cfg_handler()
* Configure acceleration mode for IPv6
*/
-static int nss_ipv6_accel_mode_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_accel_mode_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -639,7 +639,7 @@ static int nss_ipv6_accel_mode_cfg_handl
* nss_ipv6_dscp_map_cfg_handler()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_ipv6_dscp_map_cfg_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ipv6_dscp_map_cfg_handler(compat_const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[0];
@@ -703,8 +703,7 @@ static struct ctl_table nss_ipv6_table[]
.maxlen = sizeof(struct nss_dscp_map_entry),
.mode = 0644,
.proc_handler = &nss_ipv6_dscp_map_cfg_handler,
- },
- { }
+ }
};
static struct ctl_table_header *nss_ipv6_header;
--- a/nss_log.c
+++ b/nss_log.c
@@ -524,7 +524,7 @@ fail:
* nss_logbuffer_handler()
* Enable NSS debug output
*/
-int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+int nss_logbuffer_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
int core_status;
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -357,7 +357,7 @@ static int nss_n2h_get_paged_payload_inf
* nss_n2h_set_empty_buf_pool()
* Sets empty pool buffer
*/
-static int nss_n2h_set_empty_buf_pool(struct ctl_table *ctl, int write,
+static int nss_n2h_set_empty_buf_pool(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
nss_ptr_t core_num, int *new_val)
@@ -459,7 +459,7 @@ failure:
* nss_n2h_set_empty_paged_pool_buf()
* Sets empty paged pool buffer
*/
-static int nss_n2h_set_empty_paged_pool_buf(struct ctl_table *ctl, int write,
+static int nss_n2h_set_empty_paged_pool_buf(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
nss_ptr_t core_num, int *new_val)
@@ -561,7 +561,7 @@ failure:
* nss_n2h_set_water_mark()
* Sets water mark for N2H SOS
*/
-static int nss_n2h_set_water_mark(struct ctl_table *ctl, int write,
+static int nss_n2h_set_water_mark(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
uint32_t core_num, int *low, int *high)
@@ -675,7 +675,7 @@ failure:
* nss_n2h_set_paged_water_mark()
* Sets water mark for paged pool N2H SOS
*/
-static int nss_n2h_set_paged_water_mark(struct ctl_table *ctl, int write,
+static int nss_n2h_set_paged_water_mark(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
uint32_t core_num, int *low, int *high)
@@ -789,7 +789,7 @@ failure:
* nss_n2h_cfg_wifi_pool()
* Sets number of wifi payloads to adjust high water mark for N2H SoS
*/
-static int nss_n2h_cfg_wifi_pool(struct ctl_table *ctl, int write,
+static int nss_n2h_cfg_wifi_pool(compat_const struct ctl_table *ctl, int write,
void __user *buffer,
size_t *lenp, loff_t *ppos,
int *payloads)
@@ -886,7 +886,7 @@ failure:
* nss_n2h_empty_pool_buf_core1_handler()
* Sets the number of empty buffer for core 1
*/
-static int nss_n2h_empty_pool_buf_cfg_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_pool_buf_cfg_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -898,7 +898,7 @@ static int nss_n2h_empty_pool_buf_cfg_co
* nss_n2h_empty_pool_buf_core0_handler()
* Sets the number of empty buffer for core 0
*/
-static int nss_n2h_empty_pool_buf_cfg_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_pool_buf_cfg_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -910,7 +910,7 @@ static int nss_n2h_empty_pool_buf_cfg_co
* nss_n2h_empty_paged_pool_buf_cfg_core1_handler()
* Sets the number of empty paged buffer for core 1
*/
-static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_paged_pool_buf_cfg_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -922,7 +922,7 @@ static int nss_n2h_empty_paged_pool_buf_
* nss_n2h_empty_paged_pool_buf_cfg_core0_handler()
* Sets the number of empty paged buffer for core 0
*/
-static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_empty_paged_pool_buf_cfg_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -934,7 +934,7 @@ static int nss_n2h_empty_paged_pool_buf_
* nss_n2h_water_mark_core1_handler()
* Sets water mark for core 1
*/
-static int nss_n2h_water_mark_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_water_mark_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -947,7 +947,7 @@ static int nss_n2h_water_mark_core1_hand
* nss_n2h_water_mark_core0_handler()
* Sets water mark for core 0
*/
-static int nss_n2h_water_mark_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_water_mark_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -960,7 +960,7 @@ static int nss_n2h_water_mark_core0_hand
* nss_n2h_paged_water_mark_core1_handler()
* Sets paged water mark for core 1
*/
-static int nss_n2h_paged_water_mark_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_paged_water_mark_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -973,7 +973,7 @@ static int nss_n2h_paged_water_mark_core
* nss_n2h_paged_water_mark_core0_handler()
* Sets paged water mark for core 0
*/
-static int nss_n2h_paged_water_mark_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_paged_water_mark_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -986,7 +986,7 @@ static int nss_n2h_paged_water_mark_core
* nss_n2h_wifi_payloads_handler()
* Sets number of wifi payloads
*/
-static int nss_n2h_wifi_payloads_handler(struct ctl_table *ctl,
+static int nss_n2h_wifi_payloads_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1281,7 +1281,7 @@ failure:
* nss_mitigation_handler()
* Enable NSS MITIGATION
*/
-static int nss_n2h_mitigationcfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_mitigationcfg_core0_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0];
@@ -1312,7 +1312,7 @@ static int nss_n2h_mitigationcfg_core0_h
* nss_mitigation_handler()
* Enable NSS MITIGATION
*/
-static int nss_n2h_mitigationcfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_mitigationcfg_core1_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1];
@@ -1343,7 +1343,7 @@ static int nss_n2h_mitigationcfg_core1_h
* nss_buf_handler()
* Add extra NSS bufs from host memory
*/
-static int nss_n2h_buf_cfg_core0_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_buf_cfg_core0_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_0];
@@ -1382,7 +1382,7 @@ static int nss_n2h_buf_cfg_core0_handler
* nss_n2h_buf_handler()
* Add extra NSS bufs from host memory
*/
-static int nss_n2h_buf_cfg_core1_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_n2h_buf_cfg_core1_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
struct nss_ctx_instance *nss_ctx = &nss_top->nss[NSS_CORE_1];
@@ -1435,7 +1435,7 @@ static void nss_n2h_queue_limit_callback
* nss_n2h_set_queue_limit_sync()
* Sets the n2h queue size limit synchronously.
*/
-static int nss_n2h_set_queue_limit_sync(struct ctl_table *ctl, int write, void __user *buffer,
+static int nss_n2h_set_queue_limit_sync(compat_const struct ctl_table *ctl, int write, void __user *buffer,
size_t *lenp, loff_t *ppos, uint32_t core_id)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -1512,7 +1512,7 @@ static int nss_n2h_set_queue_limit_sync(
* nss_n2h_queue_limit_core0_handler()
* Sets the n2h queue size limit for core0
*/
-static int nss_n2h_queue_limit_core0_handler(struct ctl_table *ctl,
+static int nss_n2h_queue_limit_core0_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1524,7 +1524,7 @@ static int nss_n2h_queue_limit_core0_han
* nss_n2h_queue_limit_core1_handler()
* Sets the n2h queue size limit for core1
*/
-static int nss_n2h_queue_limit_core1_handler(struct ctl_table *ctl,
+static int nss_n2h_queue_limit_core1_handler(compat_const struct ctl_table *ctl,
int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
{
@@ -1602,7 +1602,7 @@ static nss_tx_status_t nss_n2h_host_bp_c
* nss_n2h_host_bp_cfg_handler()
* Enable n2h back pressure.
*/
-static int nss_n2h_host_bp_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos, uint32_t core_id)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -1640,7 +1640,7 @@ static int nss_n2h_host_bp_cfg_handler(s
* nss_n2h_host_bp_cfg_core0_handler()
* Enable n2h back pressure in core 0.
*/
-static int nss_n2h_host_bp_cfg_core0_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_core0_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_0);
@@ -1650,7 +1650,7 @@ static int nss_n2h_host_bp_cfg_core0_han
* nss_n2h_host_bp_cfg_core1_handler()
* Enable n2h back pressure in core 1.
*/
-static int nss_n2h_host_bp_cfg_core1_handler(struct ctl_table *ctl, int write,
+static int nss_n2h_host_bp_cfg_core1_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
return nss_n2h_host_bp_cfg_handler(ctl, write, buffer, lenp, ppos, NSS_CORE_1);
@@ -1740,9 +1740,7 @@ static struct ctl_table nss_n2h_table_si
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_n2h_get_qos_mem_size_cfg_handler,
- },
-
- { }
+ }
};
static struct ctl_table nss_n2h_table_multi_core[] = {
@@ -1900,8 +1898,7 @@ static struct ctl_table nss_n2h_table_mu
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_n2h_get_qos_mem_size_cfg_handler,
- },
- { }
+ }
};
--- a/nss_ppe_vp.c
+++ b/nss_ppe_vp.c
@@ -215,7 +215,7 @@ static void nss_ppe_vp_callback(void *ap
* Since ath0 has only one type i.e. ath0 is NSS_DYNAMIC_INTERFACE_TYPE_VAP, the above command can be rewritten as
* echo ath0 > /proc/sys/nss/ppe_vp/create => Here 6 can be ignored.
*/
-static nss_if_num_t nss_ppe_vp_parse_vp_cmd(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static nss_if_num_t nss_ppe_vp_parse_vp_cmd(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int32_t if_num;
struct net_device *dev;
@@ -693,7 +693,7 @@ static void nss_ppe_vp_handler(struct ns
* nss_ppe_vp_destroy_handler()
* PPE VP destroy handler.
*/
-static int nss_ppe_vp_destroy_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ppe_vp_destroy_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context();
int32_t if_num;
@@ -730,7 +730,7 @@ static int nss_ppe_vp_destroy_handler(st
* nss_ppe_vp_create_handler()
* PPE VP create handler.
*/
-static int nss_ppe_vp_create_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+static int nss_ppe_vp_create_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
int32_t if_num;
struct nss_ctx_instance *nss_ctx = nss_ppe_vp_get_context();
--- a/nss_pppoe.c
+++ b/nss_pppoe.c
@@ -203,7 +203,7 @@ static void nss_pppoe_handler(struct nss
* nss_pppoe_br_accel_mode_handler()
* Enable/disable pppoe bridge acceleration in NSS
*/
-int nss_pppoe_br_accel_mode_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+int nss_pppoe_br_accel_mode_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context();
struct nss_pppoe_msg npm;
--- a/nss_project.c
+++ b/nss_project.c
@@ -235,7 +235,7 @@ static void nss_project_msg_handler(stru
* Uses proc_dointvec to process data. For a write operation, also sends worker
* thread stats enable messages containing the new value to each NSS core.
*/
-static int nss_project_wt_stats_handler(struct ctl_table *ctl, int write,
+static int nss_project_wt_stats_handler(compat_const struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int ret;
@@ -332,8 +332,7 @@ static struct ctl_table nss_project_tabl
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_project_wt_stats_handler,
- },
- { }
+ }
};
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0))
--- a/nss_rps.c
+++ b/nss_rps.c
@@ -404,7 +404,7 @@ static nss_tx_status_t nss_rps_pri_map_c
* nss_rps_cfg_handler()
* Enable NSS RPS.
*/
-static int nss_rps_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -455,7 +455,7 @@ static int nss_rps_cfg_handler(struct ct
* nss_rps_hash_bitmap_cfg_handler()
* Configure NSS rps_hash_bitmap
*/
-static int nss_rps_hash_bitmap_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_hash_bitmap_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -518,7 +518,7 @@ static int nss_rps_hash_bitmap_cfg_handl
/* nss_rps_pri_map_cfg_handler()
* Configure NSS rps_pri_map
*/
-static int nss_rps_pri_map_cfg_handler(struct ctl_table *ctl, int write,
+static int nss_rps_pri_map_cfg_handler(compat_const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct nss_top_instance *nss_top = &nss_top_main;
@@ -571,8 +571,7 @@ static struct ctl_table nss_rps_table[]
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &nss_rps_pri_map_cfg_handler,
- },
- { }
+ }
};
--- a/nss_core.h
+++ b/nss_core.h
@@ -1036,7 +1036,7 @@ extern void nss_stats_clean(void);
*/
extern void nss_log_init(void);
extern bool nss_debug_log_buffer_alloc(uint8_t nss_id, uint32_t nentry);
-extern int nss_logbuffer_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos);
+extern int nss_logbuffer_handler(compat_const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos);
/*
* APIs to set jumbo_mru & paged_mode
--- a/nss_dscp_map.h
+++ b/nss_dscp_map.h
@@ -46,7 +46,7 @@ struct nss_dscp_map_parse {
* nss_dscp_map_print()
* Sysctl handler for printing dscp/pri mapping.
*/
-static int nss_dscp_map_print(struct ctl_table *ctl, void *buffer, size_t *lenp,
+static int nss_dscp_map_print(compat_const struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_entry *mapping)
{
char *r_buf;
@@ -115,7 +115,7 @@ static int nss_dscp_map_print(struct ctl
* nss_dscp_map_parse()
* Sysctl handler for dscp/pri mappings.
*/
-static int nss_dscp_map_parse(struct ctl_table *ctl, void *buffer, size_t *lenp,
+static int nss_dscp_map_parse(compat_const struct ctl_table *ctl, void *buffer, size_t *lenp,
loff_t *ppos, struct nss_dscp_map_parse *out)
{
int count;
--- a/nss_n2h_stats.c
+++ b/nss_n2h_stats.c
@@ -46,6 +46,7 @@ static ssize_t nss_n2h_stats_read(struct
size_t size_wr = 0;
ssize_t bytes_read = 0;
uint64_t *stats_shadow;
+ char n2h_tag[7];
char *lbuf = kzalloc(size_al, GFP_KERNEL);
if (unlikely(lbuf == NULL)) {
@@ -69,7 +70,8 @@ static ssize_t nss_n2h_stats_read(struct
stats_shadow[i] = nss_n2h_stats[core][i];
}
spin_unlock_bh(&nss_top_main.stats_lock);
- size_wr += nss_stats_banner(lbuf, size_wr, size_al, "n2h", core);
+ snprintf(n2h_tag, 7, "N2H %d", core);
+ size_wr += nss_stats_banner(lbuf, size_wr, size_al, n2h_tag, NSS_STATS_SINGLE_CORE);
size_wr += nss_stats_print("n2h", NULL, NSS_STATS_SINGLE_INSTANCE
, nss_n2h_strings_stats
, stats_shadow

View File

@ -1,6 +1,6 @@
--- a/nss_core.c
+++ b/nss_core.c
@@ -2294,12 +2294,16 @@ static void nss_core_handle_cause_nonque
@@ -2278,12 +2278,16 @@ static void nss_core_handle_cause_nonque
* of processor will prevent any excessive penalties.
*/
if (unlikely(nss_ctx->state == NSS_CORE_STATE_UNINITIALIZED)) {
@ -30,16 +30,6 @@
nss_warning("Failed to create qca-nss-drv/stats/edma/%d/err_stats file", 0);
return;
}
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -2122,6 +2122,7 @@ nss_tx_status_t nss_n2h_flush_payloads(s
nss_tx_status_t nss_tx_status;
nnflshpl = &nnm.msg.flush_payloads;
+ nnflshpl->reserved = 0;
/*
* TODO: No additional information sent in message
--- a/nss_match.c
+++ b/nss_match.c
@@ -244,7 +244,7 @@ EXPORT_SYMBOL(nss_match_unregister_insta
@ -93,20 +83,7 @@
* nss_match_unregister_instance
--- a/nss_lag.c
+++ b/nss_lag.c
@@ -18,11 +18,9 @@
* nss_tx_rx_lag.c
* NSS LAG Tx APIs
*/
-
-#include <linux/if_bonding.h>
-
#include "nss_tx_rx_common.h"
#include "nss_lag_log.h"
+#include <linux/if_bonding.h>
#define NSS_LAG_RESP_TIMEOUT 60000 /* 60 Sec */
@@ -237,7 +235,7 @@ nss_tx_status_t nss_lag_tx_slave_state(u
@@ -237,7 +237,7 @@ nss_tx_status_t nss_lag_tx_slave_state(u
struct nss_lag_pvt lag_msg_state;
init_completion(&lag_msg_state.complete);
@ -115,7 +92,7 @@
/*
* Construct a message to the NSS to update it
@@ -268,6 +266,6 @@ nss_tx_status_t nss_lag_tx_slave_state(u
@@ -268,6 +268,6 @@ nss_tx_status_t nss_lag_tx_slave_state(u
return NSS_TX_FAILURE;
}

View File

@ -0,0 +1,482 @@
--- a/ecm_interface.c
+++ b/ecm_interface.c
@@ -1278,7 +1278,11 @@ static bool ecm_interface_find_route_by_
* it is using to communicate with that IP address.
*/
ECM_IP_ADDR_TO_NIN4_ADDR(be_addr, addr);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
ecm_rt->rt.rtv4 = ip_route_output(&init_net, be_addr, 0, 0, 0);
+#else
+ ecm_rt->rt.rtv4 = ip_route_output(&init_net, be_addr, 0, 0, 0, 0);
+#endif
if (IS_ERR(ecm_rt->rt.rtv4)) {
DEBUG_TRACE("No output route to: %pI4n\n", &be_addr);
return false;
@@ -1469,7 +1473,11 @@ struct neighbour *ecm_interface_ipv4_nei
__be32 ipv4_addr;
ECM_IP_ADDR_TO_NIN4_ADDR(ipv4_addr, addr);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
rt = ip_route_output(&init_net, ipv4_addr, 0, 0, 0);
+#else
+ rt = ip_route_output(&init_net, ipv4_addr, 0, 0, 0, 0);
+#endif
if (IS_ERR(rt)) {
return NULL;
}
@@ -8274,8 +8282,13 @@ int ecm_interface_wifi_event_stop(void)
* ecm_interface_igs_enabled_handler()
* IGS enabled check sysctl node handler.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
static int ecm_interface_igs_enabled_handler(struct ctl_table *ctl, int write, void __user *buffer,
size_t *lenp, loff_t *ppos)
+#else
+static int ecm_interface_igs_enabled_handler(const struct ctl_table *ctl, int write, void __user *buffer,
+ size_t *lenp, loff_t *ppos)
+#endif
{
int ret;
int current_value;
@@ -8315,7 +8328,11 @@ static int ecm_interface_igs_enabled_han
* ecm_interface_src_check_handler()
* Source interface check sysctl node handler.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
static int ecm_interface_src_check_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+#else
+static int ecm_interface_src_check_handler(const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
int ret;
int current_value;
@@ -8369,7 +8386,6 @@ static struct ctl_table ecm_interface_ta
.proc_handler = &ecm_interface_igs_enabled_handler,
},
#endif
- { }
};
#ifdef ECM_INTERFACE_IPSEC_GLUE_LAYER_SUPPORT_ENABLE
--- a/ecm_db/ecm_db_connection.c
+++ b/ecm_db/ecm_db_connection.c
@@ -698,7 +698,7 @@ EXPORT_SYMBOL(ecm_db_connection_node_add
void ecm_db_connection_iface_name_get(struct ecm_db_connection_instance *ci, ecm_db_obj_dir_t dir, char *name_buffer)
{
DEBUG_CHECK_MAGIC(ci, ECM_DB_CONNECTION_INSTANCE_MAGIC, "%px: magic failed", ci);
- strlcpy(name_buffer, ci->node[dir]->iface->name, IFNAMSIZ);
+ strscpy(name_buffer, ci->node[dir]->iface->name, IFNAMSIZ);
}
EXPORT_SYMBOL(ecm_db_connection_iface_name_get);
--- a/ecm_db/ecm_db_iface.c
+++ b/ecm_db/ecm_db_iface.c
@@ -247,7 +247,7 @@ static int ecm_db_iface_state_get_base(s
interface_identifier = ii->interface_identifier;
ae_interface_identifier = ii->ae_interface_identifier;
spin_lock_bh(&ecm_db_lock);
- strlcpy(name, ii->name, IFNAMSIZ);
+ strscpy(name, ii->name, IFNAMSIZ);
mtu = ii->mtu;
spin_unlock_bh(&ecm_db_lock);
@@ -1178,7 +1178,7 @@ void ecm_db_iface_interface_name_get(str
{
DEBUG_CHECK_MAGIC(ii,
ECM_DB_IFACE_INSTANCE_MAGIC, "%px: magic failed", ii);
- strlcpy(name_buffer, ii->name, IFNAMSIZ);
+ strscpy(name_buffer, ii->name, IFNAMSIZ);
}
EXPORT_SYMBOL(ecm_db_iface_interface_name_get);
@@ -2708,7 +2708,7 @@ void ecm_db_iface_add_ethernet(struct ec
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -2760,7 +2760,7 @@ void ecm_db_iface_add_lag(struct ecm_db_
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -2811,7 +2811,7 @@ void ecm_db_iface_add_bridge(struct ecm_
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -2862,7 +2862,7 @@ void ecm_db_iface_add_ovs_bridge(struct
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -2913,7 +2913,7 @@ void ecm_db_iface_add_macvlan(struct ecm
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -2964,7 +2964,7 @@ void ecm_db_iface_add_vlan(struct ecm_db
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3018,7 +3018,7 @@ void ecm_db_iface_add_map_t(struct ecm_d
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3070,7 +3070,7 @@ void ecm_db_iface_add_gre_tun(struct ecm
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3122,7 +3122,7 @@ void ecm_db_iface_add_pppoe(struct ecm_d
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3175,7 +3175,7 @@ void ecm_db_iface_add_pppol2tpv2(struct
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3228,7 +3228,7 @@ void ecm_db_iface_add_pptp(struct ecm_db
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3278,7 +3278,7 @@ void ecm_db_iface_add_unknown(struct ecm
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3327,7 +3327,7 @@ void ecm_db_iface_add_loopback(struct ec
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3386,7 +3386,7 @@ void ecm_db_iface_add_sit(struct ecm_db_
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3436,7 +3436,7 @@ void ecm_db_iface_add_tunipip6(struct ec
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3489,7 +3489,7 @@ void ecm_db_iface_add_ipsec_tunnel(struc
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3541,7 +3541,7 @@ void ecm_db_iface_add_rawip(struct ecm_d
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
@@ -3592,7 +3592,7 @@ void ecm_db_iface_add_ovpn(struct ecm_db
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = type_info->tun_ifnum;
@@ -3643,7 +3643,7 @@ void ecm_db_iface_add_vxlan(struct ecm_d
#endif
ii->arg = arg;
ii->final = final;
- strlcpy(ii->name, name, IFNAMSIZ);
+ strscpy(ii->name, name, IFNAMSIZ);
ii->mtu = mtu;
ii->interface_identifier = interface_identifier;
ii->ae_interface_identifier = ae_interface_identifier;
--- a/frontends/ecm_front_end_common.c
+++ b/frontends/ecm_front_end_common.c
@@ -18,6 +18,7 @@
*/
#include <linux/version.h>
+#include <linux/vmalloc.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/debugfs.h>
@@ -895,7 +896,11 @@ int ecm_front_end_ppe_fse_enable_handler
* ecm_front_end_db_conn_limit_handler()
* Database connection limit sysctl node handler.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
int ecm_front_end_db_conn_limit_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#else
+int ecm_front_end_db_conn_limit_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
int ret;
int current_value;
@@ -1114,7 +1119,11 @@ static int ecm_front_end_denied_ports_ha
* ecm_front_end_udp_denied_ports_handler()
* Proc handler function for UDP denied ports read/write operation.
*/
-static int ecm_front_end_udp_denied_ports_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
+int ecm_front_end_udp_denied_ports_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#else
+int ecm_front_end_udp_denied_ports_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
/*
* Usage:
@@ -1134,7 +1143,11 @@ static int ecm_front_end_udp_denied_port
* ecm_front_end_tcp_denied_ports_handler()
* Proc handler function for TCP denied ports read/write operation.
*/
-static int ecm_front_end_tcp_denied_ports_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
+int ecm_front_end_tcp_denied_ports_handler(struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#else
+int ecm_front_end_tcp_denied_ports_handler(const struct ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
/*
* Usage:
@@ -1181,7 +1194,6 @@ static struct ctl_table ecm_front_end_sy
.mode = 0644,
.proc_handler = &ecm_front_end_tcp_denied_ports_handler,
},
- {}
};
/*
--- a/frontends/sfe/ecm_sfe_common.c
+++ b/frontends/sfe/ecm_sfe_common.c
@@ -308,7 +308,11 @@ void ecm_sfe_common_fast_xmit_set(uint32
* ecm_sfe_fast_xmit_enable_handler()
* Fast transmit sysctl node handler.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
int ecm_sfe_fast_xmit_enable_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+#else
+int ecm_sfe_fast_xmit_enable_handler(const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
int ret;
@@ -332,7 +336,11 @@ int ecm_sfe_fast_xmit_enable_handler(str
* ecm_sfe_fse_enable_handler()
* Sysctl to enable/disable FSE programming through ECM SFE frontend.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0)
int ecm_sfe_fse_enable_handler(struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+#else
+int ecm_sfe_fse_enable_handler(const struct ctl_table *ctl, int write, void __user *buffer, size_t *lenp, loff_t *ppos)
+#endif
{
int ret;
int current_val;
@@ -467,14 +475,13 @@ static struct ctl_table ecm_sfe_sysctl_t
.proc_handler = &ecm_sfe_mht_enable_handler,
},
#endif
- {}
};
/*
* ecm_sfe_sysctl_tbl_init()
* Register sysctl for SFE
*/
-int ecm_sfe_sysctl_tbl_init()
+int ecm_sfe_sysctl_tbl_init(void)
{
ecm_sfe_ctl_tbl_hdr = register_sysctl(ECM_FRONT_END_SYSCTL_PATH, ecm_sfe_sysctl_tbl);
if (!ecm_sfe_ctl_tbl_hdr) {
@@ -489,7 +496,7 @@ int ecm_sfe_sysctl_tbl_init()
* ecm_sfe_sysctl_tbl_exit()
* Unregister sysctl for SFE
*/
-void ecm_sfe_sysctl_tbl_exit()
+void ecm_sfe_sysctl_tbl_exit(void)
{
if (ecm_sfe_ctl_tbl_hdr) {
unregister_sysctl_table(ecm_sfe_ctl_tbl_hdr);
--- a/ecm_classifier_hyfi.c
+++ b/ecm_classifier_hyfi.c
@@ -437,7 +437,7 @@ static void ecm_classifier_hyfi_get_brid
struct net_device *master;
master = ecm_interface_get_and_hold_dev_master(dev);
if (master) {
- strlcpy(name_buffer, master->name, IFNAMSIZ);
+ strscpy(name_buffer, master->name, IFNAMSIZ);
dev_put(master);
dev_put(dev);
break;
@@ -841,13 +841,13 @@ struct ecm_classifier_hyfi_instance *ecm
/* one of the bridge name is null, typical
* routed connection. Consider valid bridge*/
if (strlen(to_bridge)) {
- strlcpy(chfi->bridge_name, to_bridge, IFNAMSIZ);
+ strscpy(chfi->bridge_name, to_bridge, IFNAMSIZ);
} else if (strlen(from_bridge)) {
- strlcpy(chfi->bridge_name, from_bridge, IFNAMSIZ);
+ strscpy(chfi->bridge_name, from_bridge, IFNAMSIZ);
}
} else if (!strncmp(to_bridge, from_bridge, IFNAMSIZ)) {
/* Pure bridge connection. Consider any one bridge */
- strlcpy(chfi->bridge_name, to_bridge, IFNAMSIZ);
+ strscpy(chfi->bridge_name, to_bridge, IFNAMSIZ);
} else {
/* multi-bridge connection */
chfi->multi_bridge_flow = true;
--- a/examples/ecm_pcc_test.c
+++ b/examples/ecm_pcc_test.c
@@ -716,9 +716,9 @@ static unsigned int ecm_pcc_test_update_
o_feature_flags = rule->feature_flags;
rule->accel = accel;
rule->feature_flags = feature_flags;
- strlcpy(rule->name, name, sizeof(rule->name));
- strlcpy(rule->mirror_info.tuple_mirror_dev, tuple_mirror_dev, IFNAMSIZ);
- strlcpy(rule->mirror_info.tuple_ret_mirror_dev, tuple_ret_mirror_dev, IFNAMSIZ);
+ strscpy(rule->name, name, sizeof(rule->name));
+ strscpy(rule->mirror_info.tuple_mirror_dev, tuple_mirror_dev, IFNAMSIZ);
+ strscpy(rule->mirror_info.tuple_ret_mirror_dev, tuple_ret_mirror_dev, IFNAMSIZ);
rule->ap_info.flow_ap_index = flow_ap_index;
rule->ap_info.return_ap_index = return_ap_index;
spin_unlock_bh(&ecm_pcc_test_rules_lock);
@@ -881,7 +881,7 @@ static unsigned int ecm_pcc_test_add_rul
if (!new_rule)
return 0;
- strlcpy(new_rule->name, name, sizeof(new_rule->name));
+ strscpy(new_rule->name, name, sizeof(new_rule->name));
new_rule->accel = accel;
new_rule->proto = proto;
new_rule->src_port = src_port;
@@ -892,8 +892,8 @@ static unsigned int ecm_pcc_test_add_rul
new_rule->dest_addr = *dest_addr;
new_rule->ipv = ipv;
new_rule->feature_flags = feature_flags;
- strlcpy(new_rule->mirror_info.tuple_mirror_dev, tuple_mirror_dev, IFNAMSIZ);
- strlcpy(new_rule->mirror_info.tuple_ret_mirror_dev, tuple_ret_mirror_dev, IFNAMSIZ);
+ strscpy(new_rule->mirror_info.tuple_mirror_dev, tuple_mirror_dev, IFNAMSIZ);
+ strscpy(new_rule->mirror_info.tuple_ret_mirror_dev, tuple_ret_mirror_dev, IFNAMSIZ);
new_rule->ap_info.flow_ap_index = flow_ap_index;
new_rule->ap_info.return_ap_index = return_ap_index;
INIT_LIST_HEAD(&new_rule->list);
@@ -1024,7 +1024,7 @@ static ssize_t ecm_pcc_test_rule_write(s
/*
* Convert fields
*/
- strlcpy(name, fields[0], sizeof(name));
+ strscpy(name, fields[0], sizeof(name));
name[sizeof(name) - 1] = 0;
if (sscanf(fields[1], "%u", &oper) != 1)
@@ -1072,9 +1072,9 @@ static ssize_t ecm_pcc_test_rule_write(s
return -EINVAL;
}
- strlcpy(tuple_mirror_dev, fields[11], IFNAMSIZ);
+ strscpy(tuple_mirror_dev, fields[11], IFNAMSIZ);
- strlcpy(tuple_ret_mirror_dev, fields[12], IFNAMSIZ);
+ strscpy(tuple_ret_mirror_dev, fields[12], IFNAMSIZ);
if (sscanf(fields[13], "%d", &flow_ap_index) != 1)
goto sscanf_read_error;
--- a/Makefile
+++ b/Makefile
@@ -541,4 +541,10 @@ endif
ccflags-y += -Wall -Werror
+# Kernel 6.12 compat headers
+ccflags-y += -I$(obj)/compat
+
+# GCC 15+ has stricter checks for prototypes and declarations. Silence them
+ccflags-y += -Wno-missing-prototypes -Wno-missing-declarations
+
obj ?= .
--- /dev/null
+++ b/compat/asm/unaligned.h
@@ -0,0 +1,13 @@
+/* Compatibility header for <asm/unaligned.h> moved to <linux/unaligned.h> in kernel 6.10+ */
+#ifndef _ASM_UNALIGNED_H
+#define _ASM_UNALIGNED_H
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,10,0)
+#include <linux/unaligned.h>
+#else
+#include_next <asm/unaligned.h>
+#endif
+
+#endif /* _ASM_UNALIGNED_H */

View File

@ -547,7 +547,7 @@ static int recv_qmi_from_client(PQCQMIMSG pQMI, int clientfd) {
}
else if (le16toh(pQMI->CTLMsg.QMICTLMsgHdr.QMICTLType) == QMICTL_GET_CLIENT_ID_REQ) {
uint8_t QMIType = pQMI->CTLMsg.GetClientIdReq.QMIType;
PQCQMIMSG pRsp = (PQCQMIMSG)malloc(256);
PQCQMIMSG pRsp = (PQCQMIMSG)malloc(1040);
if (pRsp) {
uint8_t ClientId = 0;
@ -581,7 +581,7 @@ static int recv_qmi_from_client(PQCQMIMSG pQMI, int clientfd) {
}
}
else if (le16toh(pQMI->CTLMsg.QMICTLMsgHdr.QMICTLType) == QMICTL_RELEASE_CLIENT_ID_REQ) {
PQCQMIMSG pRsp = (PQCQMIMSG)malloc(256);
PQCQMIMSG pRsp = (PQCQMIMSG)malloc(1040);
release_qrtr_client_id(qrtr_con, pQMI->CTLMsg.ReleaseClientIdReq.QMIType, pQMI->CTLMsg.ReleaseClientIdReq.ClientId);
if (pRsp) {
@ -610,7 +610,7 @@ static int recv_qmi_from_client(PQCQMIMSG pQMI, int clientfd) {
}
}
else if (le16toh(pQMI->CTLMsg.QMICTLMsgHdr.QMICTLType) == QMICTL_GET_VERSION_REQ) {
PQCQMIMSG pRsp = (PQCQMIMSG)malloc(256);
PQCQMIMSG pRsp = (PQCQMIMSG)malloc(1040);
if (pRsp) {
pRsp->QMIHdr.IFType = USB_CTL_MSG_TYPE_QMI;

View File

@ -32,7 +32,9 @@ endef
EXTRA_CFLAGS+= \
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
-Wno-unused-function
-Wno-unused-function \
-Wno-missing-prototypes \
-Wno-missing-declarations
MAKE_OPTS:= \
ARCH="$(LINUX_KARCH)" \

View File

@ -0,0 +1,61 @@
--- a/core/mhi_init.c
+++ b/core/mhi_init.c
@@ -644,7 +644,11 @@ static int mon_text_release(struct inode
static const struct file_operations mon_fops_text_u = {
.owner = THIS_MODULE,
.open = mon_text_open,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0))
.llseek = no_llseek,
+#else
+ .llseek = noop_llseek,
+#endif
.read = mon_text_read_u,
.release = mon_text_release,
};
@@ -2366,7 +2370,11 @@ void mhi_unprepare_after_power_down(stru
}
/* match dev to drv */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
static int mhi_match(struct device *dev, struct device_driver *drv)
+#else
+static int mhi_match(struct device *dev, const struct device_driver *drv)
+#endif
{
struct mhi_device *mhi_dev = to_mhi_device(dev);
struct mhi_driver *mhi_drv = to_mhi_driver(drv);
--- a/devices/mhi_netdev.c
+++ b/devices/mhi_netdev.c
@@ -486,7 +486,7 @@ static int mhi_netdev_ioctl_extended(str
ext_cmd.u.data = 0;
break;
case RMNET_IOCTL_GET_DRIVER_NAME:
- strlcpy(ext_cmd.u.if_name, mhi_netdev->interface_name,
+ strscpy(ext_cmd.u.if_name, mhi_netdev->interface_name,
sizeof(ext_cmd.u.if_name));
break;
case RMNET_IOCTL_SET_SLEEP_STATE:
@@ -560,8 +560,8 @@ static void mhi_netdev_get_drvinfo (stru
{
//struct mhi_netdev *mhi_netdev = ndev_to_mhi(ndev);
- strlcpy (info->driver, "pcie_mhi", sizeof info->driver);
- strlcpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
+ strscpy (info->driver, "pcie_mhi", sizeof info->driver);
+ strscpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
}
static const struct ethtool_ops mhi_netdev_ethtool_ops = {
--- a/devices/mhi_netdev_quectel.c
+++ b/devices/mhi_netdev_quectel.c
@@ -2308,8 +2308,8 @@ static void mhi_netdev_get_drvinfo (stru
{
//struct mhi_netdev *mhi_netdev = ndev_to_mhi(ndev);
- strlcpy (info->driver, "pcie_mhi", sizeof info->driver);
- strlcpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
+ strscpy (info->driver, "pcie_mhi", sizeof info->driver);
+ strscpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
}
static const struct ethtool_ops mhi_netdev_ethtool_ops = {

View File

@ -9,7 +9,7 @@
#define CONFIG_QCA_NSS_DRV
//#define CONFIG_QCA_NSS_PACKET_FILTER
#endif
@@ -846,12 +846,20 @@ static struct rtnl_link_stats64 *_rmnet_
@@ -847,12 +847,20 @@ static struct rtnl_link_stats64 *_rmnet_
stats64 = per_cpu_ptr(dev->stats64, cpu);
do {
@ -30,7 +30,7 @@
stats->rx_packets += u64_stats_read(&rx_packets);
stats->rx_bytes += u64_stats_read(&rx_bytes);
@@ -2588,7 +2585,6 @@ static void qmap_qmi_wwan_disconnect(str
@@ -2644,7 +2652,6 @@ static void qmap_qmi_wwan_disconnect(str
static struct usb_driver qmi_wwan_driver = {
.name = "qmi_wwan_q",
.id_table = products,

View File

@ -0,0 +1,98 @@
--- a/rmnet_nss.c
+++ b/rmnet_nss.c
@@ -259,7 +259,9 @@ static int rmnet_nss_adjust_header(struc
/* subtract to account for skb_push */
skb->len -= bytes;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0))
+ frag->offset += bytes;
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
frag->bv_offset += bytes;
#else
frag->page_offset += bytes;
@@ -277,7 +279,7 @@ static int rmnet_nss_adjust_header(struc
* handle it. Remove the ethernet header and pass it onward to the stack
* if possible.
*/
-void rmnet_nss_receive(struct net_device *dev, struct sk_buff *skb,
+static void rmnet_nss_receive(struct net_device *dev, struct sk_buff *skb,
struct napi_struct *napi)
{
rmnet_nss_inc_stat(RMNET_NSS_EXCEPTIONS);
@@ -331,7 +333,7 @@ drop:
* we add a dummy ethernet header with the approriate protocol field set,
* the pass the packet off to NSS for hardware acceleration.
*/
-int rmnet_nss_tx(struct sk_buff *skb)
+static int rmnet_nss_tx(struct sk_buff *skb)
{
struct ethhdr *eth;
struct rmnet_nss_ctx *ctx;
@@ -402,7 +404,7 @@ fail:
* We need to pull the header off and invoke our ndo_start_xmit function
* to handle transmitting the packet to the network stack.
*/
-void rmnet_nss_xmit(struct net_device *dev, struct sk_buff *skb)
+static void rmnet_nss_xmit(struct net_device *dev, struct sk_buff *skb)
{
int rc;
@@ -432,7 +434,7 @@ void rmnet_nss_xmit(struct net_device *d
}
/* Create and register an NSS context for an rmnet_data device */
-int rmnet_nss_create_vnd(struct net_device *dev)
+static int rmnet_nss_create_vnd(struct net_device *dev)
{
struct rmnet_nss_ctx *ctx;
@@ -454,7 +456,7 @@ int rmnet_nss_create_vnd(struct net_devi
}
/* Unregister and destroy the NSS context for an rmnet_data device */
-int rmnet_nss_free_vnd(struct net_device *dev)
+static int rmnet_nss_free_vnd(struct net_device *dev)
{
struct rmnet_nss_ctx *ctx;
@@ -470,7 +472,7 @@ static struct rmnet_nss_cb rmnet_nss = {
.nss_tx = rmnet_nss_tx,
};
-int __init rmnet_nss_init(void)
+static int __init rmnet_nss_init(void)
{
pr_err("%s(): initializing rmnet_nss\n", __func__);
RCU_INIT_POINTER(rmnet_nss_callbacks, &rmnet_nss);
@@ -478,7 +480,7 @@ int __init rmnet_nss_init(void)
return 0;
}
-void __exit rmnet_nss_exit(void)
+static void __exit rmnet_nss_exit(void)
{
struct hlist_node *tmp;
struct rmnet_nss_ctx *ctx;
--- a/qmi_wwan_q.c
+++ b/qmi_wwan_q.c
@@ -1465,7 +1465,7 @@ typedef struct {
} BRMAC_SETTING;
#endif
-int qma_setting_store(struct device *dev, QMAP_SETTING *qmap_settings, size_t size) {
+static int qma_setting_store(struct device *dev, QMAP_SETTING *qmap_settings, size_t size) {
struct net_device *netdev = to_net_dev(dev);
struct usbnet * usbnetdev = netdev_priv( netdev );
struct qmi_wwan_state *info = (void *)&usbnetdev->data;
@@ -2007,8 +2007,8 @@ static void ql_net_get_drvinfo(struct ne
{
/* Inherit standard device info */
usbnet_get_drvinfo(net, info);
- strlcpy(info->driver, driver_name, sizeof(info->driver));
- strlcpy(info->version, VERSION_NUMBER, sizeof(info->version));
+ strscpy(info->driver, driver_name, sizeof(info->driver));
+ strscpy(info->version, VERSION_NUMBER, sizeof(info->version));
}
static struct ethtool_ops ql_net_ethtool_ops;