mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 16:21:53 +00:00
Update to NSS QSDK 11.4
Uses firmware (NSS.AK.11.4-10-R)
This commit is contained in:
parent
149f29b9c1
commit
0029130ffc
@ -0,0 +1,62 @@
|
||||
From 1569ac3b6bbcae9c3f4898e0d34aec8f88297ee6 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sun, 22 Jan 2023 21:45:23 +0100
|
||||
Subject: [PATCH 1/5] cryptoapi: v2.0: fix SHA1 header include
|
||||
|
||||
SHA1 header has been merged to the generic SHA one,
|
||||
and with that the cryptohash.h was dropped.
|
||||
|
||||
So, fix include in kernels 5.8 and newer.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
cryptoapi/v2.0/nss_cryptoapi.c | 5 +++++
|
||||
cryptoapi/v2.0/nss_cryptoapi_aead.c | 5 +++++
|
||||
cryptoapi/v2.0/nss_cryptoapi_ahash.c | 5 +++++
|
||||
3 files changed, 15 insertions(+)
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
@@ -39,7 +39,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/md5.h>
|
||||
#include <crypto/ghash.h>
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
@@ -39,7 +39,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_ahash.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_ahash.c
|
||||
@@ -38,7 +38,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@ -0,0 +1,116 @@
|
||||
From 26cca5006bddb0da57398452616e07ee7b11edb1 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sun, 22 Jan 2023 22:01:34 +0100
|
||||
Subject: [PATCH 2/5] cryptoapi: v2.0: make ablkcipher optional
|
||||
|
||||
albkcipher has been removed from the kernel in v5.5, so until it has been
|
||||
converted to skcipher, lets make it optional to at least have hashes
|
||||
working.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
cryptoapi/v2.0/Makefile | 3 +++
|
||||
cryptoapi/v2.0/nss_cryptoapi.c | 10 ++++++++++
|
||||
cryptoapi/v2.0/nss_cryptoapi_private.h | 2 ++
|
||||
3 files changed, 15 insertions(+)
|
||||
|
||||
--- a/cryptoapi/v2.0/Makefile
|
||||
+++ b/cryptoapi/v2.0/Makefile
|
||||
@@ -5,7 +5,10 @@ NSS_CRYPTOAPI_MOD_NAME=qca-nss-cfi-crypt
|
||||
obj-m += $(NSS_CRYPTOAPI_MOD_NAME).o
|
||||
$(NSS_CRYPTOAPI_MOD_NAME)-objs = nss_cryptoapi.o
|
||||
$(NSS_CRYPTOAPI_MOD_NAME)-objs += nss_cryptoapi_aead.o
|
||||
+ifneq "$(NSS_CRYPTOAPI_ABLK)" "n"
|
||||
$(NSS_CRYPTOAPI_MOD_NAME)-objs += nss_cryptoapi_ablk.o
|
||||
+ccflags-y += -DNSS_CRYPTOAPI_ABLK
|
||||
+endif
|
||||
$(NSS_CRYPTOAPI_MOD_NAME)-objs += nss_cryptoapi_ahash.o
|
||||
|
||||
obj ?= .
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
@@ -1367,6 +1367,7 @@ struct aead_alg cryptoapi_aead_algs[] =
|
||||
/*
|
||||
* ABLK cipher algorithms
|
||||
*/
|
||||
+#if defined(NSS_CRYPTOAPI_ABLK)
|
||||
static struct crypto_alg cryptoapi_ablkcipher_algs[] = {
|
||||
{
|
||||
.cra_name = "cbc(aes)",
|
||||
@@ -1466,6 +1467,7 @@ static struct crypto_alg cryptoapi_ablkc
|
||||
},
|
||||
}
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* AHASH algorithms
|
||||
@@ -2189,7 +2191,9 @@ void nss_cryptoapi_add_ctx2debugfs(struc
|
||||
*/
|
||||
void nss_cryptoapi_attach_user(void *app_data, struct nss_crypto_user *user)
|
||||
{
|
||||
+#if defined(NSS_CRYPTOAPI_ABLK)
|
||||
struct crypto_alg *ablk = cryptoapi_ablkcipher_algs;
|
||||
+#endif
|
||||
struct aead_alg *aead = cryptoapi_aead_algs;
|
||||
struct ahash_alg *ahash = cryptoapi_ahash_algs;
|
||||
struct nss_cryptoapi *sc = app_data;
|
||||
@@ -2212,6 +2216,7 @@ void nss_cryptoapi_attach_user(void *app
|
||||
g_cryptoapi.user = user;
|
||||
}
|
||||
|
||||
+#if defined(NSS_CRYPTOAPI_ABLK)
|
||||
for (i = 0; enable_ablk && (i < ARRAY_SIZE(cryptoapi_ablkcipher_algs)); i++, ablk++) {
|
||||
info = nss_cryptoapi_cra_name_lookup(ablk->cra_name);
|
||||
if(!info || !nss_crypto_algo_is_supp(info->algo))
|
||||
@@ -2222,6 +2227,7 @@ void nss_cryptoapi_attach_user(void *app
|
||||
ablk->cra_flags = 0;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
for (i = 0; enable_aead && (i < ARRAY_SIZE(cryptoapi_aead_algs)); i++, aead++) {
|
||||
info = nss_cryptoapi_cra_name_lookup(aead->base.cra_name);
|
||||
@@ -2257,7 +2263,9 @@ void nss_cryptoapi_attach_user(void *app
|
||||
*/
|
||||
void nss_cryptoapi_detach_user(void *app_data, struct nss_crypto_user *user)
|
||||
{
|
||||
+#if defined(NSS_CRYPTOAPI_ABLK)
|
||||
struct crypto_alg *ablk = cryptoapi_ablkcipher_algs;
|
||||
+#endif
|
||||
struct aead_alg *aead = cryptoapi_aead_algs;
|
||||
struct ahash_alg *ahash = cryptoapi_ahash_algs;
|
||||
struct nss_cryptoapi *sc = app_data;
|
||||
@@ -2270,6 +2278,7 @@ void nss_cryptoapi_detach_user(void *app
|
||||
*/
|
||||
atomic_set(&g_cryptoapi.registered, 0);
|
||||
|
||||
+#if defined(NSS_CRYPTOAPI_ABLK)
|
||||
for (i = 0; enable_ablk && (i < ARRAY_SIZE(cryptoapi_ablkcipher_algs)); i++, ablk++) {
|
||||
if (!ablk->cra_flags)
|
||||
continue;
|
||||
@@ -2277,6 +2286,7 @@ void nss_cryptoapi_detach_user(void *app
|
||||
crypto_unregister_alg(ablk);
|
||||
nss_cfi_info("%px: ABLK unregister succeeded, algo: %s\n", sc, ablk->cra_name);
|
||||
}
|
||||
+#endif
|
||||
|
||||
for (i = 0; enable_aead && (i < ARRAY_SIZE(cryptoapi_aead_algs)); i++, aead++) {
|
||||
if (!aead->base.cra_flags)
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_private.h
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_private.h
|
||||
@@ -250,12 +250,14 @@ extern void nss_cryptoapi_aead_tx_proc(s
|
||||
/*
|
||||
* ABLKCIPHER
|
||||
*/
|
||||
+#if defined(NSS_CRYPTOAPI_ABLK)
|
||||
extern int nss_cryptoapi_ablkcipher_init(struct crypto_tfm *tfm);
|
||||
extern void nss_cryptoapi_ablkcipher_exit(struct crypto_tfm *tfm);
|
||||
extern int nss_cryptoapi_ablk_setkey(struct crypto_ablkcipher *cipher, const u8 *key, unsigned int len);
|
||||
extern int nss_cryptoapi_ablk_encrypt(struct ablkcipher_request *req);
|
||||
extern int nss_cryptoapi_ablk_decrypt(struct ablkcipher_request *req);
|
||||
extern void nss_cryptoapi_copy_iv(struct nss_cryptoapi_ctx *ctx, struct scatterlist *sg, uint8_t *iv, uint8_t iv_len);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* AHASH
|
||||
@ -0,0 +1,237 @@
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_ablk.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_ablk.c
|
||||
@@ -37,7 +37,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -175,7 +180,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
bool ctr_mode = false;
|
||||
bool cbc_mode = false;
|
||||
@@ -277,7 +282,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -290,7 +295,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_ablkcipher_set_flags(cipher, flag);
|
||||
+// crypto_ablkcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -645,7 +650,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key *cip_ptr = &cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -680,7 +685,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -693,7 +698,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_ablkcipher_set_flags(cipher, flag);
|
||||
+// crypto_ablkcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_aead.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -225,7 +230,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
struct nss_crypto_key auth;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
bool ctr_mode = false;
|
||||
bool cbc_mode = false;
|
||||
@@ -346,7 +351,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -363,7 +368,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -378,7 +383,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA1_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -427,7 +432,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -446,7 +451,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -461,7 +466,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA256_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -510,7 +515,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -529,7 +534,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_ahash.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_ahash.c
|
||||
@@ -35,7 +35,12 @@
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/scatterwalk.h>
|
||||
@@ -151,7 +156,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key auth;
|
||||
struct nss_crypto_key cipher = { .algo = NSS_CRYPTO_CIPHER_AES_CBC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
uint32_t algo_keylen;
|
||||
|
||||
@@ -203,7 +208,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -222,7 +227,7 @@ fail:
|
||||
* fails for a context, a new setkey should occur in a different
|
||||
* context while the old one gets freed.
|
||||
*/
|
||||
- crypto_ahash_set_flags(ahash, flag);
|
||||
+// crypto_ahash_set_flags(ahash, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_debugfs.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_debugfs.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@ -0,0 +1,286 @@
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
||||
@@ -36,7 +36,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -65,8 +70,8 @@ struct nss_cryptoapi_ablk_info {
|
||||
int nss_cryptoapi_skcipher_ctx2session(struct crypto_skcipher *sk, uint32_t *sid)
|
||||
{
|
||||
struct crypto_tfm *tfm = crypto_skcipher_tfm(sk);
|
||||
- struct crypto_ablkcipher **actx, *ablk;
|
||||
- struct ablkcipher_tfm *ablk_tfm;
|
||||
+ struct crypto_skcipher **actx;
|
||||
+ struct crypto_tfm *ablk_tfm;
|
||||
struct nss_cryptoapi_ctx *ctx;
|
||||
|
||||
if (strncmp("nss-", crypto_tfm_alg_driver_name(tfm), 4))
|
||||
@@ -82,16 +87,16 @@ int nss_cryptoapi_skcipher_ctx2session(s
|
||||
* ablkcipher that is created when the skcipher is created.
|
||||
* Hence we derive the required ablkcipher through ablkcipher_tfm.
|
||||
*/
|
||||
- ablk_tfm = crypto_ablkcipher_crt(*actx);
|
||||
+ ablk_tfm = crypto_skcipher_tfm(*actx);
|
||||
if (!ablk_tfm)
|
||||
return -EINVAL;
|
||||
|
||||
- ablk = ablk_tfm->base;
|
||||
+ /* ablk = ablk_tfm->base;
|
||||
if (!ablk)
|
||||
- return -EINVAL;
|
||||
+ return -EINVAL; */
|
||||
|
||||
/* Get the nss_cryptoapi context stored in the ablkcipher */
|
||||
- ctx = crypto_ablkcipher_ctx(ablk);
|
||||
+ ctx = crypto_skcipher_ctx(sk);
|
||||
|
||||
nss_cfi_assert(ctx);
|
||||
nss_cryptoapi_verify_magic(ctx);
|
||||
@@ -189,7 +194,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
int ret;
|
||||
|
||||
@@ -278,7 +283,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -289,7 +294,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_skcipher_set_flags(cipher, flag);
|
||||
+// // crypto_skcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -541,7 +546,7 @@ int nss_cryptoapi_ablk_aes_encrypt(struc
|
||||
*/
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, AES_BLOCK_SIZE) && (ctx->cip_alg != NSS_CRYPTO_CIPHER_AES_CTR)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -608,7 +613,6 @@ int nss_cryptoapi_ablk_aes_decrypt(struc
|
||||
*/
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, AES_BLOCK_SIZE) && (ctx->cip_alg != NSS_CRYPTO_CIPHER_AES_CTR)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -645,7 +649,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key *cip_ptr = &cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -680,7 +684,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -693,7 +697,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_skcipher_set_flags(cipher, flag);
|
||||
+// crypto_skcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -729,7 +733,7 @@ int nss_cryptoapi_3des_cbc_encrypt(struc
|
||||
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, DES3_EDE_BLOCK_SIZE)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -790,7 +794,7 @@ int nss_cryptoapi_3des_cbc_decrypt(struc
|
||||
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, DES3_EDE_BLOCK_SIZE)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -216,7 +221,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
struct nss_crypto_key auth;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
bool ctr_mode = false;
|
||||
bool cbc_mode = false;
|
||||
@@ -335,7 +340,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -346,7 +351,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -361,7 +366,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA1_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -410,7 +415,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -424,7 +429,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -439,7 +444,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA256_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -488,7 +493,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -502,7 +507,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -722,7 +727,7 @@ struct nss_crypto_buf *nss_cryptoapi_aea
|
||||
*/
|
||||
if ((info->cip_len & (crypto_aead_blocksize(aead) - 1)) && (ctx->cip_alg != NSS_CRYPTO_CIPHER_AES_CTR)) {
|
||||
nss_cfi_dbg("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi_debugfs.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi_debugfs.c
|
||||
@@ -37,7 +37,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/ocf/v2.0/nss_cfi_ocf.c
|
||||
+++ b/ocf/v2.0/nss_cfi_ocf.c
|
||||
@@ -41,7 +41,12 @@
|
||||
#include <linux/delay.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/md5.h>
|
||||
#include <cryptodev.h>
|
||||
|
||||
@ -0,0 +1,137 @@
|
||||
From 797b5166783cda0886038ffb22f5386b9363a961 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sun, 22 Jan 2023 22:08:27 +0100
|
||||
Subject: [PATCH 3/5] cryptoapi: v2.0: remove setting crypto_ahash_type for
|
||||
newer kernels
|
||||
|
||||
Upstream has stopped exporting crypto_ahash_type and removed setting it
|
||||
on ahash algos since v4.19 as its easily identifiable by the struct type
|
||||
and its being set in the core directly, so lets do the same.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
cryptoapi/v2.0/nss_cryptoapi.c | 24 ++++++++++++++++++++++++
|
||||
1 file changed, 24 insertions(+)
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
@@ -1495,7 +1495,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = MD5_HMAC_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1521,7 +1523,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA1_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1547,7 +1551,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1573,7 +1579,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1599,7 +1607,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1625,7 +1635,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1655,7 +1667,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = MD5_HMAC_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1681,7 +1695,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA1_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1707,7 +1723,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA224_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1733,7 +1751,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA256_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1759,7 +1779,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA384_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@@ -1785,7 +1807,9 @@ static struct ahash_alg cryptoapi_ahash_
|
||||
.cra_blocksize = SHA512_BLOCK_SIZE,
|
||||
.cra_ctxsize = sizeof(struct nss_cryptoapi_ctx),
|
||||
.cra_alignmask = 0,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
.cra_type = &crypto_ahash_type,
|
||||
+#endif
|
||||
.cra_module = THIS_MODULE,
|
||||
.cra_init = nss_cryptoapi_ahash_cra_init,
|
||||
.cra_exit = nss_cryptoapi_ahash_cra_exit,
|
||||
@ -0,0 +1,28 @@
|
||||
From 8db77add1a794bdee8eef0a351e40bf1cdf6dfa9 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sun, 22 Jan 2023 22:09:51 +0100
|
||||
Subject: [PATCH 4/5] cryptoapi: v2.0: aead: add downstream
|
||||
crypto_tfm_alg_flags
|
||||
|
||||
crypto_tfm_alg_flags newer made it upstream, but as a temporary stopgap
|
||||
until a better solution is figured out lets add it.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
cryptoapi/v2.0/nss_cryptoapi_aead.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
@@ -61,6 +61,11 @@
|
||||
#include <nss_cryptoapi.h>
|
||||
#include "nss_cryptoapi_private.h"
|
||||
|
||||
+static inline u32 crypto_tfm_alg_flags(struct crypto_tfm *tfm)
|
||||
+{
|
||||
+ return tfm->__crt_alg->cra_flags & ~CRYPTO_ALG_TYPE_MASK;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* nss_cryptoapi_aead_ctx2session()
|
||||
* Cryptoapi function to get the session ID for an AEAD
|
||||
@ -1,690 +0,0 @@
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_ablk.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_ablk.c
|
||||
@@ -37,7 +37,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -175,7 +180,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
bool ctr_mode = false;
|
||||
bool cbc_mode = false;
|
||||
@@ -277,7 +282,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -290,7 +295,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_ablkcipher_set_flags(cipher, flag);
|
||||
+// crypto_ablkcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -645,7 +650,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key *cip_ptr = &cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -680,7 +685,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -693,7 +698,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_ablkcipher_set_flags(cipher, flag);
|
||||
+// crypto_ablkcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_aead.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -225,7 +230,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
struct nss_crypto_key auth;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
bool ctr_mode = false;
|
||||
bool cbc_mode = false;
|
||||
@@ -346,7 +351,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -363,7 +368,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -378,7 +383,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA1_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -427,7 +432,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -446,7 +451,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -461,7 +466,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA256_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -510,7 +515,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -529,7 +534,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_ahash.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_ahash.c
|
||||
@@ -35,7 +35,12 @@
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/scatterwalk.h>
|
||||
@@ -151,7 +156,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key auth;
|
||||
struct nss_crypto_key cipher = { .algo = NSS_CRYPTO_CIPHER_AES_CBC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
uint32_t algo_keylen;
|
||||
|
||||
@@ -203,7 +208,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -222,7 +227,7 @@ fail:
|
||||
* fails for a context, a new setkey should occur in a different
|
||||
* context while the old one gets freed.
|
||||
*/
|
||||
- crypto_ahash_set_flags(ahash, flag);
|
||||
+// crypto_ahash_set_flags(ahash, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.0/nss_cryptoapi_debugfs.c
|
||||
+++ b/cryptoapi/v1.0/nss_cryptoapi_debugfs.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi_ablk.c
|
||||
@@ -36,7 +36,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -65,8 +70,8 @@ struct nss_cryptoapi_ablk_info {
|
||||
int nss_cryptoapi_skcipher_ctx2session(struct crypto_skcipher *sk, uint32_t *sid)
|
||||
{
|
||||
struct crypto_tfm *tfm = crypto_skcipher_tfm(sk);
|
||||
- struct crypto_ablkcipher **actx, *ablk;
|
||||
- struct ablkcipher_tfm *ablk_tfm;
|
||||
+ struct crypto_skcipher **actx;
|
||||
+ struct crypto_tfm *ablk_tfm;
|
||||
struct nss_cryptoapi_ctx *ctx;
|
||||
|
||||
if (strncmp("nss-", crypto_tfm_alg_driver_name(tfm), 4))
|
||||
@@ -82,16 +87,16 @@ int nss_cryptoapi_skcipher_ctx2session(s
|
||||
* ablkcipher that is created when the skcipher is created.
|
||||
* Hence we derive the required ablkcipher through ablkcipher_tfm.
|
||||
*/
|
||||
- ablk_tfm = crypto_ablkcipher_crt(*actx);
|
||||
+ ablk_tfm = crypto_skcipher_tfm(*actx);
|
||||
if (!ablk_tfm)
|
||||
return -EINVAL;
|
||||
|
||||
- ablk = ablk_tfm->base;
|
||||
+ /* ablk = ablk_tfm->base;
|
||||
if (!ablk)
|
||||
- return -EINVAL;
|
||||
+ return -EINVAL; */
|
||||
|
||||
/* Get the nss_cryptoapi context stored in the ablkcipher */
|
||||
- ctx = crypto_ablkcipher_ctx(ablk);
|
||||
+ ctx = crypto_skcipher_ctx(sk);
|
||||
|
||||
nss_cfi_assert(ctx);
|
||||
nss_cryptoapi_verify_magic(ctx);
|
||||
@@ -189,7 +194,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
struct nss_cryptoapi_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
int ret;
|
||||
|
||||
@@ -278,7 +283,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -289,7 +294,7 @@ int nss_cryptoapi_ablk_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_skcipher_set_flags(cipher, flag);
|
||||
+// // crypto_skcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -541,7 +546,7 @@ int nss_cryptoapi_ablk_aes_encrypt(struc
|
||||
*/
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, AES_BLOCK_SIZE) && (ctx->cip_alg != NSS_CRYPTO_CIPHER_AES_CTR)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -608,7 +613,6 @@ int nss_cryptoapi_ablk_aes_decrypt(struc
|
||||
*/
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, AES_BLOCK_SIZE) && (ctx->cip_alg != NSS_CRYPTO_CIPHER_AES_CTR)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -645,7 +649,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key *cip_ptr = &cip;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -680,7 +684,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -693,7 +697,7 @@ int nss_cryptoapi_3des_cbc_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_skcipher_set_flags(cipher, flag);
|
||||
+// crypto_skcipher_set_flags(cipher, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -729,7 +733,7 @@ int nss_cryptoapi_3des_cbc_encrypt(struc
|
||||
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, DES3_EDE_BLOCK_SIZE)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -790,7 +794,7 @@ int nss_cryptoapi_3des_cbc_decrypt(struc
|
||||
|
||||
if (nss_cryptoapi_check_unalign(req->cryptlen, DES3_EDE_BLOCK_SIZE)) {
|
||||
nss_cfi_err("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_skcipher_set_flags(crypto_skcipher_reqtfm(req), CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi_aead.c
|
||||
@@ -38,7 +38,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -216,7 +221,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip;
|
||||
struct nss_crypto_key auth;
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
bool ctr_mode = false;
|
||||
bool cbc_mode = false;
|
||||
@@ -335,7 +340,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -346,7 +351,7 @@ int nss_cryptoapi_aead_aes_setkey(struct
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -361,7 +366,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA1_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -410,7 +415,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -424,7 +429,7 @@ int nss_cryptoapi_sha1_3des_setkey(struc
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -439,7 +444,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
struct nss_cryptoapi *sc = &gbl_ctx;
|
||||
struct nss_crypto_key cip = { .algo = NSS_CRYPTO_CIPHER_DES };
|
||||
struct nss_crypto_key auth = { .algo = NSS_CRYPTO_AUTH_SHA256_HMAC };
|
||||
- uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
+// uint32_t flag = CRYPTO_TFM_RES_BAD_KEY_LEN;
|
||||
nss_crypto_status_t status;
|
||||
|
||||
/*
|
||||
@@ -488,7 +493,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
if (status != NSS_CRYPTO_STATUS_OK) {
|
||||
nss_cfi_err("nss_crypto_session_alloc failed - status: %d\n", status);
|
||||
ctx->sid = NSS_CRYPTO_MAX_IDXS;
|
||||
- flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
+// flag = CRYPTO_TFM_RES_BAD_FLAGS;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@@ -502,7 +507,7 @@ int nss_cryptoapi_sha256_3des_setkey(str
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
- crypto_aead_set_flags(aead, flag);
|
||||
+// crypto_aead_set_flags(aead, flag);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -722,7 +727,7 @@ struct nss_crypto_buf *nss_cryptoapi_aea
|
||||
*/
|
||||
if ((info->cip_len & (crypto_aead_blocksize(aead) - 1)) && (ctx->cip_alg != NSS_CRYPTO_CIPHER_AES_CTR)) {
|
||||
nss_cfi_dbg("Invalid cipher len - Not aligned to algo blocksize\n");
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
+ // crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_BLOCK_LEN);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v1.1/nss_cryptoapi_debugfs.c
|
||||
+++ b/cryptoapi/v1.1/nss_cryptoapi_debugfs.c
|
||||
@@ -37,7 +37,12 @@
|
||||
#include <crypto/ctr.h>
|
||||
#include <crypto/des.h>
|
||||
#include <crypto/aes.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi.c
|
||||
@@ -39,7 +39,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/md5.h>
|
||||
#include <crypto/ghash.h>
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_ablk.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_ablk.c
|
||||
@@ -37,7 +37,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -190,7 +195,7 @@ int nss_cryptoapi_ablk_setkey(struct cry
|
||||
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keylen, 0);
|
||||
if (!ctx->info) {
|
||||
- crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -221,7 +226,7 @@ int nss_cryptoapi_ablk_setkey(struct cry
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
+// crypto_ablkcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
@@ -39,7 +39,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -197,7 +202,7 @@ int nss_cryptoapi_aead_setkey_noauth(str
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keylen, 0);
|
||||
if (!ctx->info) {
|
||||
nss_cfi_err("%px: Unable to find algorithm with keylen\n", ctx);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -229,7 +234,7 @@ int nss_cryptoapi_aead_setkey_noauth(str
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
+// crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -261,14 +266,14 @@ int nss_cryptoapi_aead_setkey(struct cry
|
||||
*/
|
||||
if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) {
|
||||
nss_cfi_err("%px: Unable to extract keys\n", ctx);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keys.enckeylen, crypto_aead_maxauthsize(aead));
|
||||
if (!ctx->info) {
|
||||
nss_cfi_err("%px: Unable to find algorithm with keylen\n", ctx);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -289,7 +294,7 @@ int nss_cryptoapi_aead_setkey(struct cry
|
||||
*/
|
||||
if (keys.authkeylen > ctx->info->auth_blocksize) {
|
||||
nss_cfi_err("%px: Auth keylen(%d) exceeds supported\n", ctx, keys.authkeylen);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -332,7 +337,7 @@ int nss_cryptoapi_aead_setkey(struct cry
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
+// crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_ahash.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_ahash.c
|
||||
@@ -38,7 +38,12 @@
|
||||
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/aead.h>
|
||||
@@ -187,7 +192,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), 0, crypto_ahash_digestsize(ahash));
|
||||
if (!ctx->info) {
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -210,7 +215,7 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_warn("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
+// crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -294,7 +299,7 @@ int nss_cryptoapi_ahash_init(struct ahas
|
||||
*/
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), 0, 0);
|
||||
if (!ctx->info) {
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
+// crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -309,7 +314,7 @@ int nss_cryptoapi_ahash_init(struct ahas
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
+// crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
--- a/ocf/v2.0/nss_cfi_ocf.c
|
||||
+++ b/ocf/v2.0/nss_cfi_ocf.c
|
||||
@@ -41,7 +41,12 @@
|
||||
#include <linux/delay.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/des.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/md5.h>
|
||||
#include <cryptodev.h>
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
From 62bbb188e1a72d28916e1eca31f4cb9fbbf51cd1 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sun, 22 Jan 2023 22:11:06 +0100
|
||||
Subject: [PATCH 5/5] cryptoapi: v2.0: remove dropped flags
|
||||
|
||||
Upstream has dropped these flags as there was no use for them, so lets do
|
||||
the same.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
cryptoapi/v2.0/nss_cryptoapi_aead.c | 6 ------
|
||||
cryptoapi/v2.0/nss_cryptoapi_ahash.c | 4 ----
|
||||
2 files changed, 10 deletions(-)
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_aead.c
|
||||
@@ -207,7 +207,6 @@ int nss_cryptoapi_aead_setkey_noauth(str
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keylen, 0);
|
||||
if (!ctx->info) {
|
||||
nss_cfi_err("%px: Unable to find algorithm with keylen\n", ctx);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -239,7 +238,6 @@ int nss_cryptoapi_aead_setkey_noauth(str
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -271,14 +269,12 @@ int nss_cryptoapi_aead_setkey(struct cry
|
||||
*/
|
||||
if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) {
|
||||
nss_cfi_err("%px: Unable to extract keys\n", ctx);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), keys.enckeylen, crypto_aead_maxauthsize(aead));
|
||||
if (!ctx->info) {
|
||||
nss_cfi_err("%px: Unable to find algorithm with keylen\n", ctx);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
@@ -299,7 +295,6 @@ int nss_cryptoapi_aead_setkey(struct cry
|
||||
*/
|
||||
if (keys.authkeylen > ctx->info->auth_blocksize) {
|
||||
nss_cfi_err("%px: Auth keylen(%d) exceeds supported\n", ctx, keys.authkeylen);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -342,7 +337,6 @@ int nss_cryptoapi_aead_setkey(struct cry
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
--- a/cryptoapi/v2.0/nss_cryptoapi_ahash.c
|
||||
+++ b/cryptoapi/v2.0/nss_cryptoapi_ahash.c
|
||||
@@ -192,7 +192,6 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), 0, crypto_ahash_digestsize(ahash));
|
||||
if (!ctx->info) {
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -215,7 +214,6 @@ int nss_cryptoapi_ahash_setkey(struct cr
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_warn("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -299,7 +297,6 @@ int nss_cryptoapi_ahash_init(struct ahas
|
||||
*/
|
||||
ctx->info = nss_cryptoapi_cra_name2info(crypto_tfm_alg_name(tfm), 0, 0);
|
||||
if (!ctx->info) {
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_KEY_LEN);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -314,7 +311,6 @@ int nss_cryptoapi_ahash_init(struct ahas
|
||||
status = nss_crypto_session_alloc(ctx->user, &data, &ctx->sid);
|
||||
if (status < 0) {
|
||||
nss_cfi_err("%px: Unable to allocate crypto session(%d)\n", ctx, status);
|
||||
- crypto_ahash_set_flags(ahash, CRYPTO_TFM_RES_BAD_FLAGS);
|
||||
return status;
|
||||
}
|
||||
|
||||
1199
qca-nss-cfi/patches/0006-cryptoapi-v2.0-convert-to-skcipher.patch
Normal file
1199
qca-nss-cfi/patches/0006-cryptoapi-v2.0-convert-to-skcipher.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,18 +6,59 @@ PKG_RELEASE:=2
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-clients.git
|
||||
PKG_SOURCE_DATE:=2020-10-29
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ef082a735fad96bd2f6f59b94d6ea81defc4796e
|
||||
PKG_MIRROR_HASH:=9375f2bbdd17826b6ddebc77607ec73c98626570243a9831a1e34e1051eb436c
|
||||
PKG_BUILD_DEPENDS:=qca-nss-drv
|
||||
PKG_SOURCE_DATE:=2023-10-04
|
||||
PKG_SOURCE_VERSION:=f058ae199b42f30be9925b2ed1ce53afb128200c
|
||||
PKG_MIRROR_HASH:=90401b577a7750d3b7eadb423700aab7e1da1af392637598e08f6007f23a92e1
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:=\
|
||||
CONFIG_NSS_DRV_BRIDGE_ENABLE \
|
||||
CONFIG_NSS_DRV_C2C_ENABLE \
|
||||
CONFIG_NSS_DRV_CAPWAP_ENABLE \
|
||||
CONFIG_NSS_DRV_CLMAP_ENABLE \
|
||||
CONFIG_NSS_DRV_DTLS_ENABLE \
|
||||
CONFIG_NSS_DRV_GRE_ENABLE \
|
||||
CONFIG_NSS_DRV_GRE_REDIR_ENABLE \
|
||||
CONFIG_NSS_DRV_IGS_ENABLE \
|
||||
CONFIG_NSS_DRV_IPSEC_ENABLE \
|
||||
CONFIG_NSS_DRV_IPV4_REASM_ENABLE \
|
||||
CONFIG_NSS_DRV_IPV6_ENABLE \
|
||||
CONFIG_NSS_DRV_IPV6_REASM_ENABLE \
|
||||
CONFIG_NSS_DRV_L2TP_ENABLE \
|
||||
CONFIG_NSS_DRV_LAG_ENABLE \
|
||||
CONFIG_NSS_DRV_LSO_RX_ENABLE \
|
||||
CONFIG_NSS_DRV_MAPT_ENABLE \
|
||||
CONFIG_NSS_DRV_MATCH_ENABLE \
|
||||
CONFIG_NSS_DRV_MIRROR_ENABLE \
|
||||
CONFIG_NSS_DRV_OAM_ENABLE \
|
||||
CONFIG_NSS_DRV_QVPN_ENABLE \
|
||||
CONFIG_NSS_DRV_PPPOE_ENABLE \
|
||||
CONFIG_NSS_DRV_PPTP_ENABLE \
|
||||
CONFIG_NSS_DRV_PVXLAN_ENABLE \
|
||||
CONFIG_NSS_DRV_QRFS_ENABLE \
|
||||
CONFIG_NSS_DRV_RMNET_ENABLE \
|
||||
CONFIG_NSS_DRV_SHAPER_ENABLE \
|
||||
CONFIG_NSS_DRV_TLS_ENABLE \
|
||||
CONFIG_NSS_DRV_TSTAMP_ENABLE \
|
||||
CONFIG_NSS_DRV_TUN6RD_ENABLE \
|
||||
CONFIG_NSS_DRV_TUNIPIP6_ENABLE \
|
||||
CONFIG_NSS_DRV_VLAN_ENABLE \
|
||||
CONFIG_NSS_DRV_VXLAN_ENABLE \
|
||||
CONFIG_NSS_DRV_WIFI_ENABLE \
|
||||
CONFIG_NSS_DRV_WIFI_MESH_ENABLE
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
# Keep default as ipq806x for branches that does not have subtarget framework
|
||||
ifeq ($(CONFIG_TARGET_ipq),y)
|
||||
subtarget:=$(SUBTARGET)
|
||||
ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x")
|
||||
SOC="ipq807x_64"
|
||||
subtarget:=$(CONFIG_TARGET_SUBTARGET)
|
||||
else ifeq ($(CONFIG_TARGET_BOARD), "ipq60xx")
|
||||
SOC="ipq60xx_64"
|
||||
subtarget:=$(SUBTARGET)
|
||||
else
|
||||
subtarget:=$(CONFIG_TARGET_BOARD)
|
||||
SOC=$(CONFIG_TARGET_BOARD)
|
||||
endif
|
||||
|
||||
ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64"))
|
||||
@ -26,23 +67,16 @@ ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64
|
||||
# IPsec Manager v2.0 for Hawkeye/Cypress
|
||||
IPSECMGR_DIR:=v2.0
|
||||
# KLIPS plugin
|
||||
IPSECMGR_KLIPS:= $(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/plugins/klips/qca-nss-ipsec-klips.ko
|
||||
else
|
||||
# DTLS Manager v1.0 for Akronite.
|
||||
DTLSMGR_DIR:=v1.0
|
||||
# IPsec Manager v1.0 for Akronite.
|
||||
IPSECMGR_DIR:=v1.0
|
||||
# KLIPS plugin not needed
|
||||
IPSECMGR_KLIPS:=
|
||||
# IPSECMGR_KLIPS:= $(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/plugins/klips/qca-nss-ipsec-klips.ko
|
||||
endif
|
||||
|
||||
define KernelPackage/qca-nss-drv-tun6rd
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - tun6rd
|
||||
TITLE:=NSS connection manager for 6rd tunnels
|
||||
DEPENDS:=+@NSS_DRV_TUN6RD_ENABLE +kmod-sit +6rd \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/qca-nss-tun6rd.ko
|
||||
AUTOLOAD:=$(call AutoLoad,60,qca-nss-tun6rd)
|
||||
endef
|
||||
@ -55,10 +89,10 @@ define KernelPackage/qca-nss-drv-dtlsmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - dtlsmgr
|
||||
TITLE:=NSS connection manager for DTLS sessions
|
||||
DEPENDS:=+@NSS_DRV_DTLS_ENABLE \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
||||
+PACKAGE_kmod-qca-nss-cfi-cryptoapi:kmod-qca-nss-cfi-cryptoapi
|
||||
+kmod-qca-nss-drv \
|
||||
+kmod-qca-nss-cfi-cryptoapi
|
||||
FILES:=$(PKG_BUILD_DIR)/dtls/$(DTLSMGR_DIR)/qca-nss-dtlsmgr.ko
|
||||
endef
|
||||
|
||||
@ -70,8 +104,11 @@ define KernelPackage/qca-nss-drv-tlsmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - tlsmgr
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64 +kmod-qca-nss-cfi-cryptoapi +@NSS_DRV_TLS_ENABLE
|
||||
TITLE:=NSS connection manager for TLS sessions
|
||||
DEPENDS:=@(TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq807x_64||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx) \
|
||||
+@NSS_DRV_TLS_ENABLE \
|
||||
+kmod-qca-nss-drv \
|
||||
+PACKAGE_kmod-qca-nss-cfi-cryptoapi:kmod-qca-nss-cfi-cryptoapi
|
||||
FILES:=$(PKG_BUILD_DIR)/tls/qca-nss-tlsmgr.ko
|
||||
endef
|
||||
|
||||
@ -83,9 +120,9 @@ define KernelPackage/qca-nss-drv-l2tpv2
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - l2tp
|
||||
TITLE:=NSS connection manager for L2TPv2 protocol
|
||||
DEPENDS:=+@NSS_DRV_L2TP_ENABLE +kmod-ppp +kmod-l2tp \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/l2tp/l2tpv2/qca-nss-l2tpv2.ko
|
||||
KCONFIG:=CONFIG_L2TP=y
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-l2tpv2)
|
||||
@ -99,9 +136,9 @@ define KernelPackage/qca-nss-drv-pptp
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - PPTP
|
||||
TITLE:=NSS connection manager for PPTP protocol
|
||||
DEPENDS:=+@NSS_DRV_PPTP_ENABLE +kmod-pptp \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/pptp/qca-nss-pptp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pptp)
|
||||
endef
|
||||
@ -114,15 +151,15 @@ define KernelPackage/qca-nss-drv-pppoe
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - PPPoE
|
||||
DEPENDS:=+@NSS_DRV_PPPOE_ENABLE +kmod-pppoe \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
TITLE:=NSS connection manager for PPPoE protocol
|
||||
DEPENDS:=+@NSS_DRV_PPPOE_ENABLE +kmod-ppp +kmod-pppoe \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pppoe/description
|
||||
define KernelPackage/qca-nss-drv-pppoe/Description
|
||||
Kernel modules for NSS connection manager - Support for PPPoE
|
||||
endef
|
||||
|
||||
@ -130,9 +167,10 @@ define KernelPackage/qca-nss-drv-map-t
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - MAP-T
|
||||
DEPENDS:=+@NSS_DRV_MAPT_ENABLE +PACKAGE_kmod-qca-nat46:kmod-qca-nat46 \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
TITLE:=NSS connection manager for MAP-T protocol
|
||||
DEPENDS:=+@NSS_DRV_MAPT_ENABLE \
|
||||
+kmod-nat46 \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/map/map-t/qca-nss-map-t.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-map-t)
|
||||
endef
|
||||
@ -145,10 +183,10 @@ define KernelPackage/qca-nss-drv-gre
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - GRE
|
||||
DEPENDS:=@TARGET_ipq_ipq806x||TARGET_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \
|
||||
+@NSS_DRV_GRE_ENABLE +kmod-gre6 \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
TITLE:=NSS connection manager for GRE protocol
|
||||
DEPENDS:=@(TARGET_ipq_ipq806x||TARGET_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq807x_64||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64||TARGET_ipq50xx) \
|
||||
+@NSS_DRV_GRE_ENABLE +kmod-gre6 \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/gre/qca-nss-gre.ko $(PKG_BUILD_DIR)/gre/test/qca-nss-gre-test.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-gre)
|
||||
endef
|
||||
@ -161,10 +199,10 @@ define KernelPackage/qca-nss-drv-tunipip6
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - DS-lite and ipip6 Tunnel
|
||||
TITLE:=NSS connection manager for IPIP6 tunnels
|
||||
DEPENDS:=+@NSS_DRV_TUNIPIP6_ENABLE +kmod-iptunnel6 +kmod-ip6-tunnel \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/qca-nss-tunipip6.ko
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/tunipip6/qca-nss-tunipip6.ko
|
||||
AUTOLOAD:=$(call AutoLoad,60,qca-nss-tunipip6)
|
||||
endef
|
||||
|
||||
@ -177,13 +215,12 @@ define KernelPackage/qca-nss-drv-profile
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_PROFILE_ENABLE \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
DEPENDS:=@TARGET_ipq_ipq806x +kmod-qca-nss-drv
|
||||
TITLE:=Profiler for QCA NSS driver (IPQ806x)
|
||||
FILES:=$(PKG_BUILD_DIR)/profiler/qca-nss-profile-drv.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-profile/description
|
||||
define KernelPackage/qca-nss-drv-profile/Description
|
||||
This package contains a NSS driver profiler for QCA chipset
|
||||
endef
|
||||
|
||||
@ -191,35 +228,56 @@ define KernelPackage/qca-nss-drv-ipsecmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (ipsec manager) - ipsecmgr
|
||||
DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x \
|
||||
+@NSS_DRV_TSTAMP_ENABLE \
|
||||
+@NSS_DRV_IPSEC_ENABLE \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
||||
+PACKAGE_kmod-qca-nss-cfi-cryptoapi:kmod-qca-nss-cfi-cryptoapi
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2),)
|
||||
DEPENDS+=+kmod-qca-nss-drv-l2tpv2
|
||||
endif
|
||||
FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/qca-nss-ipsecmgr.ko $(IPSECMGR_KLIPS)
|
||||
TITLE:=NSS connection manager for IPSEC protocol
|
||||
DEPENDS:=@!TARGET_ipq95xx +@NSS_DRV_IPSEC_ENABLE +kmod-qca-nss-drv +kmod-qca-nss-cfi-cryptoapi \
|
||||
+PACKAGE_kmod-qca-nss-drv-l2tpv2:kmod-qca-nss-drv-l2tpv2
|
||||
FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/qca-nss-ipsecmgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,60,qca-nss-ipsecmgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr/description
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr/Description
|
||||
Kernel module for NSS IPsec offload manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-portifmgr
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-klips
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (qca-nss-drv-portifmgr)
|
||||
DEPENDS:=+@NSS_DRV_PORTID_ENABLE +kmod-qca-nss-gmac \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/portifmgr/qca-nss-portifmgr.ko
|
||||
TITLE:=Kernel driver for NSS (ipsec klips)
|
||||
DEPENDS:=@!TARGET_ipq95xx +kmod-qca-nss-drv-ipsecmgr +kmod-qca-nss-cfi-cryptoapi \
|
||||
+PACKAGE_kmod-qca-nss-drv-vxlanmgr:kmod-qca-nss-drv-vxlanmgr
|
||||
FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/plugins/klips/qca-nss-ipsec-klips.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-portifmgr/Description
|
||||
NSS Kernel module for Port interface manager
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-klips/Description
|
||||
NSS Kernel module for IPsec klips offload
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-xfrm
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (ipsec xfrm)
|
||||
DEPENDS:=@!TARGET_ipq95xx +kmod-qca-nss-drv-ipsecmgr \
|
||||
+PACKAGE_kmod-qca-nss-drv-vxlanmgr:kmod-qca-nss-drv-vxlanmgr +kmod-ipsec
|
||||
FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/plugins/xfrm/qca-nss-ipsec-xfrm.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-xfrm/Description
|
||||
NSS Kernel module for IPsec xfrm offload
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-capwapmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@!TARGET_ipq95xx +kmod-qca-nss-drv +kmod-qca-nss-drv-dtlsmgr +@NSS_DRV_TRUSTSEC_ENABLE
|
||||
TITLE:=NSS CAPWAP manager for QCA NSS (IPQ806x)
|
||||
FILES:=$(PKG_BUILD_DIR)/capwapmgr/qca-nss-capwapmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-capwapmgr/Description
|
||||
This package contains a NSS CAPWAP manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-bridge-mgr
|
||||
@ -227,16 +285,17 @@ define KernelPackage/qca-nss-drv-bridge-mgr
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS bridge manager
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx \
|
||||
+TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq807x_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
||||
+@NSS_DRV_BRIDGE_ENABLE
|
||||
DEPENDS:=@(TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx) \
|
||||
+TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq807x_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_qualcommax:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+@NSS_DRV_BRIDGE_ENABLE \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding \
|
||||
+kmod-qca-nss-drv
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
|
||||
DEPENDS+=kmod-qca-ovsmgr
|
||||
endif
|
||||
@ -244,7 +303,7 @@ endif
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-bridge-mgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-bridge-mgr/description
|
||||
define KernelPackage/qca-nss-drv-bridge-mgr/Description
|
||||
Kernel modules for NSS bridge manager
|
||||
endef
|
||||
|
||||
@ -253,15 +312,15 @@ define KernelPackage/qca-nss-drv-vlan-mgr
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS vlan manager
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq806x||TARGET_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
||||
+@NSS_DRV_VLAN_ENABLE \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding
|
||||
DEPENDS:=@(TARGET_ipq_ipq807x||TARGET_ipq_ipq806x||TARGET_ipq807x||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx) \
|
||||
+@NSS_DRV_VLAN_ENABLE \
|
||||
+kmod-qca-nss-drv \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding
|
||||
FILES:=$(PKG_BUILD_DIR)/vlan/qca-nss-vlan.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-vlan)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-vlan-mgr/description
|
||||
define KernelPackage/qca-nss-drv-vlan-mgr/Description
|
||||
Kernel modules for NSS vlan manager
|
||||
endef
|
||||
|
||||
@ -270,14 +329,14 @@ define KernelPackage/qca-nss-drv-qdisc
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Qdisc for configuring shapers in NSS
|
||||
DEPENDS:=+@NSS_DRV_SHAPER_ENABLE +@NSS_DRV_IGS_ENABLE \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
DEPENDS:=+@NSS_DRV_SHAPER_ENABLE +@NSS_DRV_IGS_ENABLE +@NSS_DRV_BRIDGE_ENABLE \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/nss_qdisc/qca-nss-qdisc.ko
|
||||
KCONFIG:=CONFIG_NET_CLS_ACT=y
|
||||
AUTOLOAD:=$(call AutoLoad,58,qca-nss-qdisc)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-qdisc/description
|
||||
define KernelPackage/qca-nss-drv-qdisc/Description
|
||||
Linux qdisc that aids in configuring shapers in the NSS
|
||||
endef
|
||||
|
||||
@ -285,10 +344,10 @@ define KernelPackage/qca-nss-drv-igs
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Action for offloading traffic to an IFB interface to perform ingress shaping.
|
||||
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \
|
||||
+@NSS_DRV_IGS_ENABLE +kmod-sched-core +kmod-ifb +kmod-qca-nss-drv-qdisc \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
TITLE:=NSS connection manager to perform ingress shaping
|
||||
DEPENDS:=@(TARGET_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64||TARGET_ipq50xx) \
|
||||
+@NSS_DRV_IGS_ENABLE +kmod-sched-core +kmod-nf-conntrack +kmod-ifb +kmod-qca-nss-drv-qdisc \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/nss_qdisc/igs/act_nssmirred.ko
|
||||
endef
|
||||
|
||||
@ -300,15 +359,17 @@ define KernelPackage/qca-nss-drv-lag-mgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS LAG manager
|
||||
TITLE:=NSS LAG (link aggregation) manager
|
||||
DEPENDS:=+@NSS_DRV_LAG_ENABLE \
|
||||
+TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq807x_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
+TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq807x_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_qualcommax:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx_64:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+kmod-qca-nss-drv \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding
|
||||
FILES:=$(PKG_BUILD_DIR)/lag/qca-nss-lag-mgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-lag-mgr)
|
||||
endef
|
||||
@ -321,14 +382,22 @@ define KernelPackage/qca-nss-drv-netlink
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64||TARGET_ipq50xx \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
||||
+@NSS_DRV_GRE_REDIR_ENABLE
|
||||
TITLE:=NSS NETLINK Manager for QCA NSS driver
|
||||
DEPENDS:=+@NSS_DRV_C2C_ENABLE +@NSS_DRV_GRE_ENABLE +@NSS_DRV_GRE_REDIR_ENABLE \
|
||||
+@NSS_DRV_IPV4_REASM_ENABLE +@NSS_DRV_IPV6_ENABLE +@NSS_DRV_IPV6_REASM_ENABLE \
|
||||
+@NSS_DRV_RMNET_ENABLE +@NSS_DRV_OAM_ENABLE +@NSS_DRV_QRFS_ENABLE +@NSS_DRV_L2TP_ENABLE +@NSS_DRV_MAPT_ENABLE \
|
||||
+@NSS_DRV_CAPWAP_ENABLE +@NSS_DRV_LSO_RX_ENABLE +@NSS_DRV_UDP_ST_ENABLE +@NSS_DRV_PPTP_ENABLE +@NSS_DRV_WIFI_LEGACY_ENABLE \
|
||||
+@NSS_DRV_PPPOE_ENABLE \
|
||||
+kmod-qca-nss-drv \
|
||||
+kmod-ppp \
|
||||
+kmod-pppoe \
|
||||
+PACKAGE_kmod-qca-nss-drv-ipsecmgr:kmod-qca-nss-drv-ipsecmgr \
|
||||
+PACKAGE_kmod-qca-nss-drv-dtlsmgr:kmod-qca-nss-drv-dtlsmgr \
|
||||
+PACKAGE_kmod-qca-nss-drv-capwapmgr:kmod-qca-nss-drv-capwapmgr
|
||||
TITLE:=NSS NETLINK manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/netlink/qca-nss-netlink.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-netlink/description
|
||||
define KernelPackage/qca-nss-drv-netlink/Description
|
||||
Kernel module for NSS netlink manager
|
||||
endef
|
||||
|
||||
@ -337,8 +406,9 @@ define KernelPackage/qca-nss-drv-ovpn-mgr
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS OpenVPN manager
|
||||
DEPENDS:=+@NSS_DRV_OVPN_ENABLE +kmod-qca-nss-drv +kmod-qca-nss-cfi-cryptoapi +kmod-tun +kmod-ipt-conntrack \
|
||||
@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64
|
||||
DEPENDS:=@(TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx) \
|
||||
+@NSS_DRV_QVPN_ENABLE +kmod-qca-nss-drv +kmod-tun +kmod-ipt-conntrack \
|
||||
+kmod-qca-nss-cfi-cryptoapi
|
||||
FILES:=$(PKG_BUILD_DIR)/openvpn/src/qca-nss-ovpn-mgr.ko
|
||||
endef
|
||||
|
||||
@ -351,8 +421,9 @@ define KernelPackage/qca-nss-drv-ovpn-link
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for interfacing NSS OpenVPN manager with ECM
|
||||
DEPENDS:=+kmod-qca-nss-drv-ovpn-mgr +@PACKAGE_kmod-qca-nss-ecm-premium \
|
||||
@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64
|
||||
DEPENDS:=@(TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_64||TARGET_ipq807x||TARGET_qualcommax||TARGET_ipq_ipq60xx||TARGET_ipq_ipq60xx_64||TARGET_ipq60xx) \
|
||||
+kmod-qca-nss-drv-ovpn-mgr \
|
||||
+@PACKAGE_kmod-qca-nss-ecm
|
||||
FILES:=$(PKG_BUILD_DIR)/openvpn/plugins/qca-nss-ovpn-link.ko
|
||||
endef
|
||||
|
||||
@ -364,21 +435,24 @@ define KernelPackage/qca-nss-drv-pvxlanmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_PVXLAN_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
TITLE:=NSS PVXLAN Manager for QCA NSS driver
|
||||
DEPENDS:=+@NSS_DRV_PVXLAN_ENABLE \
|
||||
+kmod-qca-nss-drv
|
||||
TITLE:=NSS connection manager for PVxLANs
|
||||
FILES:=$(PKG_BUILD_DIR)/pvxlanmgr/qca-nss-pvxlanmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pvxlanmgr/description
|
||||
Kernel module for managing NSS PVxLAN
|
||||
NSS kernel module for managing Paravirtualized Extensible LAN (PVxLAN) connections
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-eogremgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_GRE_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv +kmod-qca-nss-drv-gre
|
||||
TITLE:=NSS EOGRE Manager for QCA NSS driver
|
||||
DEPENDS:=+@NSS_DRV_GRE_ENABLE \
|
||||
+kmod-qca-nss-drv \
|
||||
+kmod-qca-nss-drv-gre
|
||||
TITLE:=NSS EOGRE manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/eogremgr/qca-nss-eogremgr.ko
|
||||
endef
|
||||
|
||||
@ -390,8 +464,10 @@ define KernelPackage/qca-nss-drv-clmapmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_CLMAP_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv +kmod-qca-nss-drv-eogremgr
|
||||
TITLE:=NSS clmap Manager for QCA NSS driver
|
||||
DEPENDS:=+@NSS_DRV_CLMAP_ENABLE \
|
||||
+kmod-qca-nss-drv \
|
||||
+kmod-qca-nss-drv-eogremgr
|
||||
TITLE:=NSS clmap manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/clmapmgr/qca-nss-clmapmgr.ko
|
||||
endef
|
||||
|
||||
@ -399,59 +475,91 @@ define KernelPackage/qca-nss-drv-clmapmgr/description
|
||||
Kernel module for managing NSS clmap
|
||||
endef
|
||||
|
||||
# define KernelPackage/qca-nss-drv-vxlanmgr
|
||||
# SECTION:=kernel
|
||||
# CATEGORY:=Kernel modules
|
||||
# SUBMENU:=Network Devices
|
||||
# DEPENDS:=+@NSS_DRV_VXLAN_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv +kmod-vxlan
|
||||
# TITLE:=NSS VxLAN Manager for QCA NSS driver
|
||||
# FILES:=$(PKG_BUILD_DIR)/vxlanmgr/qca-nss-vxlanmgr.ko
|
||||
# AUTOLOAD:=$(call AutoLoad,51,qca-nss-vxlanmgr)
|
||||
# endef
|
||||
#
|
||||
# define KernelPackage/qca-nss-drv-vxlanmgr/description
|
||||
# Kernel module for managing NSS VxLAN
|
||||
# endef
|
||||
define KernelPackage/qca-nss-drv-vxlanmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_VXLAN_ENABLE +@NSS_DRV_PVXLAN_ENABLE +kmod-vxlan \
|
||||
+kmod-qca-nss-drv
|
||||
TITLE:=NSS VxLAN manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/vxlanmgr/qca-nss-vxlanmgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-vxlanmgr)
|
||||
endef
|
||||
|
||||
# define KernelPackage/qca-nss-drv-match
|
||||
# SECTION:=kernel
|
||||
# CATEGORY:=Kernel modules
|
||||
# SUBMENU:=Network Devices
|
||||
# DEPENDS:=+@NSS_DRV_MATCH_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
# TITLE:=NSS Match for QCA NSS driver
|
||||
# FILES:=$(PKG_BUILD_DIR)/match/qca-nss-match.ko
|
||||
# endef
|
||||
#
|
||||
# define KernelPackage/qca-nss-drv-match/description
|
||||
# Kernel module for managing NSS Match
|
||||
# endef
|
||||
#
|
||||
# define KernelPackage/qca-nss-drv-mirror
|
||||
# SECTION:=kernel
|
||||
# CATEGORY:=Kernel modules
|
||||
# SUBMENU:=Network Devices
|
||||
# TITLE:=Module for mirroring packets from NSS to host.
|
||||
# DEPENDS:=+@NSS_DRV_MIRROR_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
# FILES:=$(PKG_BUILD_DIR)/mirror/qca-nss-mirror.ko
|
||||
# endef
|
||||
#
|
||||
# define KernelPackage/qca-nss-drv-mirror/Description
|
||||
# Kernel module for managing NSS Mirror
|
||||
# endef
|
||||
define KernelPackage/qca-nss-drv-vxlanmgr/description
|
||||
Kernel module for managing NSS VxLAN
|
||||
endef
|
||||
|
||||
# define KernelPackage/qca-nss-drv-wifi-meshmgr
|
||||
# SECTION:=kernel
|
||||
# CATEGORY:=Kernel modules
|
||||
# SUBMENU:=Network Devices
|
||||
# DEPENDS:=+@NSS_DRV_WIFI_ENABLE +PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
# TITLE:=NSS WiFi-Mesh Manager for QCA NSS driver
|
||||
# FILES:=$(PKG_BUILD_DIR)/wifi_meshmgr/qca-nss-wifi-meshmgr.ko
|
||||
# AUTOLOAD:=$(call AutoLoad,51,qca-nss-wifi-meshmgr)
|
||||
# endef
|
||||
define KernelPackage/qca-nss-drv-match
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_MATCH_ENABLE \
|
||||
+kmod-qca-nss-drv
|
||||
TITLE:=NSS Match for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/match/qca-nss-match.ko
|
||||
endef
|
||||
|
||||
# define KernelPackage/qca-nss-drv-wifi-meshmgr/Description
|
||||
# Kernel module for WiFi Mesh manager
|
||||
# endef
|
||||
define KernelPackage/qca-nss-drv-match/description
|
||||
Kernel module for managing NSS Match
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-mirror
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Module for mirroring packets from NSS to host
|
||||
DEPENDS:=+@NSS_DRV_MIRROR_ENABLE \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/mirror/qca-nss-mirror.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-mirror/Description
|
||||
Kernel module for managing NSS Mirror
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-mscs
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Module to interface wlan host driver and ECM MSCS classifier.
|
||||
DEPENDS:=@TARGET_ipq95xx +@NSS_DRV_WIFI_ENABLE \
|
||||
+kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/mscs/qca-nss-mscs.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-mscs/Description
|
||||
Kernel module for Mirrored Stream Classification Signalling(MSCS) NSS client
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-wifi-meshmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+@NSS_DRV_WIFI_MESH_ENABLE \
|
||||
+kmod-qca-nss-drv
|
||||
TITLE:=NSS WiFi-Mesh manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/wifi_meshmgr/qca-nss-wifi-meshmgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-wifi-meshmgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-wifi-meshmgr/Description
|
||||
Kernel module for WiFi Mesh manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-portifmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (qca-nss-drv-portifmgr)
|
||||
DEPENDS:=@TARGET_ipq806x +@NSS_DRV_PORTID_ENABLE +kmod-qca-nss-gmac \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv
|
||||
FILES:=$(PKG_BUILD_DIR)/portifmgr/qca-nss-portifmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-portifmgr/Description
|
||||
NSS Kernel module for Port interface manager
|
||||
endef
|
||||
|
||||
define Build/InstallDev/qca-nss-clients
|
||||
$(INSTALL_DIR) $(1)/usr/include/qca-nss-clients
|
||||
@ -468,7 +576,12 @@ define KernelPackage/qca-nss-drv-ovpn-mgr/install
|
||||
$(INSTALL_BIN) ./files/qca-nss-ovpn.init $(1)/etc/init.d/qca-nss-ovpn
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr/install
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-klips/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-nss-ipsec $(1)/etc/init.d/qca-nss-ipsec
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-xfrm/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-nss-ipsec $(1)/etc/init.d/qca-nss-ipsec
|
||||
endef
|
||||
@ -478,6 +591,11 @@ define KernelPackage/qca-nss-drv-igs/install
|
||||
$(INSTALL_BIN) ./files/qca-nss-mirred.init $(1)/etc/init.d/qca-nss-mirred
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-netlink/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-nss-netlink.init $(1)/etc/init.d/qca-nss-netlink
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+= \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-crypto \
|
||||
@ -490,86 +608,102 @@ EXTRA_CFLAGS+= \
|
||||
|
||||
# Build individual packages if selected
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-portifmgr),)
|
||||
MAKE_OPTS+=portifmgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=portifmgr=y
|
||||
EXTRA_CFLAGS += -DNSS_PORTIFMGR_REF_AP148 -I$(PKG_BUILD_DIR)/portifmgr
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-profile),)
|
||||
MAKE_OPTS+=profile=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=profile=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-capwapmgr),)
|
||||
NSS_CLIENTS_MAKE_OPTS+=capwapmgr=y
|
||||
EXTRA_CFLAGS += -DNSS_CAPWAPMGR_ONE_NETDEV
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tun6rd),)
|
||||
MAKE_OPTS+=tun6rd=m
|
||||
NSS_CLIENTS_MAKE_OPTS+=tun6rd=m
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-dtlsmgr),)
|
||||
MAKE_OPTS+=dtlsmgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=dtlsmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tlsmgr),)
|
||||
MAKE_OPTS+=tlsmgr=y
|
||||
EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports
|
||||
NSS_CLIENTS_MAKE_OPTS+=tlsmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2),)
|
||||
MAKE_OPTS+=l2tpv2=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=l2tpv2=y
|
||||
EXTRA_CFLAGS += -DNSS_L2TPV2_ENABLED
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pptp),)
|
||||
MAKE_OPTS+=pptp=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=pptp=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-map-t),)
|
||||
MAKE_OPTS+=map-t=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=map-t=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6),)
|
||||
MAKE_OPTS+=tunipip6=m
|
||||
NSS_CLIENTS_MAKE_OPTS+=tunipip6=m
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc),)
|
||||
MAKE_OPTS+=qdisc=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=qdisc=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-igs),)
|
||||
MAKE_OPTS+=igs=y
|
||||
EXTRA_CFLAGS+=-DNSS_IGS_DEBUG_LEVEL=4
|
||||
NSS_CLIENTS_MAKE_OPTS+=igs=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr),)
|
||||
EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-ecm
|
||||
MAKE_OPTS+=ipsecmgr=y
|
||||
EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports
|
||||
NSS_CLIENTS_MAKE_OPTS+=ipsecmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr-klips),)
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-ecm
|
||||
NSS_CLIENTS_MAKE_OPTS+=ipsecmgr-klips=m
|
||||
# Enable netdev based binding from L2TP to IPsec if KLIPS is enabled
|
||||
EXTRA_CFLAGS+= -DNSS_L2TP_IPSEC_BIND_BY_NETDEV
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr-xfrm),)
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-ecm
|
||||
NSS_CLIENTS_MAKE_OPTS+=ipsecmgr-xfrm=m
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-bridge-mgr),)
|
||||
MAKE_OPTS+=bridge-mgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=bridge-mgr=y
|
||||
#enable OVS bridge if ovsmgr is enabled
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
|
||||
MAKE_OPTS+= NSS_BRIDGE_MGR_OVS_ENABLE=y
|
||||
NSS_CLIENTS_MAKE_OPTS+= NSS_BRIDGE_MGR_OVS_ENABLE=y
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-ovsmgr
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vlan-mgr),)
|
||||
MAKE_OPTS+=vlan-mgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=vlan-mgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-lag-mgr),)
|
||||
MAKE_OPTS+=lag-mgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=lag-mgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-gre),)
|
||||
EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports
|
||||
MAKE_OPTS+=gre=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=gre=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe),)
|
||||
MAKE_OPTS+=pppoe=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=pppoe=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-netlink),)
|
||||
MAKE_OPTS+=netlink=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=netlink=y
|
||||
|
||||
ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),256)
|
||||
EXTRA_CFLAGS+= -DNSS_NETLINK_UDP_ST_NO_RMNET_SUPPORT
|
||||
@ -578,50 +712,70 @@ EXTRA_CFLAGS+= -DNSS_NETLINK_UDP_ST_NO_RMNET_SUPPORT
|
||||
endif
|
||||
endif
|
||||
|
||||
# ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-mgr),)
|
||||
# MAKE_OPTS+=ovpn-mgr=y
|
||||
# endif
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-mgr),)
|
||||
NSS_CLIENTS_MAKE_OPTS+=ovpn-mgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link),)
|
||||
MAKE_OPTS+=ovpn-link=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=ovpn-link=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pvxlanmgr),)
|
||||
MAKE_OPTS+=pvxlanmgr=y
|
||||
# The memset() call in nss_pvxlanmgr_get_tunnel_stats
|
||||
# triggers a compilation error with GCC 13, most likely
|
||||
# it is a false positive, disable the warning for now.
|
||||
EXTRA_CFLAGS+= -Wno-stringop-overread
|
||||
NSS_CLIENTS_MAKE_OPTS+=pvxlanmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-eogremgr),)
|
||||
MAKE_OPTS+=eogremgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=eogremgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-clmapmgr),)
|
||||
MAKE_OPTS+=clmapmgr=y
|
||||
NSS_CLIENTS_MAKE_OPTS+=clmapmgr=y
|
||||
endif
|
||||
|
||||
# ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr),)
|
||||
# MAKE_OPTS+=vxlanmgr=y
|
||||
# EXTRA_CFLAGS += -DNSS_VXLAN_ENABLED
|
||||
# endif
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr),)
|
||||
NSS_CLIENTS_MAKE_OPTS+=vxlanmgr=y
|
||||
EXTRA_CFLAGS += -DNSS_VXLAN_ENABLED
|
||||
endif
|
||||
|
||||
# ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-match),)
|
||||
# MAKE_OPTS+=match=y
|
||||
# endif
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-match),)
|
||||
NSS_CLIENTS_MAKE_OPTS+=match=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mirror),)
|
||||
NSS_CLIENTS_MAKE_OPTS+=mirror=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mscs),)
|
||||
EXTRA_CFLAGS+= \
|
||||
-I$(STAGING_DIR)/usr/include/qca-wifi \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-ecm
|
||||
NSS_CLIENTS_MAKE_OPTS+=mscs=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-wifi-meshmgr),)
|
||||
NSS_CLIENTS_MAKE_OPTS+=wifi-meshmgr=y
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" $(strip $(MAKE_OPTS)) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
SoC="$(subtarget)" \
|
||||
DTLSMGR_DIR="$(DTLSMGR_DIR)" \
|
||||
IPSECMGR_DIR="$(IPSECMGR_DIR)" \
|
||||
modules
|
||||
+$(MAKE) -C "$(LINUX_DIR)" $(strip $(NSS_CLIENTS_MAKE_OPTS)) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
DTLSMGR_DIR="$(DTLSMGR_DIR)" \
|
||||
IPSECMGR_DIR="$(IPSECMGR_DIR)" \
|
||||
SoC=$(SOC) \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_JOBS) \
|
||||
modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,qca-nss-drv-profile))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-capwapmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-tun6rd))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-dtlsmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-l2tpv2))
|
||||
@ -634,15 +788,20 @@ $(eval $(call KernelPackage,qca-nss-drv-igs))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-portifmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-netlink))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-ipsecmgr))
|
||||
# $(eval $(call KernelPackage,qca-nss-drv-ipsecmgr-klips))
|
||||
# $(eval $(call KernelPackage,qca-nss-drv-ipsecmgr-xfrm))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-bridge-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-vlan-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-lag-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-gre))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-ovpn-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-ovpn-link))
|
||||
# $(eval $(call KernelPackage,qca-nss-drv-ovpn-mgr))
|
||||
# $(eval $(call KernelPackage,qca-nss-drv-ovpn-link))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-pvxlanmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-eogremgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-clmapmgr))
|
||||
# $(eval $(call KernelPackage,qca-nss-drv-vxlanmgr))
|
||||
# $(eval $(call KernelPackage,qca-nss-drv-match))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-vxlanmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-match))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-tlsmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-mirror))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-mscs))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-wifi-meshmgr))
|
||||
|
||||
@ -1,472 +0,0 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -10,14 +10,11 @@ qca-nss-tun6rd-objs := nss_connmgr_tun6r
|
||||
ccflags-y += -DNSS_TUN6RD_DEBUG_LEVEL=0
|
||||
ccflags-y += -Werror
|
||||
|
||||
-KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
|
||||
-
|
||||
obj-$(bridge-mgr)+= bridge/
|
||||
obj-$(capwapmgr)+= capwapmgr/
|
||||
obj-$(dtlsmgr)+= dtls/$(DTLSMGR_DIR)/
|
||||
obj-$(gre)+= gre/
|
||||
obj-$(ipsecmgr)+= ipsecmgr/$(IPSECMGR_DIR)/
|
||||
-obj-$(ipsecmgr-klips)+= ipsecmgr/$(IPSECMGR_DIR)/plugins/klips/
|
||||
obj-$(l2tpv2)+= l2tp/l2tpv2/
|
||||
obj-$(lag-mgr)+= lag/
|
||||
obj-$(map-t)+= map/map-t/
|
||||
--- a/eogremgr/nss_eogremgr.c
|
||||
+++ b/eogremgr/nss_eogremgr.c
|
||||
@@ -19,6 +19,7 @@
|
||||
* NSS EOGRE manager
|
||||
*/
|
||||
|
||||
+#include <linux/of.h>
|
||||
#include <nss_api_if.h>
|
||||
#include <nss_cmn.h>
|
||||
#include "nss_connmgr_gre_public.h"
|
||||
--- a/gre/nss_connmgr_gre_v4.c
|
||||
+++ b/gre/nss_connmgr_gre_v4.c
|
||||
@@ -162,14 +162,6 @@ int nss_connmgr_gre_v4_set_config(struct
|
||||
}
|
||||
}
|
||||
|
||||
- /*
|
||||
- * IP address validate
|
||||
- */
|
||||
- if ((cfg->src_ip == 0) || (cfg->dest_ip == 0)) {
|
||||
- nss_connmgr_gre_warning("Source ip/Destination IP is invalid");
|
||||
- return GRE_ERR_INVALID_IP;
|
||||
- }
|
||||
-
|
||||
memset(t, 0, sizeof(struct ip_tunnel));
|
||||
|
||||
priv->pad_len = (cfg->add_padding) ? GRE_HDR_PAD_LEN : 0;
|
||||
--- a/gre/nss_connmgr_gre_v6.c
|
||||
+++ b/gre/nss_connmgr_gre_v6.c
|
||||
@@ -95,7 +95,8 @@ static int nss_connmgr_gre_v6_get_mac_ad
|
||||
/*
|
||||
* Find src MAC address
|
||||
*/
|
||||
- local_dev = (struct net_device *)ipv6_dev_find(&init_net, &src_addr, 1);
|
||||
+ local_dev = NULL;
|
||||
+ local_dev = (struct net_device *)ipv6_dev_find(&init_net, &src_addr, local_dev);
|
||||
if (!local_dev) {
|
||||
nss_connmgr_gre_warning("Unable to find local dev for %pI6", src_ip);
|
||||
return GRE_ERR_NO_LOCAL_NETDEV;
|
||||
@@ -106,7 +107,6 @@ static int nss_connmgr_gre_v6_get_mac_ad
|
||||
/*
|
||||
* Find dest MAC address
|
||||
*/
|
||||
-
|
||||
rt = nss_connmgr_gre_v6_route_lookup(&init_net, &dst_addr);
|
||||
if (!rt) {
|
||||
nss_connmgr_gre_warning("Unable to find route lookup for %pI6", dest_ip);
|
||||
@@ -140,8 +140,7 @@ static int nss_connmgr_gre_v6_get_mac_ad
|
||||
* Release hold on existing route entry, and find the route entry again
|
||||
*/
|
||||
ip6_rt_put(rt);
|
||||
-
|
||||
- rt = nss_connmgr_gre_v6_route_lookup(&init_net, &dst_addr);
|
||||
+ rt = rt6_lookup(&init_net, &dst_addr, NULL, 0, NULL, 0);
|
||||
if (!rt) {
|
||||
nss_connmgr_gre_warning("Unable to find route lookup for %pI6\n", dest_ip);
|
||||
return GRE_ERR_NEIGH_LOOKUP;
|
||||
--- a/gre/test/nss_connmgr_gre_test.c
|
||||
+++ b/gre/test/nss_connmgr_gre_test.c
|
||||
@@ -229,10 +229,12 @@ static int nss_connmgr_gre_test_open_pro
|
||||
/*
|
||||
* Proc ops
|
||||
*/
|
||||
-static const struct file_operations nss_connmgr_gre_test_proc_ops = {
|
||||
- .open = nss_connmgr_gre_test_open_proc,
|
||||
- .write = nss_connmgr_gre_test_write_proc,
|
||||
- .read = seq_read,
|
||||
+static const struct proc_ops nss_connmgr_gre_test_proc_ops = {
|
||||
+ .proc_open = nss_connmgr_gre_test_open_proc,
|
||||
+ .proc_read = seq_read,
|
||||
+ .proc_lseek = seq_lseek,
|
||||
+ .proc_release = single_release,
|
||||
+ .proc_write = nss_connmgr_gre_test_write_proc,
|
||||
};
|
||||
|
||||
/*
|
||||
--- a/ipsecmgr/v1.0/nss_ipsecmgr.c
|
||||
+++ b/ipsecmgr/v1.0/nss_ipsecmgr.c
|
||||
@@ -377,7 +377,7 @@ free:
|
||||
* nss_ipsecmgr_tunnel_stats()
|
||||
* get tunnel statistics
|
||||
*/
|
||||
-static struct rtnl_link_stats64 *nss_ipsecmgr_tunnel_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+void nss_ipsecmgr_tunnel_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct nss_ipsecmgr_priv *priv = netdev_priv(dev);
|
||||
|
||||
@@ -389,8 +389,6 @@ static struct rtnl_link_stats64 *nss_ips
|
||||
read_lock_bh(&ipsecmgr_ctx->lock);
|
||||
memcpy(stats, &priv->stats, sizeof(struct rtnl_link_stats64));
|
||||
read_unlock_bh(&ipsecmgr_ctx->lock);
|
||||
-
|
||||
- return stats;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -442,7 +440,7 @@ static void nss_ipsecmgr_tunnel_setup(st
|
||||
dev->header_ops = NULL;
|
||||
dev->netdev_ops = &nss_ipsecmgr_tunnel_ops;
|
||||
|
||||
- dev->destructor = nss_ipsecmgr_tunnel_free;
|
||||
+ dev->priv_destructor = nss_ipsecmgr_tunnel_free;
|
||||
|
||||
/*
|
||||
* get the MAC address from the ethernet device
|
||||
--- a/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
|
||||
+++ b/l2tp/l2tpv2/nss_connmgr_l2tpv2.c
|
||||
@@ -244,7 +244,7 @@ static struct nss_connmgr_l2tpv2_session
|
||||
*/
|
||||
data->l2tpv2.session.session_id = session->session_id;
|
||||
data->l2tpv2.session.peer_session_id = session->peer_session_id;
|
||||
- data->l2tpv2.session.offset = session->offset;
|
||||
+ data->l2tpv2.session.offset = 0;
|
||||
data->l2tpv2.session.hdr_len = session->hdr_len;
|
||||
data->l2tpv2.session.reorder_timeout = session->reorder_timeout;
|
||||
data->l2tpv2.session.recv_seq = session->recv_seq;
|
||||
@@ -253,7 +253,7 @@ static struct nss_connmgr_l2tpv2_session
|
||||
nss_connmgr_l2tpv2_info("sess %u, peer=%u nr=%u ns=%u off=%u hdr_len=%u timeout=%x"
|
||||
" recv_seq=%x send_seq=%x\n",
|
||||
session->session_id, session->peer_session_id, session->nr,
|
||||
- session->ns, session->offset, session->hdr_len,
|
||||
+ session->ns, 0, session->hdr_len,
|
||||
session->reorder_timeout, session->recv_seq,
|
||||
session->send_seq);
|
||||
|
||||
--- a/l2tp/l2tpv2/nss_connmgr_l2tpv2.h
|
||||
+++ b/l2tp/l2tpv2/nss_connmgr_l2tpv2.h
|
||||
@@ -30,10 +30,10 @@
|
||||
|
||||
#define L2TP_V_2 2
|
||||
|
||||
-#define tunnel_hold(tunnel) atomic_inc(&tunnel->ref_count)
|
||||
-#define tunnel_put(tunnel) atomic_dec(&tunnel->ref_count)
|
||||
-#define session_hold(session) atomic_inc(&session->ref_count)
|
||||
-#define session_put(session) atomic_dec(&session->ref_count)
|
||||
+#define tunnel_hold(tunnel) refcount_inc(&tunnel->ref_count)
|
||||
+#define tunnel_put(tunnel) refcount_dec(&tunnel->ref_count)
|
||||
+#define session_hold(session) refcount_inc(&session->ref_count)
|
||||
+#define session_put(session) refcount_dec(&session->ref_count)
|
||||
|
||||
/*
|
||||
* ----------------------------------------------------------------------------------
|
||||
--- a/l2tp/l2tpv2/nss_l2tpv2_stats.c
|
||||
+++ b/l2tp/l2tpv2/nss_l2tpv2_stats.c
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
+#include <linux/netdevice.h>
|
||||
#include <linux/ppp_channel.h>
|
||||
#include <nss_api_if.h>
|
||||
#include <nss_dynamic_interface.h>
|
||||
@@ -103,14 +104,14 @@ void nss_l2tpv2_update_dev_stats(struct
|
||||
/*
|
||||
* Update tunnel & session stats
|
||||
*/
|
||||
- tunnel = l2tp_tunnel_find(dev_net(dev), data.l2tpv2.tunnel.tunnel_id);
|
||||
+ tunnel = l2tp_tunnel_get(dev_net(dev), data.l2tpv2.tunnel.tunnel_id);
|
||||
if (!tunnel) {
|
||||
dev_put(dev);
|
||||
return;
|
||||
}
|
||||
tunnel_hold(tunnel);
|
||||
|
||||
- session = l2tp_session_find(dev_net(dev), tunnel, data.l2tpv2.session.session_id);
|
||||
+ session = l2tp_session_get(dev_net(dev), data.l2tpv2.session.session_id);
|
||||
if (!session) {
|
||||
tunnel_put(tunnel);
|
||||
dev_put(dev);
|
||||
--- a/match/nss_match.c
|
||||
+++ b/match/nss_match.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <nss_api_if.h>
|
||||
#include <linux/debugfs.h>
|
||||
+#include <linux/of.h>
|
||||
|
||||
/*
|
||||
* nss_match_verify_config_msg()
|
||||
--- a/match/nss_match_priv.h
|
||||
+++ b/match/nss_match_priv.h
|
||||
@@ -29,19 +29,19 @@
|
||||
/*
|
||||
* Statically compile messages at different levels
|
||||
*/
|
||||
-#if (NSS_match_DEBUG_LEVEL < 2)
|
||||
+#if (NSS_MATCH_DEBUG_LEVEL < 2)
|
||||
#define nss_match_warn(s, ...)
|
||||
#else
|
||||
#define nss_match_warn(s, ...) pr_warn("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
-#if (NSS_match_DEBUG_LEVEL < 3)
|
||||
+#if (NSS_MATCH_DEBUG_LEVEL < 3)
|
||||
#define nss_match_info(s, ...)
|
||||
#else
|
||||
#define nss_match_info(s, ...) pr_notice("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
-#if (NSS_match_DEBUG_LEVEL < 4)
|
||||
+#if (NSS_MATCH_DEBUG_LEVEL < 4)
|
||||
#define nss_match_trace(s, ...)
|
||||
#else
|
||||
#define nss_match_trace(s, ...) pr_info("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
--- a/portifmgr/nss_portifmgr.c
|
||||
+++ b/portifmgr/nss_portifmgr.c
|
||||
@@ -187,16 +187,20 @@ drop:
|
||||
}
|
||||
|
||||
/*
|
||||
- * nss_portifmgr_get_stats()
|
||||
+ * nss_portifmgr_get_stats64()
|
||||
* Netdev get stats function to get port stats
|
||||
*/
|
||||
-static struct rtnl_link_stats64 *nss_portifmgr_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+/*
|
||||
+ * nss_nlgre_redir_cmn_dev_stats64
|
||||
+ * Report packet statistics to linux
|
||||
+ */
|
||||
+static void nss_portifmgr_get_stats64(struct net_device *dev,
|
||||
+ struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct nss_portifmgr_priv *priv = (struct nss_portifmgr_priv *)netdev_priv(dev);
|
||||
BUG_ON(priv == NULL);
|
||||
|
||||
nss_portid_get_stats(priv->if_num, stats);
|
||||
- return stats;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -225,7 +229,7 @@ static const struct net_device_ops nss_p
|
||||
.ndo_start_xmit = nss_portifmgr_start_xmit,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_change_mtu = nss_portifmgr_change_mtu,
|
||||
- .ndo_get_stats64 = nss_portifmgr_get_stats,
|
||||
+ .ndo_get_stats64 = nss_portifmgr_get_stats64,
|
||||
};
|
||||
|
||||
/*
|
||||
--- a/profiler/profile.c
|
||||
+++ b/profiler/profile.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/page-flags.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/version.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/thread_info.h>
|
||||
@@ -937,12 +938,26 @@ static ssize_t debug_if(struct file *fil
|
||||
return count;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
|
||||
+#define HAVE_PROC_OPS
|
||||
+#endif
|
||||
+
|
||||
+#ifdef HAVE_PROC_OPS
|
||||
+static const struct proc_ops profile_fops = {
|
||||
+ .proc_open = profile_open,
|
||||
+ .proc_read = profile_read,
|
||||
+ .proc_lseek = seq_lseek,
|
||||
+ .proc_release = profile_release,
|
||||
+ .proc_write = debug_if,
|
||||
+};
|
||||
+#else
|
||||
static const struct file_operations profile_fops = {
|
||||
.open = profile_open,
|
||||
.read = profile_read,
|
||||
.release = profile_release,
|
||||
.write = debug_if,
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* showing sample status on Linux console
|
||||
@@ -971,6 +986,15 @@ static ssize_t profile_rate_write(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef HAVE_PROC_OPS
|
||||
+static const struct proc_ops profile_rate_fops = {
|
||||
+ .proc_open = profile_rate_open,
|
||||
+ .proc_read = seq_read,
|
||||
+ .proc_lseek = seq_lseek,
|
||||
+ .proc_release = single_release,
|
||||
+ .proc_write = profile_rate_write,
|
||||
+};
|
||||
+#else
|
||||
static const struct file_operations profile_rate_fops = {
|
||||
.open = profile_rate_open,
|
||||
.read = seq_read,
|
||||
@@ -978,6 +1002,7 @@ static const struct file_operations prof
|
||||
.release = single_release,
|
||||
.write = profile_rate_write,
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* hexdump
|
||||
--- a/vlan/Makefile
|
||||
+++ b/vlan/Makefile
|
||||
@@ -8,7 +8,7 @@ ifeq ($(SoC),$(filter $(SoC),ipq807x ipq
|
||||
ccflags-y += -DNSS_VLAN_MGR_PPE_SUPPORT
|
||||
endif
|
||||
|
||||
-ccflags-y += -DNSS_VLAN_MGR_DEBUG_LEVEL=0
|
||||
+ccflags-y += -DNSS_VLAN_MGR_DEBUG_LEVEL=4
|
||||
ccflags-y += -Werror
|
||||
|
||||
ifneq (,$(filter $(CONFIG_BONDING),y m))
|
||||
--- a/vlan/nss_vlan_mgr.c
|
||||
+++ b/vlan/nss_vlan_mgr.c
|
||||
@@ -821,8 +821,10 @@ static struct nss_vlan_pvt *nss_vlan_mgr
|
||||
*/
|
||||
static void nss_vlan_mgr_instance_free(struct nss_vlan_pvt *v)
|
||||
{
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
int32_t i;
|
||||
int ret = 0;
|
||||
+#endif
|
||||
|
||||
spin_lock(&vlan_mgr_ctx.lock);
|
||||
BUG_ON(--v->refs);
|
||||
@@ -980,8 +982,11 @@ static int nss_vlan_mgr_register_event(s
|
||||
int ret;
|
||||
#endif
|
||||
uint32_t vlan_tag;
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
struct net_device *slave;
|
||||
- int32_t port, port_if;
|
||||
+ int32_t port;
|
||||
+#endif
|
||||
+ int32_t port_if;
|
||||
struct vlan_dev_priv *vlan;
|
||||
struct net_device *real_dev;
|
||||
bool is_bond_master = false;
|
||||
@@ -1355,8 +1360,10 @@ return_with_error:
|
||||
int nss_vlan_mgr_join_bridge(struct net_device *dev, uint32_t bridge_vsi)
|
||||
{
|
||||
struct nss_vlan_pvt *v = nss_vlan_mgr_instance_find_and_ref(dev);
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
struct net_device *real_dev;
|
||||
int ret;
|
||||
+#endif
|
||||
|
||||
if (!v)
|
||||
return 0;
|
||||
@@ -1416,8 +1423,10 @@ EXPORT_SYMBOL(nss_vlan_mgr_join_bridge);
|
||||
int nss_vlan_mgr_leave_bridge(struct net_device *dev, uint32_t bridge_vsi)
|
||||
{
|
||||
struct nss_vlan_pvt *v = nss_vlan_mgr_instance_find_and_ref(dev);
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
struct net_device *real_dev;
|
||||
int ret;
|
||||
+#endif
|
||||
|
||||
if (!v)
|
||||
return 0;
|
||||
--- a/bridge/nss_bridge_mgr.c
|
||||
+++ b/bridge/nss_bridge_mgr.c
|
||||
@@ -1067,8 +1067,10 @@ int nss_bridge_mgr_register_br(struct ne
|
||||
*/
|
||||
b_pvt->ifnum = ifnum;
|
||||
b_pvt->mtu = dev->mtu;
|
||||
+#if defined(NSS_BRIDGE_MGR_PPE_SUPPORT)
|
||||
b_pvt->wan_if_num = -1;
|
||||
b_pvt->wan_if_enabled = false;
|
||||
+#endif
|
||||
ether_addr_copy(b_pvt->dev_addr, dev->dev_addr);
|
||||
spin_lock(&br_mgr_ctx.lock);
|
||||
list_add(&b_pvt->list, &br_mgr_ctx.list);
|
||||
@@ -1130,6 +1132,7 @@ static int nss_bridge_mgr_bond_slave_cha
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
+#if defined(NSS_BRIDGE_MGR_PPE_SUPPORT)
|
||||
/*
|
||||
* Add or remove the slave based based on linking event
|
||||
*/
|
||||
@@ -1144,6 +1147,7 @@ static int nss_bridge_mgr_bond_slave_cha
|
||||
cu_info->upper_dev->name, master->name);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
--- a/dtls/v1.0/nss_connmgr_dtls_netdev.c
|
||||
+++ b/dtls/v1.0/nss_connmgr_dtls_netdev.c
|
||||
@@ -160,7 +160,7 @@ static void nss_dtlsmgr_dev_setup(struct
|
||||
dev->ethtool_ops = NULL;
|
||||
dev->header_ops = NULL;
|
||||
dev->netdev_ops = &nss_dtlsmgr_session_ops;
|
||||
- dev->destructor = NULL;
|
||||
+ dev->priv_destructor = NULL;
|
||||
|
||||
memcpy(dev->dev_addr, "\xaa\xbb\xcc\xdd\xee\xff", dev->addr_len);
|
||||
memset(dev->broadcast, 0xff, dev->addr_len);
|
||||
--- a/exports/nss_dtlsmgr.h
|
||||
+++ b/exports/nss_dtlsmgr.h
|
||||
@@ -128,7 +128,7 @@ enum nss_dtlsmgr_metadata_result {
|
||||
* NSS DTLS manager cryptographic structure to represent key and its length.
|
||||
*/
|
||||
struct nss_dtlsmgr_crypto_data {
|
||||
- const uint8_t *data; /**< Pointer to key or nonce. */
|
||||
+ uint8_t *data; /**< Pointer to key or nonce. */
|
||||
uint16_t len; /**< Length of the key. */
|
||||
};
|
||||
|
||||
--- a/clmapmgr/nss_clmapmgr.c
|
||||
+++ b/clmapmgr/nss_clmapmgr.c
|
||||
@@ -87,14 +87,13 @@ fail:
|
||||
* nss_clmapmgr_dev_stats64()
|
||||
* Netdev ops function to retrieve stats.
|
||||
*/
|
||||
-struct rtnl_link_stats64 *nss_clmapmgr_dev_stats64(struct net_device *dev,
|
||||
+void nss_clmapmgr_dev_stats64(struct net_device *dev,
|
||||
struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct nss_clmapmgr_priv_t *priv;
|
||||
|
||||
if (!stats) {
|
||||
nss_clmapmgr_warning("%px: invalid rtnl structure\n", dev);
|
||||
- return stats;
|
||||
}
|
||||
|
||||
dev_hold(dev);
|
||||
@@ -109,7 +108,6 @@ struct rtnl_link_stats64 *nss_clmapmgr_d
|
||||
memcpy(stats, &priv->stats, sizeof(struct rtnl_link_stats64));
|
||||
dev_put(dev);
|
||||
|
||||
- return stats;
|
||||
}
|
||||
|
||||
/*
|
||||
--- a/tls/nss_tlsmgr_tun.c
|
||||
+++ b/tls/nss_tlsmgr_tun.c
|
||||
@@ -102,7 +102,7 @@ static int nss_tlsmgr_tun_open(struct ne
|
||||
* nss_tlsmgr_tun_stats64()
|
||||
* TLS manager tunnel device
|
||||
*/
|
||||
-static struct rtnl_link_stats64 *nss_tlsmgr_tun_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+void nss_tlsmgr_tun_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct nss_tlsmgr_tun *tun = netdev_priv(dev);
|
||||
|
||||
@@ -113,7 +113,6 @@ static struct rtnl_link_stats64 *nss_tls
|
||||
nss_tlsmgr_ctx_stats_copy(&tun->ctx_dec, stats);
|
||||
read_unlock_bh(&tun->lock);
|
||||
|
||||
- return stats;
|
||||
}
|
||||
|
||||
/*
|
||||
153
qca-nss-clients/patches/0001-kernel-5.15-support-qdisc.patch
Normal file
153
qca-nss-clients/patches/0001-kernel-5.15-support-qdisc.patch
Normal file
@ -0,0 +1,153 @@
|
||||
--- a/nss_qdisc/igs/nss_mirred.c
|
||||
+++ b/nss_qdisc/igs/nss_mirred.c
|
||||
@@ -82,20 +82,24 @@ static const struct nla_policy nss_mirre
|
||||
* nss_mirred_init()
|
||||
* Initialize the nss mirred action.
|
||||
*/
|
||||
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
|
||||
static int nss_mirred_init(struct net *net, struct nlattr *nla,
|
||||
- struct nlattr *est, struct tc_action *tc_act, int ovr,
|
||||
- int bind)
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
|
||||
+ struct nlattr *est, struct tc_action *tc_act, int ovr,
|
||||
+ int bind)
|
||||
+{
|
||||
+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
+ struct nlattr *est, struct tc_action **tc_act, int ovr,
|
||||
+ int bind, bool rtnl_held, struct tcf_proto *tp,
|
||||
+ u32 flags, struct netlink_ext_ack *extack)
|
||||
{
|
||||
#else
|
||||
-static int nss_mirred_init(struct net *net, struct nlattr *nla,
|
||||
- struct nlattr *est, struct tc_action **tc_act, int ovr,
|
||||
- int bind, bool rtnl_held, struct tcf_proto *tp,
|
||||
- struct netlink_ext_ack *extack)
|
||||
+ struct nlattr *est, struct tc_action **tc_act,
|
||||
+ struct tcf_proto *tp, u32 flags, struct netlink_ext_ack *extack)
|
||||
{
|
||||
+ bool bind = flags & TCA_ACT_FLAGS_BIND;
|
||||
+#endif
|
||||
struct tc_action_net *tn = net_generic(net, nss_mirred_net_id);
|
||||
u32 index;
|
||||
-#endif
|
||||
struct nlattr *arr[TC_NSS_MIRRED_MAX + 1];
|
||||
struct tc_nss_mirred *parm;
|
||||
struct nss_mirred_tcf *act;
|
||||
@@ -239,8 +243,13 @@ static int nss_mirred_init(struct net *n
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0))
|
||||
ret = tcf_idr_create(tn, index, est, tc_act, &nss_mirred_act_ops,
|
||||
bind, true);
|
||||
+#else
|
||||
+ ret = tcf_idr_create(tn, index, est, tc_act, &nss_mirred_act_ops,
|
||||
+ bind, true, 0);
|
||||
+#endif
|
||||
if (ret) {
|
||||
tcf_idr_cleanup(tn, index);
|
||||
return ret;
|
||||
--- a/nss_qdisc/nss_bf.c
|
||||
+++ b/nss_qdisc/nss_bf.c
|
||||
@@ -74,7 +74,7 @@ static inline struct nss_bf_class_data *
|
||||
*/
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0))
|
||||
static int nss_bf_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
|
||||
- struct nlattr **tca, unsigned long *arg)
|
||||
+ struct nlattr **tca, unsigned long *arg, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct netlink_ext_ack *extack = NULL;
|
||||
#else
|
||||
@@ -290,7 +290,11 @@ static void nss_bf_destroy_class(struct
|
||||
* nss_bf_delete_class()
|
||||
* Detaches a class from operation, but does not destroy it.
|
||||
*/
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
|
||||
+static int nss_bf_delete_class(struct Qdisc *sch, unsigned long arg, struct netlink_ext_ack *extack)
|
||||
+#else
|
||||
static int nss_bf_delete_class(struct Qdisc *sch, unsigned long arg)
|
||||
+#endif
|
||||
{
|
||||
struct nss_bf_sched_data *q = qdisc_priv(sch);
|
||||
struct nss_bf_class_data *cl = (struct nss_bf_class_data *)arg;
|
||||
--- a/nss_qdisc/nss_htb.c
|
||||
+++ b/nss_qdisc/nss_htb.c
|
||||
@@ -282,7 +282,7 @@ static int nss_htb_ppe_change_class(stru
|
||||
*/
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0))
|
||||
static int nss_htb_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
|
||||
- struct nlattr **tca, unsigned long *arg)
|
||||
+ struct nlattr **tca, unsigned long *arg, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct netlink_ext_ack *extack = NULL;
|
||||
#else
|
||||
@@ -516,7 +516,11 @@ static void nss_htb_destroy_class(struct
|
||||
* nss_htb_delete_class()
|
||||
* Detaches a class from operation, but does not destroy it.
|
||||
*/
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
|
||||
+static int nss_htb_delete_class(struct Qdisc *sch, unsigned long arg, struct netlink_ext_ack *extack)
|
||||
+#else
|
||||
static int nss_htb_delete_class(struct Qdisc *sch, unsigned long arg)
|
||||
+#endif
|
||||
{
|
||||
struct nss_htb_sched_data *q = qdisc_priv(sch);
|
||||
struct nss_htb_class_data *cl = (struct nss_htb_class_data *)arg;
|
||||
--- a/nss_qdisc/nss_qdisc.c
|
||||
+++ b/nss_qdisc/nss_qdisc.c
|
||||
@@ -1140,15 +1140,16 @@ unsigned int nss_qdisc_drop(struct Qdisc
|
||||
{
|
||||
struct nss_qdisc *nq = qdisc_priv(sch);
|
||||
unsigned int ret;
|
||||
+ struct sk_buff *to_free = qdisc_peek_head(sch);
|
||||
|
||||
if (!nq->is_virtual) {
|
||||
- ret = __qdisc_queue_drop_head(sch, &sch->q);
|
||||
+ ret = __qdisc_queue_drop_head(sch, &sch->q, &to_free);
|
||||
} else {
|
||||
spin_lock_bh(&nq->bounce_protection_lock);
|
||||
/*
|
||||
* This function is safe to call within locks
|
||||
*/
|
||||
- ret = __qdisc_queue_drop_head(sch, &sch->q);
|
||||
+ ret = __qdisc_queue_drop_head(sch, &sch->q, &to_free);
|
||||
spin_unlock_bh(&nq->bounce_protection_lock);
|
||||
}
|
||||
|
||||
@@ -1209,10 +1210,10 @@ static bool nss_qdisc_iterate_fl(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
|
||||
- status = tc_classify(skb, tcf, &res, false);
|
||||
-#else
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
|
||||
status = tcf_classify(skb, tcf, &res, false);
|
||||
+#else
|
||||
+ status = tcf_classify(skb, NULL, tcf, &res, false);
|
||||
#endif
|
||||
if ((status == TC_ACT_STOLEN) || (status == TC_ACT_QUEUED)) {
|
||||
return 1;
|
||||
--- a/nss_qdisc/nss_wrr.c
|
||||
+++ b/nss_qdisc/nss_wrr.c
|
||||
@@ -229,7 +229,7 @@ static int nss_wrr_ppe_change_class(stru
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0))
|
||||
static int nss_wrr_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
|
||||
- struct nlattr **tca, unsigned long *arg)
|
||||
+ struct nlattr **tca, unsigned long *arg, struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct netlink_ext_ack *extack = NULL;
|
||||
#else
|
||||
@@ -400,7 +400,11 @@ failure:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
|
||||
+static int nss_wrr_delete_class(struct Qdisc *sch, unsigned long arg, struct netlink_ext_ack *extack)
|
||||
+#else
|
||||
static int nss_wrr_delete_class(struct Qdisc *sch, unsigned long arg)
|
||||
+#endif
|
||||
{
|
||||
struct nss_wrr_sched_data *q = qdisc_priv(sch);
|
||||
struct nss_wrr_class_data *cl = (struct nss_wrr_class_data *)arg;
|
||||
File diff suppressed because it is too large
Load Diff
31
qca-nss-clients/patches/0002-kernel-5.4-support-gre.patch
Normal file
31
qca-nss-clients/patches/0002-kernel-5.4-support-gre.patch
Normal file
@ -0,0 +1,31 @@
|
||||
--- a/gre/nss_connmgr_gre_v6.c
|
||||
+++ b/gre/nss_connmgr_gre_v6.c
|
||||
@@ -95,7 +95,8 @@ static int nss_connmgr_gre_v6_get_mac_ad
|
||||
/*
|
||||
* Find src MAC address
|
||||
*/
|
||||
- local_dev = (struct net_device *)ipv6_dev_find(&init_net, &src_addr, 1);
|
||||
+ local_dev = NULL;
|
||||
+ local_dev = (struct net_device *)ipv6_dev_find(&init_net, &src_addr, local_dev);
|
||||
if (!local_dev) {
|
||||
nss_connmgr_gre_warning("Unable to find local dev for %pI6", src_ip);
|
||||
return GRE_ERR_NO_LOCAL_NETDEV;
|
||||
--- a/gre/test/nss_connmgr_gre_test.c
|
||||
+++ b/gre/test/nss_connmgr_gre_test.c
|
||||
@@ -229,10 +229,12 @@ static int nss_connmgr_gre_test_open_pro
|
||||
/*
|
||||
* Proc ops
|
||||
*/
|
||||
-static const struct file_operations nss_connmgr_gre_test_proc_ops = {
|
||||
- .open = nss_connmgr_gre_test_open_proc,
|
||||
- .write = nss_connmgr_gre_test_write_proc,
|
||||
- .read = seq_read,
|
||||
+static const struct proc_ops nss_connmgr_gre_test_proc_ops = {
|
||||
+ .proc_open = nss_connmgr_gre_test_open_proc,
|
||||
+ .proc_read = seq_read,
|
||||
+ .proc_lseek = seq_lseek,
|
||||
+ .proc_release = single_release,
|
||||
+ .proc_write = nss_connmgr_gre_test_write_proc,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1,339 +0,0 @@
|
||||
--- a/netlink/Makefile
|
||||
+++ b/netlink/Makefile
|
||||
@@ -1,5 +1,6 @@
|
||||
+GRE_ENABLED := $(strip $(if $(filter $(gre), y), 1 , 0))
|
||||
CAPWAP_ENABLED := $(strip $(if $(filter $(capwapmgr), y), 1 , 0))
|
||||
-IPSEC_ENABLED := $(strip $(if $(filter $(ipsecmgr), y), 1 , 0))
|
||||
+IPSEC_ENABLED := 0
|
||||
DTLS_ENABLED := $(strip $(if $(filter $(dtlsmgr), y), 1 , 0))
|
||||
|
||||
ccflags-y := -Werror
|
||||
@@ -10,44 +11,39 @@ ccflags-y += -DNSS_CLIENT_BUILD_ID="$(BU
|
||||
|
||||
ccflags-y += -DCONFIG_NSS_NLIPV4=1
|
||||
ccflags-y += -DCONFIG_NSS_NLIPV6=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLOAM=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLGRE_REDIR_FAMILY=1
|
||||
+ccflags-y += -DCONFIG_NSS_NLOAM=0
|
||||
+ccflags-y += -DCONFIG_NSS_NLGRE_REDIR_FAMILY=${GRE_ENABLED}
|
||||
ccflags-y += -DCONFIG_NSS_NLETHRX=1
|
||||
ccflags-y += -DCONFIG_NSS_NLDYNAMIC_INTERFACE=1
|
||||
ccflags-y += -DCONFIG_NSS_NLN2H=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLIPV4_REASM=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLIPV6_REASM=1
|
||||
+ccflags-y += -DCONFIG_NSS_NLIPV4_REASM=0
|
||||
+ccflags-y += -DCONFIG_NSS_NLIPV6_REASM=0
|
||||
ccflags-y += -DCONFIG_NSS_NLWIFILI=1
|
||||
ccflags-y += -DCONFIG_NSS_NLLSO_RX=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLMAP_T=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLPPPOE=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLL2TPV2=1
|
||||
-ccflags-y += -DCONFIG_NSS_NLPPTP=1
|
||||
+ccflags-y += -DCONFIG_NSS_NLMAP_T=0
|
||||
+ccflags-y += -DCONFIG_NSS_NLPPPOE=0
|
||||
+ccflags-y += -DCONFIG_NSS_NLL2TPV2=0
|
||||
+ccflags-y += -DCONFIG_NSS_NLPPTP=0
|
||||
ccflags-y += -DCONFIG_NSS_NLCAPWAP=${CAPWAP_ENABLED}
|
||||
ccflags-y += -DCONFIG_NSS_NLIPSEC=${IPSEC_ENABLED}
|
||||
ccflags-y += -DCONFIG_NSS_NLDTLS=${DTLS_ENABLED}
|
||||
|
||||
qca-nss-netlink-objs := nss_nl.o
|
||||
-qca-nss-netlink-objs += nss_nlgre_redir_family.o
|
||||
-qca-nss-netlink-objs += nss_nlgre_redir_cmd.o
|
||||
-qca-nss-netlink-objs += nss_nlgre_redir_cmn.o
|
||||
-qca-nss-netlink-objs += nss_nlgre_redir.o
|
||||
-qca-nss-netlink-objs += nss_nlgre_redir_lag.o
|
||||
qca-nss-netlink-objs += nss_nlipv4.o
|
||||
qca-nss-netlink-objs += nss_nlipv6.o
|
||||
-qca-nss-netlink-objs += nss_nloam.o
|
||||
+# qca-nss-netlink-objs += nss_nloam.o
|
||||
qca-nss-netlink-objs += nss_nlethrx.o
|
||||
qca-nss-netlink-objs += nss_nldynamic_interface.o
|
||||
qca-nss-netlink-objs += nss_nln2h.o
|
||||
-qca-nss-netlink-objs += nss_nlipv4_reasm.o
|
||||
-qca-nss-netlink-objs += nss_nlipv6_reasm.o
|
||||
+# qca-nss-netlink-objs += nss_nlipv4_reasm.o
|
||||
+# qca-nss-netlink-objs += nss_nlipv6_reasm.o
|
||||
qca-nss-netlink-objs += nss_nlwifili.o
|
||||
qca-nss-netlink-objs += nss_nllso_rx.o
|
||||
-qca-nss-netlink-objs += nss_nlmap_t.o
|
||||
-qca-nss-netlink-objs += nss_nlpppoe.o
|
||||
-qca-nss-netlink-objs += nss_nll2tpv2.o
|
||||
-qca-nss-netlink-objs += nss_nlpptp.o
|
||||
-
|
||||
+# qca-nss-netlink-objs += nss_nlmap_t.o
|
||||
+# qca-nss-netlink-objs += nss_nlpppoe.o
|
||||
+# qca-nss-netlink-objs += nss_nll2tpv2.o
|
||||
+# qca-nss-netlink-objs += nss_nlpptp.o
|
||||
+#
|
||||
ifneq (,$(filter $(capwapmgr), y))
|
||||
qca-nss-netlink-objs += nss_nlcapwap.o
|
||||
endif
|
||||
@@ -56,8 +52,12 @@ ifneq (,$(filter $(dtlsmgr), y))
|
||||
qca-nss-netlink-objs += nss_nldtls.o
|
||||
endif
|
||||
|
||||
-ifneq (,$(filter $(ipsecmgr), y))
|
||||
-qca-nss-netlink-objs += nss_nlipsec.o
|
||||
+ifneq (,$(filter $(gre), y))
|
||||
+qca-nss-netlink-objs += nss_nlgre_redir_family.o
|
||||
+qca-nss-netlink-objs += nss_nlgre_redir_cmd.o
|
||||
+qca-nss-netlink-objs += nss_nlgre_redir_cmn.o
|
||||
+qca-nss-netlink-objs += nss_nlgre_redir.o
|
||||
+qca-nss-netlink-objs += nss_nlgre_redir_lag.o
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
|
||||
--- a/netlink/nss_nl.c
|
||||
+++ b/netlink/nss_nl.c
|
||||
@@ -35,8 +35,6 @@
|
||||
#include "nss_nlcmn_if.h"
|
||||
#include "nss_nldtls.h"
|
||||
#include "nss_nldtls_if.h"
|
||||
-#include "nss_nlgre_redir_if.h"
|
||||
-#include "nss_nlgre_redir_family.h"
|
||||
#include "nss_nlipsec.h"
|
||||
#include "nss_nlipsec_if.h"
|
||||
#include "nss_nlipv4.h"
|
||||
@@ -59,10 +57,6 @@
|
||||
#include "nss_nlc2c_tx_if.h"
|
||||
#include "nss_nlc2c_rx.h"
|
||||
#include "nss_nlc2c_rx_if.h"
|
||||
-#include "nss_nlipv4_reasm.h"
|
||||
-#include "nss_nlipv4_reasm_if.h"
|
||||
-#include "nss_nlipv6_reasm.h"
|
||||
-#include "nss_nlipv6_reasm_if.h"
|
||||
#include "nss_nlwifili.h"
|
||||
#include "nss_nlwifili_if.h"
|
||||
#include "nss_nllso_rx.h"
|
||||
@@ -106,24 +100,6 @@ static struct nss_nl_family family_handl
|
||||
},
|
||||
{
|
||||
/*
|
||||
- * NSS_NLIPSEC
|
||||
- */
|
||||
- .name = NSS_NLIPSEC_FAMILY, /* ipsec */
|
||||
- .entry = NSS_NLIPSEC_INIT, /* init */
|
||||
- .exit = NSS_NLIPSEC_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLIPSEC /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLOAM
|
||||
- */
|
||||
- .name = NSS_NLOAM_FAMILY, /* oam */
|
||||
- .entry = NSS_NLOAM_INIT, /* init */
|
||||
- .exit = NSS_NLOAM_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLOAM /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
* NSS_NLIPV6
|
||||
*/
|
||||
.name = NSS_NLIPV6_FAMILY, /* ipv6 */
|
||||
@@ -133,24 +109,6 @@ static struct nss_nl_family family_handl
|
||||
},
|
||||
{
|
||||
/*
|
||||
- * NSS_NLGRE_REDIR
|
||||
- */
|
||||
- .name = NSS_NLGRE_REDIR_FAMILY, /* gre_redir */
|
||||
- .entry = NSS_NLGRE_REDIR_FAMILY_INIT, /* init */
|
||||
- .exit = NSS_NLGRE_REDIR_FAMILY_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLGRE_REDIR_FAMILY /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLCAPWAP
|
||||
- */
|
||||
- .name = NSS_NLCAPWAP_FAMILY, /* capwap */
|
||||
- .entry = NSS_NLCAPWAP_INIT, /* init */
|
||||
- .exit = NSS_NLCAPWAP_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLCAPWAP /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
* NSS_NLDTLS
|
||||
*/
|
||||
.name = NSS_NLDTLS_FAMILY, /* dtls */
|
||||
@@ -169,15 +127,6 @@ static struct nss_nl_family family_handl
|
||||
},
|
||||
{
|
||||
/*
|
||||
- * NSS_NLEDMA
|
||||
- */
|
||||
- .name = NSS_NLEDMA_FAMILY, /* edma */
|
||||
- .entry = NSS_NLEDMA_INIT, /* init */
|
||||
- .exit = NSS_NLEDMA_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLEDMA /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
* NSS_NLDYNAMIC_INTERFACE
|
||||
*/
|
||||
.name = NSS_NLDYNAMIC_INTERFACE_FAMILY, /* dynamic interface */
|
||||
@@ -196,42 +145,6 @@ static struct nss_nl_family family_handl
|
||||
},
|
||||
{
|
||||
/*
|
||||
- * NSS_NLC2C_TX
|
||||
- */
|
||||
- .name = NSS_NLC2C_TX_FAMILY, /* c2c_tx */
|
||||
- .entry = NSS_NLC2C_TX_INIT, /* init */
|
||||
- .exit = NSS_NLC2C_TX_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLC2C_TX /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLC2C_RX
|
||||
- */
|
||||
- .name = NSS_NLC2C_RX_FAMILY, /* c2c_rx */
|
||||
- .entry = NSS_NLC2C_RX_INIT, /* init */
|
||||
- .exit = NSS_NLC2C_RX_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLC2C_RX /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLIPV4_REASM
|
||||
- */
|
||||
- .name = NSS_NLIPV4_REASM_FAMILY, /* ipv4_reasm */
|
||||
- .entry = NSS_NLIPV4_REASM_INIT, /* init */
|
||||
- .exit = NSS_NLIPV4_REASM_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLIPV4_REASM /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLIPV6_REASM
|
||||
- */
|
||||
- .name = NSS_NLIPV6_REASM_FAMILY, /* ipv6_reasm */
|
||||
- .entry = NSS_NLIPV6_REASM_INIT, /* init */
|
||||
- .exit = NSS_NLIPV6_REASM_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLIPV6_REASM /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
* NSS_NLWIFILI
|
||||
*/
|
||||
.name = NSS_NLWIFILI_FAMILY, /* wifili */
|
||||
@@ -248,42 +161,6 @@ static struct nss_nl_family family_handl
|
||||
.exit = NSS_NLLSO_RX_EXIT, /* exit */
|
||||
.valid = CONFIG_NSS_NLLSO_RX /* 1 or 0 */
|
||||
},
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLMAP_T
|
||||
- */
|
||||
- .name = NSS_NLMAP_T_FAMILY, /* map_t */
|
||||
- .entry = NSS_NLMAP_T_INIT, /* init */
|
||||
- .exit = NSS_NLMAP_T_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLMAP_T /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLPPPOE
|
||||
- */
|
||||
- .name = NSS_NLPPPOE_FAMILY, /* pppoe */
|
||||
- .entry = NSS_NLPPPOE_INIT, /* init */
|
||||
- .exit = NSS_NLPPPOE_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLPPPOE /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLL2TPV2
|
||||
- */
|
||||
- .name = NSS_NLL2TPV2_FAMILY, /* l2tpv2 */
|
||||
- .entry = NSS_NLL2TPV2_INIT, /* init */
|
||||
- .exit = NSS_NLL2TPV2_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLL2TPV2 /* 1 or 0 */
|
||||
- },
|
||||
- {
|
||||
- /*
|
||||
- * NSS_NLPPTP
|
||||
- */
|
||||
- .name = NSS_NLPPTP_FAMILY, /* pptp */
|
||||
- .entry = NSS_NLPPTP_INIT, /* init */
|
||||
- .exit = NSS_NLPPTP_EXIT, /* exit */
|
||||
- .valid = CONFIG_NSS_NLPPTP /* 1 or 0 */
|
||||
- },
|
||||
};
|
||||
|
||||
#define NSS_NL_FAMILY_HANDLER_SZ ARRAY_SIZE(family_handlers)
|
||||
--- a/netlink/nss_nlipv4.c
|
||||
+++ b/netlink/nss_nlipv4.c
|
||||
@@ -336,20 +336,6 @@ static int nss_nlipv4_verify_conn_rule(s
|
||||
tuple->return_ident, tuple->flow_ident);
|
||||
break;
|
||||
|
||||
- case NSS_NL_IFTYPE_TUNNEL_GRE:
|
||||
- /*
|
||||
- * Currently this implementation is only for gre_redir
|
||||
- */
|
||||
- conn->flow_interface_num = nss_nlgre_redir_cmd_get_ifnum(flow_dev, tuple->protocol);
|
||||
- if (conn->flow_interface_num < 0 ) {
|
||||
- nss_nl_error("%px: Failed to get flow interface number (dev:%s, type:%d)\n",
|
||||
- flow_dev, flow_dev->name, flow_iftype);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- conn->flow_mtu = nss_nlgre_redir_cmd_get_mtu(flow_dev, NSS_GRE_REDIR_IP_HDR_TYPE_IPV4, conn->flow_interface_num);
|
||||
- break;
|
||||
-
|
||||
case NSS_NL_IFTYPE_VLAN:
|
||||
conn->flow_interface_num = nss_cmn_get_interface_number_by_dev(vlan_dev_real_dev(flow_dev));
|
||||
if (conn->flow_interface_num < 0 ) {
|
||||
@@ -396,17 +382,6 @@ static int nss_nlipv4_verify_conn_rule(s
|
||||
tuple->return_ident, tuple->flow_ident);
|
||||
break;
|
||||
|
||||
- case NSS_NL_IFTYPE_TUNNEL_GRE:
|
||||
- conn->return_interface_num = nss_nlgre_redir_cmd_get_ifnum(return_dev, tuple->protocol);
|
||||
- if (conn->return_interface_num < 0 ) {
|
||||
- nss_nl_error("%px: Failed to get return interface number (dev:%s, type:%d)\n",
|
||||
- return_dev, return_dev->name, return_iftype);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- conn->return_mtu = nss_nlgre_redir_cmd_get_mtu(return_dev, NSS_GRE_REDIR_IP_HDR_TYPE_IPV4, conn->return_interface_num);
|
||||
- break;
|
||||
-
|
||||
case NSS_NL_IFTYPE_VLAN:
|
||||
conn->return_interface_num = nss_cmn_get_interface_number_by_dev(vlan_dev_real_dev(return_dev));
|
||||
if (conn->return_interface_num < 0 ) {
|
||||
--- a/netlink/nss_nlipv6.c
|
||||
+++ b/netlink/nss_nlipv6.c
|
||||
@@ -353,17 +353,6 @@ static int nss_nlipv6_verify_conn_rule(s
|
||||
tuple->return_ident, tuple->flow_ident);
|
||||
break;
|
||||
|
||||
- case NSS_NL_IFTYPE_TUNNEL_GRE:
|
||||
- conn->flow_interface_num = nss_nlgre_redir_cmd_get_ifnum(flow_dev, tuple->protocol);
|
||||
- if (conn->flow_interface_num < 0 ) {
|
||||
- nss_nl_error("%px: Failed to get flow interface number (dev:%s, type:%d)\n",
|
||||
- flow_dev, flow_dev->name, flow_iftype);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- conn->flow_mtu = nss_nlgre_redir_cmd_get_mtu(flow_dev, NSS_GRE_REDIR_IP_HDR_TYPE_IPV6, conn->flow_interface_num);
|
||||
- break;
|
||||
-
|
||||
case NSS_NL_IFTYPE_VLAN:
|
||||
conn->flow_interface_num = nss_cmn_get_interface_number_by_dev(vlan_dev_real_dev(flow_dev));
|
||||
if (conn->flow_interface_num < 0 ) {
|
||||
@@ -411,17 +400,6 @@ static int nss_nlipv6_verify_conn_rule(s
|
||||
tuple->return_ident, tuple->flow_ident);
|
||||
break;
|
||||
|
||||
- case NSS_NL_IFTYPE_TUNNEL_GRE:
|
||||
- conn->return_interface_num = nss_nlgre_redir_cmd_get_ifnum(return_dev, tuple->protocol);
|
||||
- if (conn->return_interface_num < 0 ) {
|
||||
- nss_nl_error("%px: Failed to get return interface number (dev:%s, type:%d)\n",
|
||||
- return_dev, return_dev->name, return_iftype);
|
||||
- return -EINVAL;
|
||||
- }
|
||||
-
|
||||
- conn->return_mtu = nss_nlgre_redir_cmd_get_mtu(return_dev, NSS_GRE_REDIR_IP_HDR_TYPE_IPV6, conn->return_interface_num);
|
||||
- break;
|
||||
-
|
||||
case NSS_NL_IFTYPE_VLAN:
|
||||
conn->return_interface_num = nss_cmn_get_interface_number_by_dev(vlan_dev_real_dev(return_dev));
|
||||
if (conn->return_interface_num < 0 ) {
|
||||
File diff suppressed because it is too large
Load Diff
29
qca-nss-clients/patches/0003-kernel-5.4-support-ipsec.patch
Normal file
29
qca-nss-clients/patches/0003-kernel-5.4-support-ipsec.patch
Normal file
@ -0,0 +1,29 @@
|
||||
--- a/ipsecmgr/v1.0/nss_ipsecmgr.c
|
||||
+++ b/ipsecmgr/v1.0/nss_ipsecmgr.c
|
||||
@@ -377,7 +377,7 @@ free:
|
||||
* nss_ipsecmgr_tunnel_stats()
|
||||
* get tunnel statistics
|
||||
*/
|
||||
-static struct rtnl_link_stats64 *nss_ipsecmgr_tunnel_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+void nss_ipsecmgr_tunnel_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct nss_ipsecmgr_priv *priv = netdev_priv(dev);
|
||||
|
||||
@@ -389,8 +389,6 @@ static struct rtnl_link_stats64 *nss_ips
|
||||
read_lock_bh(&ipsecmgr_ctx->lock);
|
||||
memcpy(stats, &priv->stats, sizeof(struct rtnl_link_stats64));
|
||||
read_unlock_bh(&ipsecmgr_ctx->lock);
|
||||
-
|
||||
- return stats;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -442,7 +440,7 @@ static void nss_ipsecmgr_tunnel_setup(st
|
||||
dev->header_ops = NULL;
|
||||
dev->netdev_ops = &nss_ipsecmgr_tunnel_ops;
|
||||
|
||||
- dev->destructor = nss_ipsecmgr_tunnel_free;
|
||||
+ dev->priv_destructor = nss_ipsecmgr_tunnel_free;
|
||||
|
||||
/*
|
||||
* get the MAC address from the ethernet device
|
||||
@ -1,909 +0,0 @@
|
||||
--- a/exports/nss_connmgr_tunipip6.h
|
||||
+++ b/exports/nss_connmgr_tunipip6.h
|
||||
@@ -28,12 +28,13 @@ enum nss_connmgr_tunipip6_err_codes {
|
||||
NSS_CONNMGR_TUNIPIP6_TUN_DESTROY_FAILURE, /**< Tunnel destroy failure. */
|
||||
NSS_CONNMGR_TUNIPIP6_TUN_NONE, /**< Invalid tunnel type */
|
||||
NSS_CONNMGR_TUNIPIP6_NETDEV_TYPE_FAILURE, /**< Netdevice is not of type ipv6-in-ipv4. */
|
||||
- NSS_CONNMGR_TUNIPIP6_MAPRULE_ADD_FAILURE, /**< BMR/FMR addition failure. */
|
||||
- NSS_CONNMGR_TUNIPIP6_MAPRULE_DEL_FAILURE, /**< BMR/FMR deletion failure. */
|
||||
- NSS_CONNMGR_TUNIPIP6_FMR_RULE_FLUSH_FAILURE, /**< FMR flush failure. */
|
||||
+ NSS_CONNMGR_TUNIPIP6_MAPRULE_ADD_FAILURE, /**< BMR/FMR addition failure. */
|
||||
+ NSS_CONNMGR_TUNIPIP6_MAPRULE_DEL_FAILURE, /**< BMR/FMR deletion failure. */
|
||||
+ NSS_CONNMGR_TUNIPIP6_FMR_RULE_FLUSH_FAILURE, /**< FMR flush failure. */
|
||||
NSS_CONNMGR_TUNIPIP6_NO_DEV, /**< No NSS node found. */
|
||||
NSS_CONNMGR_TUNIPIP6_INVALID_PARAM, /**< Invalid tunnel parameters. */
|
||||
NSS_CONNMGR_TUNIPIP6_INVALID_RULE_TYPE, /**< Invalid maprule type. */
|
||||
+ NSS_CONNMGR_TUNIPIP6_CONTEXT_FAILURE, /**< Tunnel host context not found. */
|
||||
};
|
||||
|
||||
/*
|
||||
--- a/tunipip6/Makefile
|
||||
+++ b/tunipip6/Makefile
|
||||
@@ -2,9 +2,8 @@
|
||||
ccflags-y += -I$(obj)/../exports -I$(obj)/..
|
||||
ccflags-y += -DNSS_CLIENT_BUILD_ID="$(BUILD_ID)"
|
||||
ccflags-y += -DNSS_TUNIPIP6_DEBUG_LEVEL=0
|
||||
-ccflags-y += -Werror
|
||||
obj-m += qca-nss-tunipip6.o
|
||||
-qca-nss-tunipip6-objs := nss_connmgr_tunipip6.o nss_connmgr_tunipip6_sysctl.o
|
||||
+qca-nss-tunipip6-objs := nss_connmgr_tunipip6.o nss_connmgr_tunipip6_sysctl.o nss_connmgr_tunipip6_stats.o
|
||||
ifneq ($(findstring 4.4, $(KERNELVERSION)),)
|
||||
ccflags-y += -DDRAFT03_SUPPORT
|
||||
endif
|
||||
--- a/tunipip6/nss_connmgr_tunipip6.c
|
||||
+++ b/tunipip6/nss_connmgr_tunipip6.c
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/ip.h>
|
||||
#include <linux/of.h>
|
||||
-#include <linux/tcp.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
@@ -29,71 +28,123 @@
|
||||
#include <linux/if.h>
|
||||
#include <net/ip_tunnels.h>
|
||||
#include <net/ip6_tunnel.h>
|
||||
-#include <linux/if_arp.h>
|
||||
#include <nss_api_if.h>
|
||||
#include "nss_connmgr_tunipip6.h"
|
||||
#include "nss_connmgr_tunipip6_sysctl.h"
|
||||
+#include "nss_connmgr_tunipip6_priv.h"
|
||||
+
|
||||
+#define NSS_TUNIPIP6_MAX_FMR 255 /* Maximum number of forward mapping rule (FMR). */
|
||||
|
||||
/*
|
||||
- * NSS tunipip6 debug macros
|
||||
+ * Frag Id update is disabled by default
|
||||
*/
|
||||
-#if (NSS_TUNIPIP6_DEBUG_LEVEL < 1)
|
||||
-#define nss_tunipip6_assert(fmt, args...)
|
||||
-#else
|
||||
-#define nss_tunipip6_assert(c) if (!(c)) { BUG_ON(!(c)); }
|
||||
-#endif
|
||||
-
|
||||
-#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
+bool frag_id_update = false;
|
||||
+/*
|
||||
+ * Creating custom ipip6 interface is disabled by default.
|
||||
+ */
|
||||
+static bool enable_custom;
|
||||
+module_param(enable_custom, bool, 0);
|
||||
|
||||
/*
|
||||
- * Compile messages for dynamic enable/disable
|
||||
+ * tunipip6 global context.
|
||||
*/
|
||||
-#define nss_tunipip6_warning(s, ...) pr_debug("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#define nss_tunipip6_info(s, ...) pr_debug("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#define nss_tunipip6_trace(s, ...) pr_debug("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#else
|
||||
+struct nss_tunipip6_context tunipip6_ctx;
|
||||
|
||||
/*
|
||||
- * Statically compile messages at different levels
|
||||
+ * nss_tunipip6_alloc_instance()
|
||||
+ * Allocate tunipip6 interface instance.
|
||||
*/
|
||||
-#if (NSS_TUNIPIP6_DEBUG_LEVEL < 2)
|
||||
-#define nss_tunipip6_warning(s, ...)
|
||||
-#else
|
||||
-#define nss_tunipip6_warning(s, ...) pr_warn("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#endif
|
||||
+static struct nss_tunipip6_instance *nss_tunipip6_alloc_instance(struct net_device *dev,
|
||||
+ int inner_ifnum,
|
||||
+ int outer_ifnum)
|
||||
+{
|
||||
+ struct nss_tunipip6_instance*ntii;
|
||||
|
||||
-#if (NSS_TUNIPIP6_DEBUG_LEVEL < 3)
|
||||
-#define nss_tunipip6_info(s, ...)
|
||||
-#else
|
||||
-#define nss_tunipip6_info(s, ...) pr_notice("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#endif
|
||||
+ ntii = vzalloc(sizeof(*ntii));
|
||||
+ if (!ntii) {
|
||||
+ nss_tunipip6_warning("%px: Not able to allocate tunipip6 instance\n", dev);
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
-#if (NSS_TUNIPIP6_DEBUG_LEVEL < 4)
|
||||
-#define nss_tunipip6_trace(s, ...)
|
||||
-#else
|
||||
-#define nss_tunipip6_trace(s, ...) pr_info("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#endif
|
||||
-#endif
|
||||
+ ntii->dev = dev;
|
||||
+
|
||||
+ /*
|
||||
+ * Create statistics dentry.
|
||||
+ */
|
||||
+ if (!nss_tunipip6_stats_dentry_create(ntii)) {
|
||||
+ vfree(ntii);
|
||||
+ nss_tunipip6_warning("%px: Not able to create tunipip6 statistics dentry\n", dev);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ INIT_LIST_HEAD(&ntii->list);
|
||||
+ ntii->inner_ifnum = inner_ifnum;
|
||||
+ ntii->outer_ifnum = outer_ifnum;
|
||||
+ dev_hold(dev);
|
||||
+ return ntii;
|
||||
+}
|
||||
|
||||
/*
|
||||
- * Frag Id update is disabled by default
|
||||
+ * nss_tunipip6_free_instance()
|
||||
+ * Delete the tunipip6 interface instance from the list and free it.
|
||||
+ *
|
||||
+ * Note: tunnel list lock is expected to be held by the caller.
|
||||
*/
|
||||
-bool frag_id_update = false;
|
||||
+static void nss_tunipip6_free_instance(struct nss_tunipip6_instance *ntii)
|
||||
+{
|
||||
+ if (!list_empty(&ntii->list)) {
|
||||
+ list_del(&ntii->list);
|
||||
+ }
|
||||
+
|
||||
+ vfree(ntii);
|
||||
+}
|
||||
+
|
||||
/*
|
||||
- * Creating custom ipip6 interface is disabled by default.
|
||||
+ * nss_tunipip6_find_instance()
|
||||
+ * Find tunipip6 interface instance from list.
|
||||
+ *
|
||||
+ * Note: tunnel list lock is expected to be held by the caller.
|
||||
*/
|
||||
-static bool enable_custom;
|
||||
-module_param(enable_custom, bool, 0);
|
||||
+struct nss_tunipip6_instance *nss_tunipip6_find_instance(struct net_device *dev)
|
||||
+{
|
||||
+ struct nss_tunipip6_instance *ntii;
|
||||
+
|
||||
+ /*
|
||||
+ * Check if dev instance is in the list
|
||||
+ */
|
||||
+ list_for_each_entry(ntii, &tunipip6_ctx.dev_list, list) {
|
||||
+ if (ntii->dev == dev) {
|
||||
+ return ntii;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
|
||||
/*
|
||||
- * tunipip6 stats structure
|
||||
+ * nss_tunipip6_find_and_free_instance()
|
||||
+ * Find and free the tunipip6 instance.
|
||||
*/
|
||||
-struct nss_tunipip6_stats {
|
||||
- uint32_t rx_packets; /* Number of received packets */
|
||||
- uint32_t rx_bytes; /* Number of received bytes */
|
||||
- uint32_t tx_packets; /* Number of transmitted packets */
|
||||
- uint32_t tx_bytes; /* Number of transmitted bytes */
|
||||
-};
|
||||
+static enum nss_connmgr_tunipip6_err_codes nss_tunipip6_find_and_free_instance(struct net_device *netdev)
|
||||
+{
|
||||
+ struct dentry *dentry;
|
||||
+ struct nss_tunipip6_instance *ntii;
|
||||
+
|
||||
+ spin_lock_bh(&tunipip6_ctx.lock);
|
||||
+ ntii = nss_tunipip6_find_instance(netdev);
|
||||
+ if (!ntii) {
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+ nss_tunipip6_warning("%px: Not able to find tunipip6 instance for dev:%s\n", netdev, netdev->name);
|
||||
+ return NSS_CONNMGR_TUNIPIP6_CONTEXT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ dentry = ntii->dentry;
|
||||
+ nss_tunipip6_free_instance(ntii);
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+ debugfs_remove(dentry);
|
||||
+ dev_put(netdev);
|
||||
+ return NSS_CONNMGR_TUNIPIP6_SUCCESS;
|
||||
+}
|
||||
|
||||
/*
|
||||
* nss_tunipip6_encap_exception()
|
||||
@@ -289,20 +340,29 @@ static void nss_tunipip6_decap_exception
|
||||
|
||||
/*
|
||||
* nss_tunipip6_update_dev_stats
|
||||
- * Update the Dev stats received from NetAp
|
||||
+ * Update the Dev stats received from NSS
|
||||
*/
|
||||
static void nss_tunipip6_update_dev_stats(struct net_device *dev,
|
||||
- struct nss_tunipip6_stats_sync_msg *sync_stats)
|
||||
+ struct nss_tunipip6_msg *tnlmsg)
|
||||
{
|
||||
struct pcpu_sw_netstats stats;
|
||||
+ enum nss_dynamic_interface_type interface_type;
|
||||
+ struct nss_tunipip6_stats_sync_msg *sync_stats = (struct nss_tunipip6_stats_sync_msg *)&tnlmsg->msg.stats_sync;
|
||||
+
|
||||
+ interface_type = nss_dynamic_interface_get_type(nss_tunipip6_get_context(), tnlmsg->cm.interface);
|
||||
+
|
||||
+ memset(&stats, 0, sizeof(stats));
|
||||
+ if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER) {
|
||||
+ stats.tx_packets = sync_stats->node_stats.tx_packets;
|
||||
+ stats.tx_bytes = sync_stats->node_stats.tx_bytes;
|
||||
+ } else if (interface_type == NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER) {
|
||||
+ stats.rx_packets = sync_stats->node_stats.rx_packets;
|
||||
+ stats.rx_bytes = sync_stats->node_stats.rx_bytes;
|
||||
+ } else {
|
||||
+ nss_tunipip6_warning("%px: Invalid interface type received from NSS\n", dev);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- u64_stats_init(&stats.syncp);
|
||||
- u64_stats_update_begin(&stats.syncp);
|
||||
- stats.rx_packets = sync_stats->node_stats.rx_packets;
|
||||
- stats.rx_bytes = sync_stats->node_stats.rx_bytes;
|
||||
- stats.tx_packets = sync_stats->node_stats.tx_packets;
|
||||
- stats.tx_bytes = sync_stats->node_stats.tx_bytes;
|
||||
- u64_stats_update_end(&stats.syncp);
|
||||
dev->stats.rx_dropped += nss_cmn_rx_dropped_sum(&sync_stats->node_stats);
|
||||
|
||||
/* TODO: Update rx_dropped stats in ip6_update_offload_stats() */
|
||||
@@ -316,11 +376,20 @@ static void nss_tunipip6_update_dev_stat
|
||||
void nss_tunipip6_event_receive(void *if_ctx, struct nss_tunipip6_msg *tnlmsg)
|
||||
{
|
||||
struct net_device *netdev = NULL;
|
||||
+
|
||||
netdev = (struct net_device *)if_ctx;
|
||||
|
||||
switch (tnlmsg->cm.type) {
|
||||
case NSS_TUNIPIP6_RX_STATS_SYNC:
|
||||
- nss_tunipip6_update_dev_stats(netdev, (struct nss_tunipip6_stats_sync_msg *)&tnlmsg->msg.stats_sync);
|
||||
+ /*
|
||||
+ * Update netdevice statistics.
|
||||
+ */
|
||||
+ nss_tunipip6_update_dev_stats(netdev, tnlmsg);
|
||||
+
|
||||
+ /*
|
||||
+ * Update NSS statistics for tunipip6.
|
||||
+ */
|
||||
+ nss_tunipip6_stats_sync(netdev, tnlmsg);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -415,7 +484,7 @@ static void nss_tunipip6_dev_parse_param
|
||||
tnlcfg->ttl_inherit = false;
|
||||
tnlcfg->tos_inherit = true;
|
||||
tnlcfg->frag_id_update = frag_id_update;
|
||||
-
|
||||
+ tnlcfg->fmr_max = NSS_TUNIPIP6_MAX_FMR;
|
||||
/*
|
||||
* Flow Label In kernel is stored in big endian format.
|
||||
*/
|
||||
@@ -454,9 +523,9 @@ static void nss_connmgr_tunipip6_configu
|
||||
tunnel = (struct ip6_tnl *)netdev_priv(netdev);
|
||||
|
||||
/*
|
||||
- * Configure FMR table up to NSS_TUNIPIP6_MAX_FMR_NUMBER, the rest will be forwarded to BR
|
||||
+ * Configure FMR table up to NSS_TUNIPIP6_MAX_FMR, the rest will be forwarded to BR
|
||||
*/
|
||||
- for (fmr = tunnel->parms.fmrs; fmr && fmr_number < NSS_TUNIPIP6_MAX_FMR_NUMBER; fmr = fmr->next, fmr_number++) {
|
||||
+ for (fmr = tunnel->parms.fmrs; fmr && fmr_number < NSS_TUNIPIP6_MAX_FMR; fmr = fmr->next, fmr_number++) {
|
||||
/*
|
||||
* Prepare "rulecfg"
|
||||
*/
|
||||
@@ -497,6 +566,7 @@ enum nss_connmgr_tunipip6_err_codes nss_
|
||||
int inner_ifnum, outer_ifnum;
|
||||
uint32_t features = 0;
|
||||
nss_tx_status_t status;
|
||||
+ struct nss_tunipip6_instance *ntii;
|
||||
|
||||
#if IS_ENABLED(CONFIG_MAP_E_SUPPORT)
|
||||
#ifndef DRAFT03_SUPPORT
|
||||
@@ -626,7 +696,7 @@ configure_tunnel:
|
||||
status = nss_tunipip6_tx_sync(nss_ctx, &tnlmsg);
|
||||
if (status != NSS_TX_SUCCESS) {
|
||||
nss_tunipip6_warning("%px: Tunnel up command error %d\n", netdev, status);
|
||||
- goto config_fail;
|
||||
+ goto context_alloc_fail;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -644,12 +714,28 @@ configure_tunnel:
|
||||
status = nss_tunipip6_tx_sync(nss_ctx, &tnlmsg);
|
||||
if (status != NSS_TX_SUCCESS) {
|
||||
nss_tunipip6_warning("%px: Tunnel up command error %d\n", netdev, status);
|
||||
- goto config_fail;
|
||||
+ goto context_alloc_fail;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Initialize tunipip6 instance.
|
||||
+ */
|
||||
+ ntii = nss_tunipip6_alloc_instance(netdev, inner_ifnum, outer_ifnum);
|
||||
+ if (!ntii) {
|
||||
+ nss_tunipip6_warning("%px: Not able to create tunipip6 instance\n", netdev);
|
||||
+ goto context_alloc_fail;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Add the new tunipip6 instance to the global list.
|
||||
+ */
|
||||
+ spin_lock_bh(&tunipip6_ctx.lock);
|
||||
+ list_add(&ntii->list, &tunipip6_ctx.dev_list);
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+
|
||||
return NSS_CONNMGR_TUNIPIP6_SUCCESS;
|
||||
|
||||
-config_fail:
|
||||
+context_alloc_fail:
|
||||
nss_unregister_tunipip6_if(outer_ifnum);
|
||||
outer_reg_fail:
|
||||
nss_unregister_tunipip6_if(inner_ifnum);
|
||||
@@ -675,6 +761,8 @@ EXPORT_SYMBOL(nss_connmgr_tunipip6_creat
|
||||
*/
|
||||
enum nss_connmgr_tunipip6_err_codes nss_connmgr_tunipip6_destroy_interface(struct net_device *netdev)
|
||||
{
|
||||
+ enum nss_connmgr_tunipip6_err_codes ret;
|
||||
+
|
||||
/*
|
||||
* Validate netdev for ipv6-in-ipv4 Tunnel
|
||||
*/
|
||||
@@ -682,7 +770,20 @@ enum nss_connmgr_tunipip6_err_codes nss_
|
||||
return NSS_CONNMGR_TUNIPIP6_NETDEV_TYPE_FAILURE;
|
||||
}
|
||||
|
||||
- return _nss_tunipip6_dyn_interface_destroy(netdev);
|
||||
+ /*
|
||||
+ * Destroy tunipip6 NSS context.
|
||||
+ */
|
||||
+ ret = _nss_tunipip6_dyn_interface_destroy(netdev);
|
||||
+ if (ret != NSS_CONNMGR_TUNIPIP6_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%px: Not able to destroy NSS context. Err: %d\n", netdev, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Find and free the tunipip6 instance.
|
||||
+ */
|
||||
+ ret = nss_tunipip6_find_and_free_instance(netdev);
|
||||
+ return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(nss_connmgr_tunipip6_destroy_interface);
|
||||
|
||||
@@ -941,6 +1042,39 @@ static int nss_tunipip6_dev_event(struct
|
||||
}
|
||||
|
||||
/*
|
||||
+ * nss_tunipip6_destroy_interface_all()
|
||||
+ * Destroy NSS interfaces and free instance for all tunipip6 interfaces.
|
||||
+ */
|
||||
+static void nss_tunipip6_destroy_interface_all(void)
|
||||
+{
|
||||
+ struct net_device *netdev;
|
||||
+ struct dentry *dentry;
|
||||
+ struct nss_tunipip6_instance *ntii;
|
||||
+
|
||||
+ spin_lock_bh(&tunipip6_ctx.lock);
|
||||
+ ntii = list_first_entry_or_null(&tunipip6_ctx.dev_list, struct nss_tunipip6_instance, list);
|
||||
+ do {
|
||||
+ if (!ntii) {
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ netdev = ntii->dev;
|
||||
+ dentry = ntii->dentry;
|
||||
+ nss_tunipip6_free_instance(ntii);
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+
|
||||
+ dev_put(netdev);
|
||||
+ debugfs_remove(dentry);
|
||||
+ _nss_tunipip6_dyn_interface_destroy(netdev);
|
||||
+
|
||||
+ spin_lock_bh(&tunipip6_ctx.lock);
|
||||
+ ntii = list_first_entry_or_null(&tunipip6_ctx.dev_list, struct nss_tunipip6_instance, list);
|
||||
+ } while (ntii);
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Linux Net device Notifier
|
||||
*/
|
||||
struct notifier_block nss_tunipip6_notifier = {
|
||||
@@ -965,6 +1099,20 @@ int __init nss_tunipip6_init_module(void
|
||||
NSS_CLIENT_BUILD_ID);
|
||||
|
||||
/*
|
||||
+ * Initialize lock and dev list.
|
||||
+ */
|
||||
+ INIT_LIST_HEAD(&tunipip6_ctx.dev_list);
|
||||
+ spin_lock_init(&tunipip6_ctx.lock);
|
||||
+
|
||||
+ /*
|
||||
+ * Create the debugfs directory for statistics.
|
||||
+ */
|
||||
+ if (!nss_tunipip6_stats_dentry_init()) {
|
||||
+ nss_tunipip6_trace("Failed to initialize debugfs\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
* Do not register net device notification for
|
||||
* custom tunnel. Net device notification is used only
|
||||
* for standard tunnel.
|
||||
@@ -1000,6 +1148,16 @@ void __exit nss_tunipip6_exit_module(voi
|
||||
#endif
|
||||
|
||||
/*
|
||||
+ * Free Host and NSS tunipip6 instances.
|
||||
+ */
|
||||
+ nss_tunipip6_destroy_interface_all();
|
||||
+
|
||||
+ /*
|
||||
+ * De-initialize debugfs.
|
||||
+ */
|
||||
+ nss_tunipip6_stats_dentry_deinit();
|
||||
+
|
||||
+ /*
|
||||
* Unregister net device notification for standard tunnel.
|
||||
*/
|
||||
if (!enable_custom) {
|
||||
--- /dev/null
|
||||
+++ b/tunipip6/nss_connmgr_tunipip6_priv.h
|
||||
@@ -0,0 +1,94 @@
|
||||
+/*
|
||||
+ **************************************************************************
|
||||
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ **************************************************************************
|
||||
+ */
|
||||
+
|
||||
+#ifndef __NSS_CONNMGR_TUNIPIP6_PRIV_H_
|
||||
+#define __NSS_CONNMGR_TUNIPIP6_PRIV_H_
|
||||
+
|
||||
+#include "nss_connmgr_tunipip6_stats.h"
|
||||
+#include <linux/debugfs.h>
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 context
|
||||
+ */
|
||||
+extern struct nss_tunipip6_context tunipip6_ctx;
|
||||
+
|
||||
+/*
|
||||
+ * NSS tunipip6 debug macros
|
||||
+ */
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 1)
|
||||
+#define nss_tunipip6_assert(fmt, args...)
|
||||
+#else
|
||||
+#define nss_tunipip6_assert(c) if (!(c)) { BUG_ON(!(c)); }
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * Compile messages for dynamic enable/disable
|
||||
+ */
|
||||
+#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
+#define nss_tunipip6_warning(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_tunipip6_info(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_tunipip6_trace(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
+#else /* CONFIG_DYNAMIC_DEBUG */
|
||||
+/*
|
||||
+ * Statically compile messages at different levels
|
||||
+ */
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 2)
|
||||
+#define nss_tunipip6_warning(s, ...)
|
||||
+#else
|
||||
+#define nss_tunipip6_warning(s, ...) pr_warn("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
+#endif
|
||||
+
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 3)
|
||||
+#define nss_tunipip6_info(s, ...)
|
||||
+#else
|
||||
+#define nss_tunipip6_info(s, ...) pr_notice("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
+#endif
|
||||
+
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 4)
|
||||
+#define nss_tunipip6_trace(s, ...)
|
||||
+#else
|
||||
+#define nss_tunipip6_trace(s, ...) pr_info("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
+#endif
|
||||
+#endif /* CONFIG_DYNAMIC_DEBUG */
|
||||
+
|
||||
+extern struct nss_tunipip6_context tunipip6_ctx;
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 global context structure.
|
||||
+ */
|
||||
+struct nss_tunipip6_context {
|
||||
+ struct list_head dev_list; /* List of tunipip6 interface instances */
|
||||
+ struct dentry *tunipip6_dentry_dir; /* tunipip6 debugfs directory entry */
|
||||
+ spinlock_t lock; /* Lock to protect list. */
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 interface instance structure.
|
||||
+ */
|
||||
+struct nss_tunipip6_instance {
|
||||
+ struct list_head list; /* List of tunipip6 interface instance */
|
||||
+ struct net_device *dev; /* tunipip6 netdevice */
|
||||
+ struct dentry *dentry; /* debugfs entry for this tunnel device */
|
||||
+ struct nss_tunipip6_stats stats; /* tunipip6 statistics */
|
||||
+ uint32_t inner_ifnum; /* tunipip6 inner dynamic interface */
|
||||
+ uint32_t outer_ifnum; /* tunipip6 outer dynamic interface */
|
||||
+};
|
||||
+
|
||||
+struct nss_tunipip6_instance *nss_tunipip6_find_instance(struct net_device *dev);
|
||||
+
|
||||
+#endif /* __NSS_CONNMGR_TUNIPIP6_PRIV_H_ */
|
||||
--- /dev/null
|
||||
+++ b/tunipip6/nss_connmgr_tunipip6_stats.c
|
||||
@@ -0,0 +1,225 @@
|
||||
+/*
|
||||
+ **************************************************************************
|
||||
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ **************************************************************************
|
||||
+ */
|
||||
+
|
||||
+#include <nss_api_if.h>
|
||||
+#include "nss_connmgr_tunipip6_priv.h"
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_str
|
||||
+ * tunipip6 statistics strings for NSS tunnel stats
|
||||
+ */
|
||||
+static int8_t *nss_tunipip6_stats_str[NSS_TUNIPIP6_STATS_MAX] = {
|
||||
+ "rx pkts",
|
||||
+ "rx bytes",
|
||||
+ "tx pkts",
|
||||
+ "tx bytes",
|
||||
+ "rx queue 0 dropped",
|
||||
+ "rx queue 1 dropped",
|
||||
+ "rx queue 2 dropped",
|
||||
+ "rx queue 3 dropped",
|
||||
+ "encap low headroom",
|
||||
+ "encap unhandled_protocol",
|
||||
+ "encap enqueue fail",
|
||||
+ "encap tunnel exist",
|
||||
+ "encap total fmr_count",
|
||||
+ "encap fmr add count",
|
||||
+ "encap fmr del count",
|
||||
+ "encap fmr flush count",
|
||||
+ "encap fmr update_count",
|
||||
+ "encap fmr add_fail count",
|
||||
+ "encap fmr del_fail count",
|
||||
+ "encap error no fmr",
|
||||
+ "encap bmr add count",
|
||||
+ "encap bmr del count",
|
||||
+ "encap error bmr exist",
|
||||
+ "encap error no bmr",
|
||||
+ "decap enqueue fail",
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_show()
|
||||
+ * Read tunipip6 tunnel statistics
|
||||
+ */
|
||||
+static int nss_tunipip6_stats_show(struct seq_file *m, void __attribute__((unused))*p)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct nss_tunipip6_instance *tun_inst;
|
||||
+ struct nss_tunipip6_stats *tunipip6_tunnel_stats;
|
||||
+
|
||||
+ tun_inst = vzalloc(sizeof(struct nss_tunipip6_instance));
|
||||
+ if (!tun_inst) {
|
||||
+ nss_tunipip6_warning("Failed to allocate memory for tun_inst\n");
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ tunipip6_tunnel_stats = vzalloc(sizeof(struct nss_tunipip6_stats));
|
||||
+ if (!tunipip6_tunnel_stats) {
|
||||
+ nss_tunipip6_warning("Failed to allocate memory for tunipip6_tunnel_stats\n");
|
||||
+ vfree(tun_inst);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Copy the tunnel and stats information from the tunnel instance.
|
||||
+ */
|
||||
+ spin_lock_bh(&tunipip6_ctx.lock);
|
||||
+ memcpy(tun_inst, m->private, sizeof(struct nss_tunipip6_instance));
|
||||
+ memcpy(tunipip6_tunnel_stats, &tun_inst->stats, sizeof(struct nss_tunipip6_stats));
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+
|
||||
+ seq_printf(m, "\n\tInner ifnum %u stats:\n", tun_inst->inner_ifnum);
|
||||
+ for (i = 0; i < NSS_TUNIPIP6_STATS_MAX; i++) {
|
||||
+ seq_printf(m, "\t\t%s = %llu\n",
|
||||
+ nss_tunipip6_stats_str[i],
|
||||
+ tunipip6_tunnel_stats->inner_stats[i]);
|
||||
+ }
|
||||
+
|
||||
+ seq_printf(m, "\n\tOuter ifnum %u stats:\n", tun_inst->outer_ifnum);
|
||||
+ for (i = 0; i < NSS_TUNIPIP6_STATS_MAX; i++) {
|
||||
+ seq_printf(m, "\t\t%s = %llu\n",
|
||||
+ nss_tunipip6_stats_str[i],
|
||||
+ tunipip6_tunnel_stats->outer_stats[i]);
|
||||
+ }
|
||||
+
|
||||
+ seq_printf(m, "\n%s tunnel stats end\n\n", tun_inst->dev->name);
|
||||
+ vfree(tun_inst);
|
||||
+ vfree(tunipip6_tunnel_stats);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_open()
|
||||
+ */
|
||||
+static int nss_tunipip6_stats_open(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ return single_open(file, nss_tunipip6_stats_show, inode->i_private);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_update()
|
||||
+ * Update inner or outer node statistics
|
||||
+ */
|
||||
+static void nss_tunipip6_stats_update(uint64_t *stats, struct nss_tunipip6_stats_sync_msg *stats_msg)
|
||||
+{
|
||||
+ uint32_t i, *src;
|
||||
+ uint64_t *dest = stats;
|
||||
+
|
||||
+ src = &stats_msg->node_stats.rx_packets;
|
||||
+ for (i = NSS_TUNIPIP6_STATS_RX_PKTS; i < NSS_TUNIPIP6_STATS_MAX; i++, src++, dest++) {
|
||||
+ *dest += *src;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_sync()
|
||||
+ * Sync function for tunipip6 statistics
|
||||
+ */
|
||||
+void nss_tunipip6_stats_sync(struct net_device *dev, struct nss_tunipip6_msg *ntm)
|
||||
+{
|
||||
+ uint32_t ifnum = ntm->cm.interface;
|
||||
+ struct nss_tunipip6_stats_sync_msg *stats = &ntm->msg.stats_sync;
|
||||
+ struct nss_tunipip6_instance *ntii;
|
||||
+ struct nss_tunipip6_stats *s;
|
||||
+
|
||||
+ spin_lock_bh(&tunipip6_ctx.lock);
|
||||
+ ntii = nss_tunipip6_find_instance(dev);
|
||||
+ if (!ntii) {
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+ nss_tunipip6_warning("%px: Not able to find context for device: %s\n", dev, dev->name);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ s = &ntii->stats;
|
||||
+ if (ntii->inner_ifnum == ifnum) {
|
||||
+ nss_tunipip6_stats_update(s->inner_stats, stats);
|
||||
+ } else if (ntii->outer_ifnum == ifnum) {
|
||||
+ nss_tunipip6_stats_update(s->outer_stats, stats);
|
||||
+ } else {
|
||||
+ nss_tunipip6_warning("%px: Netdev=%s invalid interface number. Interface No: %u\n", dev, dev->name, ifnum);
|
||||
+ }
|
||||
+
|
||||
+ spin_unlock_bh(&tunipip6_ctx.lock);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_ops
|
||||
+ * File operations for tunipip6 tunnel stats
|
||||
+ */
|
||||
+static const struct file_operations nss_tunipip6_stats_ops = { \
|
||||
+ .open = nss_tunipip6_stats_open,
|
||||
+ .read = seq_read,
|
||||
+ .llseek = seq_lseek,
|
||||
+ .release = seq_release
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_dentry_destroy()
|
||||
+ * Remove debufs file for given tunnel.
|
||||
+ */
|
||||
+void nss_tunipip6_stats_dentry_destroy(struct nss_tunipip6_instance *tun_inst)
|
||||
+{
|
||||
+ debugfs_remove(tun_inst->dentry);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_dentry_create()
|
||||
+ * Create dentry for a given tunnel.
|
||||
+ */
|
||||
+bool nss_tunipip6_stats_dentry_create(struct nss_tunipip6_instance *tun_inst)
|
||||
+{
|
||||
+ char dentry_name[IFNAMSIZ];
|
||||
+
|
||||
+ scnprintf(dentry_name, sizeof(dentry_name), "%s", tun_inst->dev->name);
|
||||
+ tun_inst->dentry = debugfs_create_file(dentry_name, S_IRUGO,
|
||||
+ tunipip6_ctx.tunipip6_dentry_dir, tun_inst, &nss_tunipip6_stats_ops);
|
||||
+ if (!tun_inst->dentry) {
|
||||
+ nss_tunipip6_warning("Debugfs file creation failed for tun %s\n", tun_inst->dev->name);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_dentry_deinit()
|
||||
+ * Cleanup the debugfs tree.
|
||||
+ */
|
||||
+void nss_tunipip6_stats_dentry_deinit(void)
|
||||
+{
|
||||
+ if (tunipip6_ctx.tunipip6_dentry_dir) {
|
||||
+ debugfs_remove_recursive(tunipip6_ctx.tunipip6_dentry_dir);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_stats_dentry_init()
|
||||
+ * Create tunipip6 tunnel statistics debugfs entry.
|
||||
+ */
|
||||
+bool nss_tunipip6_stats_dentry_init(void)
|
||||
+{
|
||||
+ /*
|
||||
+ * Initialize debugfs directory.
|
||||
+ */
|
||||
+ tunipip6_ctx.tunipip6_dentry_dir = debugfs_create_dir("qca-nss-tunipip6", NULL);
|
||||
+ if (!tunipip6_ctx.tunipip6_dentry_dir) {
|
||||
+ nss_tunipip6_warning("Failed to create debug entry for subsystem: qca-nss-tunipip6\n");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/tunipip6/nss_connmgr_tunipip6_stats.h
|
||||
@@ -0,0 +1,73 @@
|
||||
+/*
|
||||
+ ******************************************************************************
|
||||
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ * ****************************************************************************
|
||||
+ */
|
||||
+
|
||||
+#ifndef _NSS_CONNMGR_TUNIPIP6_STATS_H_
|
||||
+#define _NSS_CONNMGR_TUNIPIP6_STATS_H_
|
||||
+
|
||||
+struct nss_tunipip6_instance;
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 statistic counters
|
||||
+ */
|
||||
+enum nss_tunipip6_stats_type {
|
||||
+ NSS_TUNIPIP6_STATS_RX_PKTS,
|
||||
+ NSS_TUNIPIP6_STATS_RX_BYTES,
|
||||
+ NSS_TUNIPIP6_STATS_TX_PKTS,
|
||||
+ NSS_TUNIPIP6_STATS_TX_BYTES,
|
||||
+ NSS_TUNIPIP6_STATS_RX_QUEUE_0_DROPPED,
|
||||
+ NSS_TUNIPIP6_STATS_RX_QUEUE_1_DROPPED,
|
||||
+ NSS_TUNIPIP6_STATS_RX_QUEUE_2_DROPPED,
|
||||
+ NSS_TUNIPIP6_STATS_RX_QUEUE_3_DROPPED,
|
||||
+ NSS_TUNIPIP6_STATS_EXCEP_ENCAP_LOW_HEADROOM,
|
||||
+ NSS_TUNIPIP6_STATS_EXCEP_ENCAP_UNHANDLED_PROTOCOL,
|
||||
+ NSS_TUNIPIP6_STATS_DROP_ENCAP_ENQUEUE_FAIL,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ERR_TUNNEL,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_TOTAL_FMR,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_FMR_ADD,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_FMR_DEL,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_FMR_FLUSH,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_FMR_UPDATE,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_FMR_ADD_FAIL,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_FMR_DEL_FAIL,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_ERR_NO_FMR,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_BMR_ADD,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_BMR_DEL,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_ERR_BMR_EXIST,
|
||||
+ NSS_TUNIPIP6_STATS_CONFIG_ENCAP_ERR_NO_BMR,
|
||||
+ NSS_TUNIPIP6_STATS_DROP_DECAP_ENQUEUE_FAIL,
|
||||
+ NSS_TUNIPIP6_STATS_MAX,
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 statistics
|
||||
+ */
|
||||
+struct nss_tunipip6_stats {
|
||||
+ uint64_t inner_stats[NSS_TUNIPIP6_STATS_MAX];
|
||||
+ uint64_t outer_stats[NSS_TUNIPIP6_STATS_MAX];
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 statistics API
|
||||
+ */
|
||||
+extern void nss_tunipip6_stats_sync(struct net_device *dev, struct nss_tunipip6_msg *ntm);
|
||||
+extern void nss_tunipip6_stats_dentry_deinit(void);
|
||||
+extern bool nss_tunipip6_stats_dentry_init(void);
|
||||
+extern void nss_tunipip6_stats_dentry_destroy(struct nss_tunipip6_instance *tun_inst);
|
||||
+extern bool nss_tunipip6_stats_dentry_create(struct nss_tunipip6_instance *tun_inst);
|
||||
+
|
||||
+#endif /* _NSS_CONNMGR_TUNIPIP6_STATS_H_ */
|
||||
--- a/tunipip6/nss_connmgr_tunipip6_sysctl.c
|
||||
+++ b/tunipip6/nss_connmgr_tunipip6_sysctl.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2020-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
|
||||
@@ -61,7 +61,7 @@ static int nss_tunipip6_data_parser(stru
|
||||
bool ipv4_prefix_valid = false, ipv4_prefix_len_valid = false, ipv6_suffix_len_valid = false;
|
||||
bool rule_type_valid = false, ea_len_valid = false, psid_offset_valid = false, netdev_valid = false;
|
||||
struct nss_connmgr_tunipip6_maprule_cfg mrcfg = {0};
|
||||
- char *buf = kzalloc(MAX_PROC_SIZE, GFP_KERNEL);
|
||||
+ char *buf;
|
||||
enum nss_connmgr_tunipip6_err_codes status;
|
||||
struct net_device *dev = NULL;
|
||||
char *pfree;
|
||||
@@ -69,7 +69,11 @@ static int nss_tunipip6_data_parser(stru
|
||||
int ret;
|
||||
int count;
|
||||
|
||||
+ if (!write) {
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
|
||||
+ buf = kzalloc(MAX_PROC_SIZE, GFP_KERNEL);
|
||||
if (!buf) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -122,6 +126,7 @@ static int nss_tunipip6_data_parser(stru
|
||||
|
||||
if ((rule_type !=NSS_CONNMGR_TUNIPIP6_RULE_BMR) &&
|
||||
(rule_type != NSS_CONNMGR_TUNIPIP6_RULE_FMR)) {
|
||||
+ kfree(pfree);
|
||||
goto fail;
|
||||
}
|
||||
rule_type_valid = true;
|
||||
@@ -135,6 +140,7 @@ static int nss_tunipip6_data_parser(stru
|
||||
}
|
||||
|
||||
if (frag_id != 0 && frag_id != 1) {
|
||||
+ kfree(pfree);
|
||||
goto fail;
|
||||
}
|
||||
continue;
|
||||
@@ -396,9 +402,9 @@ static int nss_tunipip6_cmd_procfs_read_
|
||||
b. To delete maprule(BMR):\n\
|
||||
echo dev=<map-mape/MAP-E netdevice> rule_type=<1> > remove_map_rule\n\
|
||||
3. To flush FMR entries:\n\
|
||||
- echo dev=<map-mape/MAP-E netdevice> > flush_fmr_rule\n\
|
||||
- 4. To enable/disable frag id:\n\
|
||||
- echo frag_id_update=<0/1> > frag_id\n\
|
||||
+ echo dev=<map-mape/MAP-E netdevice> > flush_fmr_rule\n");
|
||||
+ pr_info("\t\t\t4. To enable/disable frag id: \n\
|
||||
+ echo frag_id_update=<0/1> > frag_id \n\
|
||||
=====end of help=====\n");
|
||||
*lenp = 0;
|
||||
return ret;
|
||||
11
qca-nss-clients/patches/0004-kernel-5.4-support-dtls.patch
Normal file
11
qca-nss-clients/patches/0004-kernel-5.4-support-dtls.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/dtls/v1.0/nss_connmgr_dtls_netdev.c
|
||||
+++ b/dtls/v1.0/nss_connmgr_dtls_netdev.c
|
||||
@@ -160,7 +160,7 @@ static void nss_dtlsmgr_dev_setup(struct
|
||||
dev->ethtool_ops = NULL;
|
||||
dev->header_ops = NULL;
|
||||
dev->netdev_ops = &nss_dtlsmgr_session_ops;
|
||||
- dev->destructor = NULL;
|
||||
+ dev->priv_destructor = NULL;
|
||||
|
||||
memcpy(dev->dev_addr, "\xaa\xbb\xcc\xdd\xee\xff", dev->addr_len);
|
||||
memset(dev->broadcast, 0xff, dev->addr_len);
|
||||
@ -1,84 +0,0 @@
|
||||
--- a/capwapmgr/nss_capwapmgr.c
|
||||
+++ b/capwapmgr/nss_capwapmgr.c
|
||||
@@ -348,6 +348,40 @@ static struct rtnl_link_stats64 *nss_cap
|
||||
return stats;
|
||||
}
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0))
|
||||
+/*
|
||||
+ * nss_capwapmgr_dev_tunnel_stats()
|
||||
+ * Netdev ops function to retrieve stats for kernel version < 4.6
|
||||
+ */
|
||||
+static struct rtnl_link_stats64 *nss_capwapmgr_dev_tunnel_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+{
|
||||
+ return nss_capwapmgr_get_tunnel_stats(dev, stats);
|
||||
+}
|
||||
+#else
|
||||
+/*
|
||||
+ * nss_capwapmgr_dev_tunnel_stats()
|
||||
+ * Netdev ops function to retrieve stats for kernel version > 4.6
|
||||
+ */
|
||||
+static void nss_capwapmgr_dev_tunnel_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+{
|
||||
+ nss_capwapmgr_get_tunnel_stats(dev, stats);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+/**
|
||||
+ * nss_capwapmgr_change_mtu - set new MTU size
|
||||
+ * @dev: network device
|
||||
+ * @new_mtu: new Maximum Transfer Unit
|
||||
+ *
|
||||
+ * Allow changing MTU size. Needs to be overridden for devices
|
||||
+ * supporting jumbo frames.
|
||||
+ */
|
||||
+int nss_capwapmgr_change_mtu(struct net_device *dev, int new_mtu)
|
||||
+{
|
||||
+ dev->mtu = new_mtu;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* nss_capwapmgr_netdev_ops
|
||||
* Netdev operations.
|
||||
@@ -357,8 +391,8 @@ static const struct net_device_ops nss_c
|
||||
.ndo_stop = nss_capwapmgr_close,
|
||||
.ndo_start_xmit = nss_capwapmgr_start_xmit,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
- .ndo_change_mtu = eth_change_mtu,
|
||||
- .ndo_get_stats64 = nss_capwapmgr_get_tunnel_stats,
|
||||
+ .ndo_change_mtu = nss_capwapmgr_change_mtu,
|
||||
+ .ndo_get_stats64 = nss_capwapmgr_dev_tunnel_stats,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -375,7 +409,12 @@ static void nss_capwapmgr_dummpy_netdev_
|
||||
dev->ethtool_ops = NULL;
|
||||
dev->header_ops = NULL;
|
||||
dev->netdev_ops = &nss_capwapmgr_netdev_ops;
|
||||
+
|
||||
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 11, 8))
|
||||
dev->destructor = NULL;
|
||||
+#else
|
||||
+ dev->priv_destructor = NULL;
|
||||
+#endif
|
||||
memcpy(dev->dev_addr, "\x00\x00\x00\x00\x00\x00", dev->addr_len);
|
||||
memset(dev->broadcast, 0xff, dev->addr_len);
|
||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||
@@ -514,6 +553,8 @@ static nss_capwapmgr_status_t nss_capwap
|
||||
/*
|
||||
* nss_capwapmgr_verify_tunnel_param()
|
||||
* Common function to verify tunnel_id and returns pointer to tunnel.
|
||||
+ *
|
||||
+ * The caller of the function should hold reference to the net device before calling.
|
||||
*/
|
||||
static struct nss_capwapmgr_tunnel *nss_capwapmgr_verify_tunnel_param(struct net_device *dev, uint8_t tunnel_id)
|
||||
{
|
||||
@@ -1050,6 +1091,7 @@ static nss_tx_status_t nss_capwapmgr_cre
|
||||
nircm->rule_flags |= rule_flags;
|
||||
nircm->valid_flags |= valid_flags;
|
||||
|
||||
+ down(&ip_response.sem);
|
||||
status = nss_ipv6_tx(nss_ctx, &nim);
|
||||
if (status != NSS_TX_SUCCESS) {
|
||||
up(&ip_response.sem);
|
||||
@ -1,92 +0,0 @@
|
||||
--- a/match/nss_match_l2.c
|
||||
+++ b/match/nss_match_l2.c
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
|
||||
@@ -133,7 +134,7 @@ static int nss_match_l2_cmd_parse(char *
|
||||
struct nss_ctx_instance *nss_ctx = nss_match_get_context();
|
||||
int ret = 0;
|
||||
uint32_t mask_val[4] = {0};
|
||||
- uint32_t actions = 0, if_num = 0, setprio = 0, nexthop = 0;
|
||||
+ uint32_t actions = 0, if_num = 0, setprio = NSS_MAX_NUM_PRI, nexthop = 0;
|
||||
uint16_t smac[3] = {0}, dmac[3] = {0}, mask_id = 0, ethertype = 0;
|
||||
uint8_t mac_addr_tmp[6];
|
||||
char tmp[4];
|
||||
@@ -340,22 +341,22 @@ static int nss_match_l2_cmd_parse(char *
|
||||
|
||||
switch(actions) {
|
||||
case NSS_MATCH_ACTION_SETPRIO:
|
||||
- if (nexthop || !setprio || setprio >= NSS_MAX_NUM_PRI) {
|
||||
+ if (nexthop || setprio >= NSS_MAX_NUM_PRI) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case NSS_MATCH_ACTION_FORWARD:
|
||||
- if (setprio || !nexthop) {
|
||||
+ if (!(setprio == NSS_MAX_NUM_PRI) || !nexthop) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case NSS_MATCH_ACTION_SETPRIO | NSS_MATCH_ACTION_FORWARD:
|
||||
- if (!setprio || !nexthop || setprio >= NSS_MAX_NUM_PRI) {
|
||||
+ if (!nexthop || setprio >= NSS_MAX_NUM_PRI) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case NSS_MATCH_ACTION_DROP:
|
||||
- if (setprio || nexthop) {
|
||||
+ if (!(setprio == NSS_MAX_NUM_PRI) || nexthop) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
--- a/match/nss_match_vow.c
|
||||
+++ b/match/nss_match_vow.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2020-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
|
||||
@@ -122,7 +122,7 @@ static int nss_match_vow_cmd_parse(char
|
||||
char *token, *param, *value;
|
||||
struct nss_ctx_instance *nss_ctx = nss_match_get_context();
|
||||
int ret = 0;
|
||||
- uint32_t actions = 0, if_num = 0, dscp = 0, outer_prio = 0, inner_prio = 0, setprio = 0, nexthop = 0;
|
||||
+ uint32_t actions = 0, if_num = 0, dscp = 0, outer_prio = 0, inner_prio = 0, setprio = NSS_MAX_NUM_PRI, nexthop = 0;
|
||||
uint16_t mask_id = 0;
|
||||
uint32_t mask_val = 0;
|
||||
|
||||
@@ -301,22 +301,22 @@ static int nss_match_vow_cmd_parse(char
|
||||
|
||||
switch(actions) {
|
||||
case NSS_MATCH_ACTION_SETPRIO:
|
||||
- if (nexthop || !setprio || setprio >= NSS_MAX_NUM_PRI) {
|
||||
+ if (nexthop || setprio >= NSS_MAX_NUM_PRI) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case NSS_MATCH_ACTION_FORWARD:
|
||||
- if (setprio || !nexthop) {
|
||||
+ if (!(setprio == NSS_MAX_NUM_PRI) || !nexthop) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case NSS_MATCH_ACTION_SETPRIO | NSS_MATCH_ACTION_FORWARD:
|
||||
- if (!setprio || !nexthop || setprio >= NSS_MAX_NUM_PRI) {
|
||||
+ if (!nexthop || setprio >= NSS_MAX_NUM_PRI) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
case NSS_MATCH_ACTION_DROP:
|
||||
- if (setprio || nexthop) {
|
||||
+ if (!(setprio == NSS_MAX_NUM_PRI) || nexthop) {
|
||||
goto fail;
|
||||
}
|
||||
break;
|
||||
59
qca-nss-clients/patches/0005-vlanmgr-fix-compile-error.patch
Normal file
59
qca-nss-clients/patches/0005-vlanmgr-fix-compile-error.patch
Normal file
@ -0,0 +1,59 @@
|
||||
--- a/vlan/nss_vlan_mgr.c
|
||||
+++ b/vlan/nss_vlan_mgr.c
|
||||
@@ -800,8 +800,10 @@ static struct nss_vlan_pvt *nss_vlan_mgr
|
||||
*/
|
||||
static void nss_vlan_mgr_instance_free(struct nss_vlan_pvt *v)
|
||||
{
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
int32_t i;
|
||||
int ret = 0;
|
||||
+#endif
|
||||
|
||||
spin_lock(&vlan_mgr_ctx.lock);
|
||||
BUG_ON(--v->refs);
|
||||
@@ -961,8 +963,11 @@ static int nss_vlan_mgr_register_event(s
|
||||
int ret;
|
||||
#endif
|
||||
uint32_t vlan_tag;
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
struct net_device *slave;
|
||||
- int32_t port, port_if;
|
||||
+ int32_t port;
|
||||
+#endif
|
||||
+ int32_t port_if;
|
||||
struct vlan_dev_priv *vlan;
|
||||
struct net_device *real_dev;
|
||||
bool is_bond_master = false;
|
||||
@@ -1355,8 +1360,10 @@ return_with_error:
|
||||
int nss_vlan_mgr_join_bridge(struct net_device *dev, uint32_t bridge_vsi)
|
||||
{
|
||||
struct nss_vlan_pvt *v = nss_vlan_mgr_instance_find_and_ref(dev);
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
struct net_device *real_dev;
|
||||
int ret;
|
||||
+#endif
|
||||
|
||||
if (!v)
|
||||
return 0;
|
||||
@@ -1416,8 +1423,10 @@ EXPORT_SYMBOL(nss_vlan_mgr_join_bridge);
|
||||
int nss_vlan_mgr_leave_bridge(struct net_device *dev, uint32_t bridge_vsi)
|
||||
{
|
||||
struct nss_vlan_pvt *v = nss_vlan_mgr_instance_find_and_ref(dev);
|
||||
+#ifdef NSS_VLAN_MGR_PPE_SUPPORT
|
||||
struct net_device *real_dev;
|
||||
int ret;
|
||||
+#endif
|
||||
|
||||
if (!v)
|
||||
return 0;
|
||||
--- a/vlan/Makefile
|
||||
+++ b/vlan/Makefile
|
||||
@@ -8,7 +8,7 @@ ifeq ($(SoC),$(filter $(SoC),ipq807x ipq
|
||||
ccflags-y += -DNSS_VLAN_MGR_PPE_SUPPORT
|
||||
endif
|
||||
|
||||
-ccflags-y += -DNSS_VLAN_MGR_DEBUG_LEVEL=0
|
||||
+ccflags-y += -DNSS_VLAN_MGR_DEBUG_LEVEL=4
|
||||
ccflags-y += -Wall -Werror
|
||||
|
||||
ifneq (,$(filter $(CONFIG_BONDING),y m))
|
||||
@ -1,104 +0,0 @@
|
||||
--- a/pvxlanmgr/nss_pvxlanmgr.c
|
||||
+++ b/pvxlanmgr/nss_pvxlanmgr.c
|
||||
@@ -186,6 +186,26 @@ static struct rtnl_link_stats64 *nss_pvx
|
||||
return stats;
|
||||
}
|
||||
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0))
|
||||
+/*
|
||||
+ * nss_pvxlanmgr_dev_tunnel_stats()
|
||||
+ * Netdev ops function to retrieve stats for kernel version < 4.6
|
||||
+ */
|
||||
+static struct rtnl_link_stats64 *nss_pvxlanmgr_dev_tunnel_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+{
|
||||
+ return nss_pvxlanmgr_get_tunnel_stats(dev, stats);
|
||||
+}
|
||||
+#else
|
||||
+/*
|
||||
+ * nss_pvxlanmgr_dev_tunnel_stats()
|
||||
+ * Netdev ops function to retrieve stats for kernel version > 4.6
|
||||
+ */
|
||||
+static void nss_pvxlanmgr_dev_tunnel_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+{
|
||||
+ nss_pvxlanmgr_get_tunnel_stats(dev, stats);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* nss_pvxlanmgr_unregister_with_nss()
|
||||
* Internal function to unregister with NSS FW
|
||||
@@ -262,7 +282,7 @@ static const struct net_device_ops nss_p
|
||||
.ndo_stop = nss_pvxlanmgr_close,
|
||||
.ndo_start_xmit = nss_pvxlanmgr_start_xmit,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
- .ndo_get_stats64 = nss_pvxlanmgr_get_tunnel_stats,
|
||||
+ .ndo_get_stats64 = nss_pvxlanmgr_dev_tunnel_stats,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -278,7 +298,13 @@ static void nss_pvxlanmgr_dummy_netdev_s
|
||||
dev->ethtool_ops = NULL;
|
||||
dev->header_ops = NULL;
|
||||
dev->netdev_ops = &nss_pvxlanmgr_netdev_ops;
|
||||
+
|
||||
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 11, 8))
|
||||
dev->destructor = NULL;
|
||||
+#else
|
||||
+ dev->priv_destructor = NULL;
|
||||
+#endif
|
||||
+
|
||||
memcpy(dev->dev_addr, "\x00\x00\x00\x00\x00\x00", dev->addr_len);
|
||||
memset(dev->broadcast, 0xff, dev->addr_len);
|
||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||
@@ -600,13 +626,14 @@ EXPORT_SYMBOL(nss_pvxlanmgr_netdev_creat
|
||||
void __exit nss_pvxlanmgr_exit_module(void)
|
||||
{
|
||||
int ret;
|
||||
-
|
||||
+#ifdef CONFIG_OF
|
||||
/*
|
||||
* If the node is not compatible, don't do anything.
|
||||
*/
|
||||
if (!of_find_node_by_name(NULL, "nss-common")) {
|
||||
return;
|
||||
}
|
||||
+#endif
|
||||
|
||||
ret = unregister_netdevice_notifier(&nss_pvxlanmgr_netdev_notifier);
|
||||
if (!ret) {
|
||||
@@ -623,12 +650,14 @@ void __exit nss_pvxlanmgr_exit_module(vo
|
||||
int __init nss_pvxlanmgr_init_module(void)
|
||||
{
|
||||
int ret;
|
||||
+#ifdef CONFIG_OF
|
||||
/*
|
||||
* If the node is not compatible, don't do anything.
|
||||
*/
|
||||
if (!of_find_node_by_name(NULL, "nss-common")) {
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
nss_pvxlanmgr_info("module %s loaded\n",
|
||||
NSS_CLIENT_BUILD_ID);
|
||||
--- a/pvxlanmgr/nss_pvxlanmgr_priv.h
|
||||
+++ b/pvxlanmgr/nss_pvxlanmgr_priv.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all copies.
|
||||
@@ -19,8 +19,10 @@
|
||||
* Pvxlan manager private defines
|
||||
*/
|
||||
#include <linux/types.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/skbuff.h>
|
||||
+#include <linux/version.h>
|
||||
#include <nss_api_if.h>
|
||||
#include <linux/in.h>
|
||||
#include <linux/etherdevice.h>
|
||||
25
qca-nss-clients/patches/0006-match-fix-compile-error.patch
Normal file
25
qca-nss-clients/patches/0006-match-fix-compile-error.patch
Normal file
@ -0,0 +1,25 @@
|
||||
--- a/match/nss_match_priv.h
|
||||
+++ b/match/nss_match_priv.h
|
||||
@@ -29,19 +29,19 @@
|
||||
/*
|
||||
* Statically compile messages at different levels
|
||||
*/
|
||||
-#if (NSS_match_DEBUG_LEVEL < 2)
|
||||
+#if (NSS_MATCH_DEBUG_LEVEL < 2)
|
||||
#define nss_match_warn(s, ...)
|
||||
#else
|
||||
#define nss_match_warn(s, ...) pr_warn("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
-#if (NSS_match_DEBUG_LEVEL < 3)
|
||||
+#if (NSS_MATCH_DEBUG_LEVEL < 3)
|
||||
#define nss_match_info(s, ...)
|
||||
#else
|
||||
#define nss_match_info(s, ...) pr_notice("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
-#if (NSS_match_DEBUG_LEVEL < 4)
|
||||
+#if (NSS_MATCH_DEBUG_LEVEL < 4)
|
||||
#define nss_match_trace(s, ...)
|
||||
#else
|
||||
#define nss_match_trace(s, ...) pr_info("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
29
qca-nss-clients/patches/0007-bridge-fix-compile-error.patch
Normal file
29
qca-nss-clients/patches/0007-bridge-fix-compile-error.patch
Normal file
@ -0,0 +1,29 @@
|
||||
--- a/bridge/nss_bridge_mgr.c
|
||||
+++ b/bridge/nss_bridge_mgr.c
|
||||
@@ -1098,8 +1098,10 @@ int nss_bridge_mgr_register_br(struct ne
|
||||
*/
|
||||
b_pvt->ifnum = ifnum;
|
||||
b_pvt->mtu = dev->mtu;
|
||||
+#if defined(NSS_BRIDGE_MGR_PPE_SUPPORT)
|
||||
b_pvt->wan_if_num = -1;
|
||||
b_pvt->wan_if_enabled = false;
|
||||
+#endif
|
||||
ether_addr_copy(b_pvt->dev_addr, dev->dev_addr);
|
||||
spin_lock(&br_mgr_ctx.lock);
|
||||
list_add(&b_pvt->list, &br_mgr_ctx.list);
|
||||
@@ -1165,6 +1167,7 @@ static int nss_bridge_mgr_bond_slave_cha
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
+#if defined(NSS_BRIDGE_MGR_PPE_SUPPORT)
|
||||
/*
|
||||
* Add or remove the slave based based on linking event
|
||||
*/
|
||||
@@ -1179,6 +1182,7 @@ static int nss_bridge_mgr_bond_slave_cha
|
||||
cu_info->upper_dev->name, master->name);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
@ -1,528 +0,0 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -5,8 +5,10 @@ ccflags-y := -I$(obj) -I$(obj)/..
|
||||
export BUILD_ID = \"Build Id: $(shell date +'%m/%d/%y, %H:%M:%S')\"
|
||||
ccflags-y += -DNSS_CLIENT_BUILD_ID="$(BUILD_ID)"
|
||||
|
||||
+qca-nss-tunipip6-objs := nss_connmgr_tunipip6.o
|
||||
qca-nss-tun6rd-objs := nss_connmgr_tun6rd.o
|
||||
|
||||
+ccflags-y += -DNSS_TUNIPIP6_DEBUG_LEVEL=0
|
||||
ccflags-y += -DNSS_TUN6RD_DEBUG_LEVEL=0
|
||||
ccflags-y += -Werror
|
||||
|
||||
@@ -21,7 +23,7 @@ obj-$(map-t)+= map/map-t/
|
||||
obj-$(portifmgr)+= portifmgr/
|
||||
obj-$(pptp)+= pptp/
|
||||
obj-$(profile)+= profiler/
|
||||
-obj-$(tunipip6)+= tunipip6/
|
||||
+obj-$(tunipip6)+= qca-nss-tunipip6.o
|
||||
obj-$(tun6rd)+= qca-nss-tun6rd.o
|
||||
obj-$(qdisc)+= nss_qdisc/
|
||||
obj-$(vlan-mgr)+= vlan/
|
||||
--- /dev/null
|
||||
+++ b/nss_connmgr_tunipip6.c
|
||||
@@ -0,0 +1,503 @@
|
||||
+/*
|
||||
+ **************************************************************************
|
||||
+ * Copyright (c) 2014, 2017-2018, The Linux Foundation. All rights reserved.
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for
|
||||
+ * any purpose with or without fee is hereby granted, provided that the
|
||||
+ * above copyright notice and this permission notice appear in all copies.
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ **************************************************************************
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6.c
|
||||
+ *
|
||||
+ * This file is the NSS DS-lit and IPP6 tunnel module
|
||||
+ * ------------------------REVISION HISTORY-----------------------------
|
||||
+ * Qualcomm Atheros 15/sep/2013 Created
|
||||
+ */
|
||||
+
|
||||
+#include <linux/version.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <linux/ip.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/tcp.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/skbuff.h>
|
||||
+#include <net/ipv6.h>
|
||||
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3,9,0))
|
||||
+#include <net/ipip.h>
|
||||
+#else
|
||||
+#include <net/ip_tunnels.h>
|
||||
+#endif
|
||||
+#include <net/ip6_tunnel.h>
|
||||
+#include <linux/if_arp.h>
|
||||
+#include <nss_api_if.h>
|
||||
+
|
||||
+/*
|
||||
+ * NSS tunipip6 debug macros
|
||||
+ */
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 1)
|
||||
+#define nss_tunipip6_assert(fmt, args...)
|
||||
+#else
|
||||
+#define nss_tunipip6_assert(c) if (!(c)) { BUG_ON(!(c)); }
|
||||
+#endif
|
||||
+
|
||||
+#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
+
|
||||
+/*
|
||||
+ * Compile messages for dynamic enable/disable
|
||||
+ */
|
||||
+#define nss_tunipip6_warning(s, ...) pr_debug("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_tunipip6_info(s, ...) pr_debug("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_tunipip6_trace(s, ...) pr_debug("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#else
|
||||
+
|
||||
+/*
|
||||
+ * Statically compile messages at different levels
|
||||
+ */
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 2)
|
||||
+#define nss_tunipip6_warning(s, ...)
|
||||
+#else
|
||||
+#define nss_tunipip6_warning(s, ...) pr_warn("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#endif
|
||||
+
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 3)
|
||||
+#define nss_tunipip6_info(s, ...)
|
||||
+#else
|
||||
+#define nss_tunipip6_info(s, ...) pr_notice("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#endif
|
||||
+
|
||||
+#if (NSS_TUNIPIP6_DEBUG_LEVEL < 4)
|
||||
+#define nss_tunipip6_trace(s, ...)
|
||||
+#else
|
||||
+#define nss_tunipip6_trace(s, ...) pr_info("%s[%d]:" s, __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * tunipip6 stats structure
|
||||
+ */
|
||||
+struct nss_tunipip6_stats {
|
||||
+ uint32_t rx_packets; /* Number of received packets */
|
||||
+ uint32_t rx_bytes; /* Number of received bytes */
|
||||
+ uint32_t tx_packets; /* Number of transmitted packets */
|
||||
+ uint32_t tx_bytes; /* Number of transmitted bytes */
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_encap_exception()
|
||||
+ * Exception handler registered to NSS driver.
|
||||
+ *
|
||||
+ * This function is called when no rule is found for successful encapsulation.
|
||||
+ */
|
||||
+static void nss_tunipip6_encap_exception(struct net_device *dev, struct sk_buff *skb, __attribute__((unused)) struct napi_struct *napi)
|
||||
+{
|
||||
+ skb->dev = dev;
|
||||
+ nss_tunipip6_info("received - %d bytes name %s ver %x\n",
|
||||
+ skb->len, dev->name, (skb->data[0] >> 4));
|
||||
+
|
||||
+ skb->protocol = htons(ETH_P_IP);
|
||||
+ skb_reset_network_header(skb);
|
||||
+ skb->pkt_type = PACKET_HOST;
|
||||
+ skb->skb_iif = dev->ifindex;
|
||||
+ skb->ip_summed = CHECKSUM_NONE;
|
||||
+ netif_receive_skb(skb);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_decap_exception()
|
||||
+ * Exception handler registered to NSS driver.
|
||||
+ *
|
||||
+ * This function is called when no rule is found for successful decapsulation.
|
||||
+ */
|
||||
+static void nss_tunipip6_decap_exception(struct net_device *dev, struct sk_buff *skb, __attribute__((unused)) struct napi_struct *napi)
|
||||
+{
|
||||
+ skb->dev = dev;
|
||||
+ nss_tunipip6_info("received - %d bytes name %s ver %x\n",
|
||||
+ skb->len, dev->name, (skb->data[0] >> 4));
|
||||
+
|
||||
+ skb->protocol = htons(ETH_P_IPV6);
|
||||
+ skb_reset_network_header(skb);
|
||||
+ skb->pkt_type = PACKET_HOST;
|
||||
+ skb->skb_iif = dev->ifindex;
|
||||
+ skb->ip_summed = CHECKSUM_NONE;
|
||||
+ netif_receive_skb(skb);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_update_dev_stats
|
||||
+ * Update the Dev stats received from NetAp
|
||||
+ */
|
||||
+static void nss_tunipip6_update_dev_stats(struct net_device *dev,
|
||||
+ struct nss_tunipip6_stats_sync_msg *sync_stats)
|
||||
+{
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
|
||||
+ struct pcpu_sw_netstats stats;
|
||||
+
|
||||
+ u64_stats_init(&stats.syncp);
|
||||
+ u64_stats_update_begin(&stats.syncp);
|
||||
+ stats.rx_packets = sync_stats->node_stats.rx_packets;
|
||||
+ stats.rx_bytes = sync_stats->node_stats.rx_bytes;
|
||||
+ stats.tx_packets = sync_stats->node_stats.tx_packets;
|
||||
+ stats.tx_bytes = sync_stats->node_stats.tx_bytes;
|
||||
+ u64_stats_update_end(&stats.syncp);
|
||||
+#else
|
||||
+ struct nss_tunipip6_stats stats;
|
||||
+
|
||||
+ stats.rx_packets = sync_stats->node_stats.rx_packets;
|
||||
+ stats.rx_bytes = sync_stats->node_stats.rx_bytes;
|
||||
+ stats.tx_packets = sync_stats->node_stats.tx_packets;
|
||||
+ stats.tx_bytes = sync_stats->node_stats.tx_bytes;
|
||||
+#endif
|
||||
+
|
||||
+ dev->stats.rx_dropped += nss_cmn_rx_dropped_sum(&sync_stats->node_stats);
|
||||
+ ip6_update_offload_stats(dev, (void *)&stats);
|
||||
+
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_event_receive()
|
||||
+ * Event Callback to receive events from NSS.
|
||||
+ */
|
||||
+void nss_tunipip6_event_receive(void *if_ctx, struct nss_tunipip6_msg *tnlmsg)
|
||||
+{
|
||||
+ struct net_device *netdev = NULL;
|
||||
+ netdev = (struct net_device *)if_ctx;
|
||||
+
|
||||
+ switch (tnlmsg->cm.type) {
|
||||
+ case NSS_TUNIPIP6_RX_STATS_SYNC:
|
||||
+ nss_tunipip6_update_dev_stats(netdev, (struct nss_tunipip6_stats_sync_msg *)&tnlmsg->msg.stats_sync);
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ nss_tunipip6_info("%s: Unknown Event from NSS", __func__);
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_dev_up()
|
||||
+ * IPIP6 Tunnel device i/f up handler
|
||||
+ */
|
||||
+int nss_tunipip6_dev_up(struct net_device *netdev)
|
||||
+{
|
||||
+ struct ip6_tnl *tunnel;
|
||||
+ struct nss_tunipip6_msg tnlmsg;
|
||||
+ struct nss_tunipip6_create_msg *tnlcfg;
|
||||
+ struct flowi6 *fl6;
|
||||
+ uint32_t fmr_number = 0;
|
||||
+ int inner_ifnum, outer_ifnum;
|
||||
+ uint32_t features = 0;
|
||||
+ nss_tx_status_t status;
|
||||
+ struct nss_ctx_instance *nss_ctx;
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
+ struct __ip6_tnl_fmr *fmr;
|
||||
+#endif
|
||||
+
|
||||
+ /*
|
||||
+ * Validate netdev for ipv6-in-ipv4 Tunnel
|
||||
+ */
|
||||
+ if (netdev->type != ARPHRD_TUNNEL6 ) {
|
||||
+ return NOTIFY_DONE;
|
||||
+ }
|
||||
+
|
||||
+ tunnel = (struct ip6_tnl *)netdev_priv(netdev);
|
||||
+
|
||||
+ /*
|
||||
+ * Find the Tunnel device flow information
|
||||
+ */
|
||||
+ fl6 = &tunnel->fl.u.ip6;
|
||||
+
|
||||
+ nss_tunipip6_trace("%p: Tunnel Param srcaddr %x:%x:%x:%x daddr %x:%x:%x:%x\n", netdev,
|
||||
+ fl6->saddr.s6_addr32[0], fl6->saddr.s6_addr32[1],
|
||||
+ fl6->saddr.s6_addr32[2], fl6->saddr.s6_addr32[3],
|
||||
+ fl6->daddr.s6_addr32[0], fl6->daddr.s6_addr32[1],
|
||||
+ fl6->daddr.s6_addr32[2], fl6->daddr.s6_addr32[3] );
|
||||
+ nss_tunipip6_trace("%p: Hop limit %d\n", netdev, tunnel->parms.hop_limit);
|
||||
+ nss_tunipip6_trace("%p: Tunnel param flag %x fl6.flowlabel %x\n", netdev, tunnel->parms.flags, fl6->flowlabel);
|
||||
+
|
||||
+ inner_ifnum = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER);
|
||||
+ if (inner_ifnum < 0) {
|
||||
+ nss_tunipip6_warning("%p: Request interface number failed\n", netdev);
|
||||
+ goto inner_alloc_fail;
|
||||
+ }
|
||||
+
|
||||
+ outer_ifnum = nss_dynamic_interface_alloc_node(NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER);
|
||||
+ if (outer_ifnum < 0) {
|
||||
+ nss_tunipip6_warning("%p: Request interface number failed\n", netdev);
|
||||
+ goto outer_alloc_fail;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Register ipip6 tunnel with NSS
|
||||
+ */
|
||||
+ nss_ctx = nss_register_tunipip6_if(inner_ifnum,
|
||||
+ NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER,
|
||||
+ nss_tunipip6_encap_exception,
|
||||
+ nss_tunipip6_event_receive,
|
||||
+ netdev,
|
||||
+ features);
|
||||
+ if (!nss_ctx) {
|
||||
+ nss_tunipip6_warning("%p: nss_register_tunipip6_if Failed\n", netdev);
|
||||
+ goto inner_reg_fail;
|
||||
+ }
|
||||
+
|
||||
+ nss_ctx = nss_register_tunipip6_if(outer_ifnum,
|
||||
+ NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER,
|
||||
+ nss_tunipip6_decap_exception,
|
||||
+ nss_tunipip6_event_receive,
|
||||
+ netdev,
|
||||
+ features);
|
||||
+ if (!nss_ctx) {
|
||||
+ nss_tunipip6_warning("%p: nss_register_tunipip6_if Failed\n", netdev);
|
||||
+ goto outer_reg_fail;
|
||||
+ }
|
||||
+
|
||||
+ nss_tunipip6_trace("%p: nss_register_tunipip6_if Success\n", netdev);
|
||||
+
|
||||
+ /*
|
||||
+ * Prepare The Tunnel configuration parameter to send to nss
|
||||
+ */
|
||||
+ memset(&tnlmsg, 0, sizeof(struct nss_tunipip6_msg));
|
||||
+ tnlcfg = &tnlmsg.msg.tunipip6_create;
|
||||
+
|
||||
+ tnlcfg->saddr[0] = ntohl(fl6->saddr.s6_addr32[0]);
|
||||
+ tnlcfg->saddr[1] = ntohl(fl6->saddr.s6_addr32[1]);
|
||||
+ tnlcfg->saddr[2] = ntohl(fl6->saddr.s6_addr32[2]);
|
||||
+ tnlcfg->saddr[3] = ntohl(fl6->saddr.s6_addr32[3]);
|
||||
+ tnlcfg->daddr[0] = ntohl(fl6->daddr.s6_addr32[0]);
|
||||
+ tnlcfg->daddr[1] = ntohl(fl6->daddr.s6_addr32[1]);
|
||||
+ tnlcfg->daddr[2] = ntohl(fl6->daddr.s6_addr32[2]);
|
||||
+ tnlcfg->daddr[3] = ntohl(fl6->daddr.s6_addr32[3]);
|
||||
+ tnlcfg->hop_limit = tunnel->parms.hop_limit;
|
||||
+ tnlcfg->flags = ntohl(tunnel->parms.flags);
|
||||
+
|
||||
+ /*
|
||||
+ * Flow Label In kernel is stored in big endian format.
|
||||
+ */
|
||||
+ tnlcfg->flowlabel = fl6->flowlabel;
|
||||
+ tnlcfg->draft03 = tunnel->parms.draft03;
|
||||
+
|
||||
+ /*
|
||||
+ * Configure FMR table up to MAX_FMR_NUMBER, the rest will be forwarded to BR
|
||||
+ */
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
+ for (fmr = tunnel->parms.fmrs; fmr && fmr_number < NSS_TUNIPIP6_MAX_FMR_NUMBER; fmr = fmr->next, fmr_number++) {
|
||||
+ tnlcfg->fmr[fmr_number].ip6_prefix[0] = ntohl(fmr->ip6_prefix.s6_addr32[0]);
|
||||
+ tnlcfg->fmr[fmr_number].ip6_prefix[1] = ntohl(fmr->ip6_prefix.s6_addr32[1]);
|
||||
+ tnlcfg->fmr[fmr_number].ip6_prefix[2] = ntohl(fmr->ip6_prefix.s6_addr32[2]);
|
||||
+ tnlcfg->fmr[fmr_number].ip6_prefix[3] = ntohl(fmr->ip6_prefix.s6_addr32[3]);
|
||||
+ tnlcfg->fmr[fmr_number].ip4_prefix = ntohl(fmr->ip4_prefix.s_addr);
|
||||
+ tnlcfg->fmr[fmr_number].ip6_prefix_len = fmr->ip6_prefix_len;
|
||||
+ tnlcfg->fmr[fmr_number].ip4_prefix_len = fmr->ip4_prefix_len;
|
||||
+ tnlcfg->fmr[fmr_number].ea_len = fmr->ea_len;
|
||||
+ tnlcfg->fmr[fmr_number].offset = fmr->offset;
|
||||
+ }
|
||||
+#endif
|
||||
+ tnlcfg->fmr_number = fmr_number;
|
||||
+
|
||||
+ /*
|
||||
+ * Updating sibling_if_num for encap interface.
|
||||
+ */
|
||||
+ tnlcfg->sibling_if_num = outer_ifnum;
|
||||
+
|
||||
+ nss_tunipip6_trace("%p: Tunnel Param srcaddr %x:%x:%x:%x daddr %x:%x:%x:%x\n", netdev,
|
||||
+ tnlcfg->saddr[0], tnlcfg->saddr[1],
|
||||
+ tnlcfg->saddr[2], tnlcfg->saddr[3],
|
||||
+ tnlcfg->daddr[0], tnlcfg->daddr[1],
|
||||
+ tnlcfg->daddr[2], tnlcfg->daddr[3] );
|
||||
+
|
||||
+ /*
|
||||
+ * Send configure message to encap interface.
|
||||
+ */
|
||||
+ nss_tunipip6_msg_init(&tnlmsg, inner_ifnum, NSS_TUNIPIP6_TX_ENCAP_IF_CREATE,
|
||||
+ sizeof(struct nss_tunipip6_create_msg), NULL, NULL);
|
||||
+
|
||||
+ nss_tunipip6_trace("%p: Sending IPIP6 tunnel i/f up command to NSS %p\n", netdev, nss_ctx);
|
||||
+ status = nss_tunipip6_tx(nss_ctx, &tnlmsg);
|
||||
+ if (status != NSS_TX_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%p: Tunnel up command error %d\n", netdev, status);
|
||||
+ goto config_fail;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Updating sibling_if_num for decap interface.
|
||||
+ */
|
||||
+ tnlcfg->sibling_if_num = inner_ifnum;
|
||||
+
|
||||
+ /*
|
||||
+ * Send configure message to decap interface.
|
||||
+ */
|
||||
+ nss_tunipip6_msg_init(&tnlmsg, outer_ifnum, NSS_TUNIPIP6_TX_DECAP_IF_CREATE,
|
||||
+ sizeof(struct nss_tunipip6_create_msg), NULL, NULL);
|
||||
+
|
||||
+ nss_tunipip6_trace("%p: Sending IPIP6 tunnel i/f up command to NSS %p\n", netdev, nss_ctx);
|
||||
+ status = nss_tunipip6_tx(nss_ctx, &tnlmsg);
|
||||
+ if (status != NSS_TX_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%p: Tunnel up command error %d\n", netdev, status);
|
||||
+ goto config_fail;
|
||||
+ }
|
||||
+ return NOTIFY_DONE;
|
||||
+
|
||||
+config_fail:
|
||||
+ nss_unregister_tunipip6_if(outer_ifnum);
|
||||
+outer_reg_fail:
|
||||
+ nss_unregister_tunipip6_if(inner_ifnum);
|
||||
+inner_reg_fail:
|
||||
+ status = nss_dynamic_interface_dealloc_node(outer_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER);
|
||||
+ if (status != NSS_TX_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%p: Unable to dealloc the node[%d] in the NSS fw!\n", netdev, outer_ifnum);
|
||||
+ }
|
||||
+outer_alloc_fail:
|
||||
+ status = nss_dynamic_interface_dealloc_node(inner_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER);
|
||||
+ if (status != NSS_TX_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%p: Unable to dealloc the node[%d] in the NSS fw!\n", netdev, inner_ifnum);
|
||||
+ }
|
||||
+inner_alloc_fail:
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_dev_down()
|
||||
+ * IPP6 Tunnel device i/f down handler
|
||||
+ */
|
||||
+int nss_tunipip6_dev_down(struct net_device *netdev)
|
||||
+{
|
||||
+ int inner_ifnum, outer_ifnum;
|
||||
+ nss_tx_status_t status;
|
||||
+
|
||||
+ /*
|
||||
+ * Validate netdev for ipv6-in-ipv4 Tunnel
|
||||
+ */
|
||||
+ if (netdev->type != ARPHRD_TUNNEL6) {
|
||||
+ return NOTIFY_DONE;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Check if tunnel ipip6 is registered ?
|
||||
+ */
|
||||
+ inner_ifnum = nss_cmn_get_interface_number_by_dev_and_type(netdev, NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER);
|
||||
+ if (inner_ifnum < 0) {
|
||||
+ nss_tunipip6_warning("%p: Net device is not registered with nss\n", netdev);
|
||||
+ return NOTIFY_DONE;
|
||||
+ }
|
||||
+
|
||||
+ outer_ifnum = nss_cmn_get_interface_number_by_dev_and_type(netdev, NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER);
|
||||
+ if (outer_ifnum < 0) {
|
||||
+ nss_tunipip6_warning("%p: Net device is not registered with nss\n", netdev);
|
||||
+ return NOTIFY_DONE;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Un-Register IPIP6 tunnel with NSS
|
||||
+ */
|
||||
+ nss_unregister_tunipip6_if(inner_ifnum);
|
||||
+ nss_unregister_tunipip6_if(outer_ifnum);
|
||||
+
|
||||
+ status = nss_dynamic_interface_dealloc_node(inner_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_INNER);
|
||||
+ if (status != NSS_TX_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%p: Dealloc node failure\n", netdev);
|
||||
+ return NOTIFY_DONE;
|
||||
+ }
|
||||
+
|
||||
+ status = nss_dynamic_interface_dealloc_node(outer_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_TUNIPIP6_OUTER);
|
||||
+ if (status != NSS_TX_SUCCESS) {
|
||||
+ nss_tunipip6_warning("%p: Dealloc node failure\n", netdev);
|
||||
+ return NOTIFY_DONE;
|
||||
+ }
|
||||
+
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_dev_event()
|
||||
+ * Net device notifier for ipip6 module
|
||||
+ */
|
||||
+static int nss_tunipip6_dev_event(struct notifier_block *nb,
|
||||
+ unsigned long event, void *dev)
|
||||
+{
|
||||
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3, 10, 0))
|
||||
+ struct net_device *netdev = (struct net_device *)dev;
|
||||
+#else
|
||||
+ struct net_device *netdev = netdev_notifier_info_to_dev(dev);
|
||||
+#endif
|
||||
+
|
||||
+ switch (event) {
|
||||
+ case NETDEV_UP:
|
||||
+ nss_tunipip6_trace("%p: NETDEV_UP :event %lu name %s\n", netdev, event, netdev->name);
|
||||
+ return nss_tunipip6_dev_up(netdev);
|
||||
+
|
||||
+ case NETDEV_DOWN:
|
||||
+ nss_tunipip6_trace("%p: NETDEV_DOWN :event %lu name %s\n", netdev, event, netdev->name);
|
||||
+ return nss_tunipip6_dev_down(netdev);
|
||||
+
|
||||
+ default:
|
||||
+ nss_tunipip6_trace("%p: Unhandled notifier dev %s event %x\n", netdev, netdev->name, (int)event);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return NOTIFY_DONE;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Linux Net device Notifier
|
||||
+ */
|
||||
+struct notifier_block nss_tunipip6_notifier = {
|
||||
+ .notifier_call = nss_tunipip6_dev_event,
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_init_module()
|
||||
+ * Tunnel ipip6 module init function
|
||||
+ */
|
||||
+int __init nss_tunipip6_init_module(void)
|
||||
+{
|
||||
+#ifdef CONFIG_OF
|
||||
+ /*
|
||||
+ * If the node is not compatible, don't do anything.
|
||||
+ */
|
||||
+ if (!of_find_node_by_name(NULL, "nss-common")) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+#endif
|
||||
+ nss_tunipip6_info("module (platform - IPQ806x , %s) loaded\n",
|
||||
+ NSS_CLIENT_BUILD_ID);
|
||||
+
|
||||
+ register_netdevice_notifier(&nss_tunipip6_notifier);
|
||||
+ nss_tunipip6_trace("Netdev Notifier registerd\n");
|
||||
+
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_tunipip6_exit_module()
|
||||
+ * Tunnel ipip6 module exit function
|
||||
+ */
|
||||
+void __exit nss_tunipip6_exit_module(void)
|
||||
+{
|
||||
+#ifdef CONFIG_OF
|
||||
+
|
||||
+ /*
|
||||
+ * If the node is not compatible, don't do anything.
|
||||
+ */
|
||||
+ if (!of_find_node_by_name(NULL, "nss-common")) {
|
||||
+ return;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ unregister_netdevice_notifier(&nss_tunipip6_notifier);
|
||||
+ nss_tunipip6_info("module unloaded\n");
|
||||
+}
|
||||
+
|
||||
+module_init(nss_tunipip6_init_module);
|
||||
+module_exit(nss_tunipip6_exit_module);
|
||||
+
|
||||
+MODULE_LICENSE("Dual BSD/GPL");
|
||||
+MODULE_DESCRIPTION("NSS tunipip6 offload manager");
|
||||
@ -0,0 +1,61 @@
|
||||
--- a/profiler/profile.c
|
||||
+++ b/profiler/profile.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/page-flags.h>
|
||||
#include <linux/sched.h>
|
||||
+#include <linux/version.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/thread_info.h>
|
||||
@@ -937,12 +938,26 @@ static ssize_t debug_if(struct file *fil
|
||||
return count;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
|
||||
+#define HAVE_PROC_OPS
|
||||
+#endif
|
||||
+
|
||||
+#ifdef HAVE_PROC_OPS
|
||||
+static const struct proc_ops profile_fops = {
|
||||
+ .proc_open = profile_open,
|
||||
+ .proc_read = profile_read,
|
||||
+ .proc_lseek = seq_lseek,
|
||||
+ .proc_release = profile_release,
|
||||
+ .proc_write = debug_if,
|
||||
+};
|
||||
+#else
|
||||
static const struct file_operations profile_fops = {
|
||||
.open = profile_open,
|
||||
.read = profile_read,
|
||||
.release = profile_release,
|
||||
.write = debug_if,
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* showing sample status on Linux console
|
||||
@@ -971,6 +986,15 @@ static ssize_t profile_rate_write(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef HAVE_PROC_OPS
|
||||
+static const struct proc_ops profile_rate_fops = {
|
||||
+ .proc_open = profile_rate_open,
|
||||
+ .proc_read = seq_read,
|
||||
+ .proc_lseek = seq_lseek,
|
||||
+ .proc_release = single_release,
|
||||
+ .proc_write = profile_rate_write,
|
||||
+};
|
||||
+#else
|
||||
static const struct file_operations profile_rate_fops = {
|
||||
.open = profile_rate_open,
|
||||
.read = seq_read,
|
||||
@@ -978,6 +1002,7 @@ static const struct file_operations prof
|
||||
.release = single_release,
|
||||
.write = profile_rate_write,
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* hexdump
|
||||
17
qca-nss-clients/patches/0009-gre-fix-compile-error.patch
Normal file
17
qca-nss-clients/patches/0009-gre-fix-compile-error.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- a/gre/nss_connmgr_gre_v4.c
|
||||
+++ b/gre/nss_connmgr_gre_v4.c
|
||||
@@ -172,14 +172,6 @@ int nss_connmgr_gre_v4_set_config(struct
|
||||
}
|
||||
}
|
||||
|
||||
- /*
|
||||
- * IP address validate
|
||||
- */
|
||||
- if ((cfg->src_ip == 0) || (cfg->dest_ip == 0)) {
|
||||
- nss_connmgr_gre_warning("Source ip/Destination IP is invalid");
|
||||
- return GRE_ERR_INVALID_IP;
|
||||
- }
|
||||
-
|
||||
memset(t, 0, sizeof(struct ip_tunnel));
|
||||
|
||||
priv->pad_len = (cfg->add_padding) ? GRE_HDR_PAD_LEN : 0;
|
||||
35
qca-nss-clients/patches/0010-fix-portifmgr.patch
Normal file
35
qca-nss-clients/patches/0010-fix-portifmgr.patch
Normal file
@ -0,0 +1,35 @@
|
||||
--- a/portifmgr/nss_portifmgr.c
|
||||
+++ b/portifmgr/nss_portifmgr.c
|
||||
@@ -187,16 +187,20 @@ drop:
|
||||
}
|
||||
|
||||
/*
|
||||
- * nss_portifmgr_get_stats()
|
||||
+ * nss_portifmgr_get_stats64()
|
||||
* Netdev get stats function to get port stats
|
||||
*/
|
||||
-static struct rtnl_link_stats64 *nss_portifmgr_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
|
||||
+/*
|
||||
+ * nss_nlgre_redir_cmn_dev_stats64
|
||||
+ * Report packet statistics to linux
|
||||
+ */
|
||||
+static void nss_portifmgr_get_stats64(struct net_device *dev,
|
||||
+ struct rtnl_link_stats64 *stats)
|
||||
{
|
||||
struct nss_portifmgr_priv *priv = (struct nss_portifmgr_priv *)netdev_priv(dev);
|
||||
BUG_ON(priv == NULL);
|
||||
|
||||
nss_portid_get_stats(priv->if_num, stats);
|
||||
- return stats;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -225,7 +229,7 @@ static const struct net_device_ops nss_p
|
||||
.ndo_start_xmit = nss_portifmgr_start_xmit,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
.ndo_change_mtu = nss_portifmgr_change_mtu,
|
||||
- .ndo_get_stats64 = nss_portifmgr_get_stats,
|
||||
+ .ndo_get_stats64 = nss_portifmgr_get_stats64,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -0,0 +1,48 @@
|
||||
--- a/dtls/v2.0/nss_dtlsmgr.c
|
||||
+++ b/dtls/v2.0/nss_dtlsmgr.c
|
||||
@@ -38,7 +38,13 @@
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/authenc.h>
|
||||
#include <crypto/des.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/skcipher.h>
|
||||
#include <crypto/hash.h>
|
||||
|
||||
--- a/dtls/v2.0/nss_dtlsmgr_ctx.c
|
||||
+++ b/dtls/v2.0/nss_dtlsmgr_ctx.c
|
||||
@@ -40,7 +40,13 @@
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/authenc.h>
|
||||
#include <crypto/des.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/skcipher.h>
|
||||
#include <crypto/hash.h>
|
||||
|
||||
--- a/dtls/v2.0/nss_dtlsmgr_ctx_dev.c
|
||||
+++ b/dtls/v2.0/nss_dtlsmgr_ctx_dev.c
|
||||
@@ -36,7 +36,13 @@
|
||||
#include <net/protocol.h>
|
||||
#include <net/route.h>
|
||||
#include <crypto/aes.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
|
||||
#include <nss_api_if.h>
|
||||
#include <nss_dynamic_interface.h>
|
||||
@ -0,0 +1,36 @@
|
||||
--- a/dtls/v2.0/nss_dtlsmgr_private.h
|
||||
+++ b/dtls/v2.0/nss_dtlsmgr_private.h
|
||||
@@ -36,9 +36,9 @@
|
||||
/*
|
||||
* Compile messages for dynamic enable/disable
|
||||
*/
|
||||
-#define nss_dtlsmgr_warn(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#define nss_dtlsmgr_info(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#define nss_dtlsmgr_trace(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_dtlsmgr_warn(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__);
|
||||
+#define nss_dtlsmgr_info(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__);
|
||||
+#define nss_dtlsmgr_trace(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__);
|
||||
#else
|
||||
|
||||
/*
|
||||
@@ -46,17 +46,17 @@
|
||||
*/
|
||||
#define nss_dtlsmgr_warn(s, ...) { \
|
||||
if (NSS_DTLSMGR_DEBUG_LEVEL > NSS_DTLSMGR_DEBUG_LEVEL_ERROR) \
|
||||
- pr_warn("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__) \
|
||||
+ pr_warn("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define nss_dtlsmgr_info(s, ...) { \
|
||||
if (NSS_DTLSMGR_DEBUG_LEVEL > NSS_DTLSMGR_DEBUG_LEVEL_WARN) \
|
||||
- pr_notice("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__) \
|
||||
+ pr_notice("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define nss_dtlsmgr_trace(s, ...) { \
|
||||
if (NSS_DTLSMGR_DEBUG_LEVEL > NSS_DTLSMGR_DEBUG_LEVEL_INFO) \
|
||||
- pr_info("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__) \
|
||||
+ pr_info("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DYNAMIC_DEBUG */
|
||||
@ -0,0 +1,32 @@
|
||||
--- a/tls/nss_tlsmgr_crypto.c
|
||||
+++ b/tls/nss_tlsmgr_crypto.c
|
||||
@@ -41,7 +41,13 @@
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/authenc.h>
|
||||
#include <crypto/des.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/skcipher.h>
|
||||
#include <crypto/hash.h>
|
||||
#include <crypto/internal/hash.h>
|
||||
--- a/tls/nss_tlsmgr_tun.c
|
||||
+++ b/tls/nss_tlsmgr_tun.c
|
||||
@@ -35,7 +35,13 @@
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/tlshdr.h>
|
||||
#include <crypto/aes.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
|
||||
#include <nss_api_if.h>
|
||||
#include <nss_dynamic_interface.h>
|
||||
@ -0,0 +1,32 @@
|
||||
--- a/openvpn/src/nss_ovpnmgr_crypto.c
|
||||
+++ b/openvpn/src/nss_ovpnmgr_crypto.c
|
||||
@@ -28,7 +28,13 @@
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/authenc.h>
|
||||
#include <crypto/des.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
|
||||
#include <nss_api_if.h>
|
||||
--- a/openvpn/src/nss_ovpnmgr_route.c
|
||||
+++ b/openvpn/src/nss_ovpnmgr_route.c
|
||||
@@ -34,7 +34,13 @@
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/authenc.h>
|
||||
#include <crypto/des.h>
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
#include <crypto/sha.h>
|
||||
+#else
|
||||
+#include <crypto/sha1.h>
|
||||
+#include <crypto/sha2.h>
|
||||
+#endif
|
||||
#include <crypto/hash.h>
|
||||
|
||||
#include <nss_api_if.h>
|
||||
@ -0,0 +1,11 @@
|
||||
--- a/tunipip6/nss_connmgr_tunipip6.c
|
||||
+++ b/tunipip6/nss_connmgr_tunipip6.c
|
||||
@@ -258,7 +258,7 @@ static void nss_tunipip6_decap_exception
|
||||
struct iphdr *iph;
|
||||
struct rtable *rt;
|
||||
int cpu;
|
||||
- int8_t ver = skb->data[0] >> 4;
|
||||
+ __attribute__((unused)) int8_t ver = skb->data[0] >> 4;
|
||||
|
||||
nss_tunipip6_trace("%px: received - %d bytes name %s ver %x\n",
|
||||
dev, skb->len, dev->name, ver);
|
||||
@ -0,0 +1,11 @@
|
||||
--- a/vxlanmgr/nss_vxlanmgr.c
|
||||
+++ b/vxlanmgr/nss_vxlanmgr.c
|
||||
@@ -84,7 +84,7 @@ int32_t nss_vxlanmgr_bind_ipsec_by_ip(un
|
||||
{
|
||||
int32_t ipsec_if_num;
|
||||
nss_vxlanmgr_get_ipsec_if_num_by_ip_callback_t ipsec_cb;
|
||||
- struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx();
|
||||
+ __attribute__((unused)) struct nss_ctx_instance *nss_ctx = nss_vxlan_get_ctx();
|
||||
|
||||
/*
|
||||
* Check if the VxLAN interface is applied over an IPsec interface by querying the IPsec.
|
||||
@ -0,0 +1,34 @@
|
||||
--- a/tls/nss_tlsmgr_priv.h
|
||||
+++ b/tls/nss_tlsmgr_priv.h
|
||||
@@ -28,7 +28,7 @@
|
||||
#define NSS_TLSMGR_DEBUG_LEVEL_INFO 3
|
||||
#define NSS_TLSMGR_DEBUG_LEVEL_TRACE 4
|
||||
|
||||
-#define nss_tlsmgr_info_always(s, ...) pr_info("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_tlsmgr_info_always(s, ...) pr_info("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__);
|
||||
|
||||
#define nss_tlsmgr_error(s, ...) do { \
|
||||
if (net_ratelimit()) { \
|
||||
@@ -43,18 +43,18 @@
|
||||
} while (0)
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
-#define nss_tlsmgr_info(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__)
|
||||
-#define nss_tlsmgr_trace(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__)
|
||||
+#define nss_tlsmgr_info(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__);
|
||||
+#define nss_tlsmgr_trace(s, ...) pr_debug("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__);
|
||||
#else
|
||||
|
||||
#define nss_tlsmgr_info(s, ...) { \
|
||||
if (NSS_TLSMGR_DEBUG_LEVEL > NSS_TLSMGR_DEBUG_LEVEL_WARN) \
|
||||
- pr_notice("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__) \
|
||||
+ pr_notice("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#define nss_tlsmgr_trace(s, ...) { \
|
||||
if (NSS_TLSMGR_DEBUG_LEVEL > NSS_TLSMGR_DEBUG_LEVEL_INFO) \
|
||||
- pr_info("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__) \
|
||||
+ pr_info("%s[%d]:" s "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DYNAMIC_DEBUG */
|
||||
@ -0,0 +1,240 @@
|
||||
diff --git a/wifi_meshmgr/nss_wifi_meshmgr.c b/wifi_meshmgr/nss_wifi_meshmgr.c
|
||||
index 498ed35..c8002c8 100644
|
||||
--- a/wifi_meshmgr/nss_wifi_meshmgr.c
|
||||
+++ b/wifi_meshmgr/nss_wifi_meshmgr.c
|
||||
@@ -49,7 +49,7 @@ static bool nss_wifi_meshmgr_verify_if_num(int32_t if_num, enum nss_dynamic_inte
|
||||
*/
|
||||
static nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_msg(struct nss_wifi_mesh_msg *msg)
|
||||
{
|
||||
- return nss_wifi_mesh_tx_msg(wmgr_ctx.nss_ctx, msg);
|
||||
+ return (nss_wifi_meshmgr_status_t)nss_wifi_mesh_tx_msg(wmgr_ctx.nss_ctx, msg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -126,7 +126,7 @@ static void nss_wifi_meshmgr_cleanup(struct nss_wifi_meshmgr_mesh_ctx *wmesh_ctx
|
||||
* Unregister and dealloc decap DI.
|
||||
*/
|
||||
nss_unregister_wifi_mesh_if(decap_ifnum);
|
||||
- nss_status = nss_dynamic_interface_dealloc_node(decap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER);
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)nss_dynamic_interface_dealloc_node(decap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER);
|
||||
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
|
||||
nss_wifi_meshmgr_warn("%px: Failed to dealloc decap: %d\n", &wmgr_ctx, nss_status);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ static void nss_wifi_meshmgr_cleanup(struct nss_wifi_meshmgr_mesh_ctx *wmesh_ctx
|
||||
* Unregister and dealloc encap DI.
|
||||
*/
|
||||
nss_unregister_wifi_mesh_if(encap_ifnum);
|
||||
- nss_status = nss_dynamic_interface_dealloc_node(encap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER);
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)nss_dynamic_interface_dealloc_node(encap_ifnum, NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER);
|
||||
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
|
||||
nss_wifi_meshmgr_warn("%px: Failed to dealloc encap: %d\n", &wmgr_ctx, nss_status);
|
||||
}
|
||||
@@ -257,10 +257,10 @@ static void nss_wifi_meshmgr_tx_msg_cb(void *app_data, struct nss_cmn_msg *ncm)
|
||||
/*
|
||||
* FIXME: The wmesh_ctx can be invalid if the memory goes away with the caller being timedout.
|
||||
*/
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_SUCCESS;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_SUCCESS;
|
||||
if (ncm->response != NSS_CMN_RESPONSE_ACK) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi-Mesh error response %d error_code: %u\n", &wmgr_ctx, ncm->response, error_code);
|
||||
- wmesh_ctx->response = nss_wifi_meshmgr_remap_error(error_code);
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)nss_wifi_meshmgr_remap_error(error_code);
|
||||
}
|
||||
|
||||
complete(&wmesh_ctx->complete);
|
||||
@@ -289,10 +289,10 @@ static nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_msg_sync(struct nss_wifi_me
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- status = wmesh_ctx->response;
|
||||
+ status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
return status;
|
||||
}
|
||||
@@ -324,7 +324,7 @@ nss_wifi_meshmgr_status_t nss_wifi_meshmgr_tx_buf(nss_wifi_mesh_handle_t mesh_ha
|
||||
return NSS_WIFI_MESHMGR_FAILURE;
|
||||
}
|
||||
|
||||
- nss_status = nss_wifi_mesh_tx_buf(wmgr_ctx.nss_ctx, os_buf, encap_ifnum);
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)nss_wifi_mesh_tx_buf(wmgr_ctx.nss_ctx, os_buf, encap_ifnum);
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
return nss_status;
|
||||
}
|
||||
@@ -548,10 +548,10 @@ nss_wifi_meshmgr_dump_mesh_path_sync(nss_wifi_mesh_handle_t mesh_handle)
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -643,10 +643,10 @@ nss_wifi_meshmgr_dump_mesh_proxy_path_sync(nss_wifi_mesh_handle_t mesh_handle)
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -715,7 +715,7 @@ nss_wifi_meshmgr_assoc_link_vap(nss_wifi_mesh_handle_t mesh_handle, struct nss_w
|
||||
/*
|
||||
* Send the link vap mesage to the NSS synchronously.
|
||||
*/
|
||||
- nss_status = nss_wifi_vdev_tx_msg(wmgr_ctx.nss_ctx, wifivdevmsg);
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)nss_wifi_vdev_tx_msg(wmgr_ctx.nss_ctx, wifivdevmsg);
|
||||
if (nss_status != NSS_WIFI_MESHMGR_SUCCESS) {
|
||||
nss_wifi_meshmgr_warn("%px: Mesh link vap association failed: %d.\n", &wmgr_ctx, nss_status);
|
||||
}
|
||||
@@ -761,10 +761,10 @@ nss_wifi_meshmgr_assoc_link_vap_sync(nss_wifi_mesh_handle_t mesh_handle, struct
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -886,10 +886,10 @@ nss_wifi_meshmgr_mesh_config_update_sync(nss_wifi_mesh_handle_t mesh_handle, str
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -985,10 +985,10 @@ nss_wifi_meshmgr_mesh_proxy_path_delete_sync(nss_wifi_mesh_handle_t mesh_handle,
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1084,10 +1084,10 @@ nss_wifi_meshmgr_mesh_proxy_path_update_sync(nss_wifi_mesh_handle_t mesh_handle,
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1183,10 +1183,10 @@ nss_wifi_meshmgr_mesh_proxy_path_add_sync(nss_wifi_mesh_handle_t mesh_handle, st
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1282,10 +1282,10 @@ nss_wifi_meshmgr_mesh_path_delete_sync(nss_wifi_mesh_handle_t mesh_handle, struc
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1381,10 +1381,10 @@ nss_wifi_meshmgr_mesh_path_add_sync(nss_wifi_mesh_handle_t mesh_handle, struct n
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
return nss_status;
|
||||
@@ -1479,10 +1479,10 @@ nss_wifi_meshmgr_mesh_path_update_sync(nss_wifi_mesh_handle_t mesh_handle, struc
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1578,10 +1578,10 @@ nss_wifi_meshmgr_mesh_path_exception_sync(nss_wifi_mesh_handle_t mesh_handle,str
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1702,10 +1702,10 @@ nss_wifi_meshmgr_config_mesh_exception_sync(nss_wifi_mesh_handle_t mesh_handle,s
|
||||
ret = wait_for_completion_timeout(&wmesh_ctx->complete, msecs_to_jiffies(NSS_WIFI_MESH_TX_TIMEOUT));
|
||||
if (!ret) {
|
||||
nss_wifi_meshmgr_warn("%px: WiFi mesh msg tx failed due to timeout\n", &wmgr_ctx);
|
||||
- wmesh_ctx->response = NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
+ wmesh_ctx->response = (nss_tx_status_t)NSS_WIFI_MESHMGR_FAILURE_SYNC_TIMEOUT;
|
||||
}
|
||||
|
||||
- nss_status = wmesh_ctx->response;
|
||||
+ nss_status = (nss_wifi_meshmgr_status_t)wmesh_ctx->response;
|
||||
up(&wmesh_ctx->sem);
|
||||
|
||||
nss_wifi_meshmgr_ref_dec(wmesh_ctx);
|
||||
@@ -1795,7 +1795,7 @@ nss_wifi_mesh_handle_t nss_wifi_meshmgr_if_create_sync(struct net_device *dev, s
|
||||
int32_t encap_ifnum, decap_ifnum;
|
||||
uint32_t features = 0;
|
||||
nss_wifi_mesh_handle_t mesh_handle;
|
||||
- nss_wifi_meshmgr_status_t nss_status;
|
||||
+ nss_wifi_meshmgr_status_t nss_status = NSS_WIFI_MESHMGR_SUCCESS;
|
||||
struct nss_wifi_meshmgr_mesh_ctx *wmesh_ctx;
|
||||
|
||||
spin_lock_bh(&wmgr_ctx.ref_lock);
|
||||
169
qca-nss-clients/patches/0020-capwapmgr-fix-compile-error.patch
Normal file
169
qca-nss-clients/patches/0020-capwapmgr-fix-compile-error.patch
Normal file
@ -0,0 +1,169 @@
|
||||
--- a/capwapmgr/nss_capwapmgr.c
|
||||
+++ b/capwapmgr/nss_capwapmgr.c
|
||||
@@ -334,7 +334,7 @@ static struct rtnl_link_stats64 *nss_cap
|
||||
* Netdev seems to be incrementing rx_dropped because we don't give IP header.
|
||||
* So reset it as it's of no use for us.
|
||||
*/
|
||||
- atomic_long_set(&dev->rx_dropped, 0);
|
||||
+ dev->stats.rx_dropped = 0;
|
||||
|
||||
memset(stats, 0, sizeof (struct rtnl_link_stats64));
|
||||
nss_capwapmgr_fill_up_stats(stats, &global.tunneld);
|
||||
@@ -379,7 +379,6 @@ static const struct net_device_ops nss_c
|
||||
.ndo_stop = nss_capwapmgr_close,
|
||||
.ndo_start_xmit = nss_capwapmgr_start_xmit,
|
||||
.ndo_set_mac_address = eth_mac_addr,
|
||||
- .ndo_change_mtu = eth_change_mtu,
|
||||
.ndo_get_stats64 = nss_capwapmgr_dev_tunnel_stats,
|
||||
};
|
||||
|
||||
@@ -403,7 +402,7 @@ static void nss_capwapmgr_dummpy_netdev_
|
||||
#else
|
||||
dev->priv_destructor = NULL;
|
||||
#endif
|
||||
- memcpy(dev->dev_addr, "\x00\x00\x00\x00\x00\x00", dev->addr_len);
|
||||
+ memcpy((u8 *)dev->dev_addr, "\x00\x00\x00\x00\x00\x00", dev->addr_len);
|
||||
memset(dev->broadcast, 0xff, dev->addr_len);
|
||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||
}
|
||||
@@ -572,7 +571,7 @@ static struct nss_capwapmgr_tunnel *nss_
|
||||
* nss_capwapmgr_netdev_create()
|
||||
* API to create a CAPWAP netdev
|
||||
*/
|
||||
-struct net_device *nss_capwapmgr_netdev_create()
|
||||
+struct net_device *nss_capwapmgr_netdev_create(void)
|
||||
{
|
||||
struct nss_capwapmgr_priv *priv;
|
||||
struct nss_capwapmgr_response *r;
|
||||
@@ -1179,7 +1178,7 @@ static nss_capwapmgr_status_t nss_capwap
|
||||
/*
|
||||
* Call NSS driver
|
||||
*/
|
||||
- status = nss_capwap_tx_msg(ctx, msg);
|
||||
+ status = (nss_capwapmgr_status_t)nss_capwap_tx_msg(ctx, msg);
|
||||
if (status != NSS_CAPWAPMGR_SUCCESS) {
|
||||
up(&r->sem);
|
||||
dev_put(dev);
|
||||
@@ -1220,7 +1219,7 @@ static nss_capwapmgr_status_t nss_capwap
|
||||
struct nss_ctx_instance *ctx = nss_capwap_get_ctx();
|
||||
struct nss_capwap_msg capwapmsg;
|
||||
struct nss_capwap_rule_msg *capwapcfg;
|
||||
- nss_tx_status_t status;
|
||||
+ nss_capwapmgr_status_t status;
|
||||
|
||||
nss_capwapmgr_info("%px: ctx: CAPWAP Rule src_port: 0x%d dest_port:0x%d\n", ctx,
|
||||
ntohl(msg->encap.src_port), ntohl(msg->encap.dest_port));
|
||||
@@ -1285,7 +1284,7 @@ static nss_capwapmgr_status_t nss_capwap
|
||||
nss_capwapmgr_msg_event_receive, dev);
|
||||
|
||||
status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
|
||||
- if (status != NSS_TX_SUCCESS) {
|
||||
+ if (status != NSS_CAPWAPMGR_SUCCESS) {
|
||||
nss_capwapmgr_warn("%px: ctx: create encap data tunnel error %d \n", ctx, status);
|
||||
return status;
|
||||
}
|
||||
@@ -1297,10 +1296,10 @@ static nss_capwapmgr_status_t nss_capwap
|
||||
* nss_capwapmgr_tx_msg_enable_tunnel()
|
||||
* Common function to send CAPWAP tunnel enable msg
|
||||
*/
|
||||
-static nss_tx_status_t nss_capwapmgr_tx_msg_enable_tunnel(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, uint32_t sibling_if_num)
|
||||
+static nss_capwapmgr_status_t nss_capwapmgr_tx_msg_enable_tunnel(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, uint32_t sibling_if_num)
|
||||
{
|
||||
struct nss_capwap_msg capwapmsg;
|
||||
- nss_tx_status_t status;
|
||||
+ nss_capwapmgr_status_t status;
|
||||
|
||||
/*
|
||||
* Prepare the tunnel configuration parameter to send to NSS FW
|
||||
@@ -1314,7 +1313,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
|
||||
nss_capwap_msg_init(&capwapmsg, if_num, NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, sizeof(struct nss_capwap_enable_tunnel_msg), nss_capwapmgr_msg_event_receive, dev);
|
||||
|
||||
status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
|
||||
- if (status != NSS_TX_SUCCESS) {
|
||||
+ if (status != NSS_CAPWAPMGR_SUCCESS) {
|
||||
nss_capwapmgr_warn("%px: ctx: CMD: %d Tunnel error : %d \n", ctx, NSS_CAPWAP_MSG_TYPE_ENABLE_TUNNEL, status);
|
||||
}
|
||||
|
||||
@@ -1326,7 +1325,7 @@ static nss_tx_status_t nss_capwapmgr_tx_
|
||||
* Common function for CAPWAP tunnel operation messages without
|
||||
* any message data structures.
|
||||
*/
|
||||
-static nss_tx_status_t nss_capwapmgr_tunnel_action(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, nss_capwap_msg_type_t cmd)
|
||||
+static nss_capwapmgr_status_t nss_capwapmgr_tunnel_action(struct nss_ctx_instance *ctx, struct net_device *dev, uint32_t if_num, nss_capwap_msg_type_t cmd)
|
||||
{
|
||||
struct nss_capwap_msg capwapmsg;
|
||||
nss_tx_status_t status;
|
||||
@@ -1341,12 +1340,12 @@ static nss_tx_status_t nss_capwapmgr_tun
|
||||
*/
|
||||
nss_capwap_msg_init(&capwapmsg, if_num, cmd, 0, nss_capwapmgr_msg_event_receive, dev);
|
||||
|
||||
- status = nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
|
||||
+ status = (nss_tx_status_t)nss_capwapmgr_tx_msg_sync(ctx, dev, &capwapmsg);
|
||||
if (status != NSS_TX_SUCCESS) {
|
||||
nss_capwapmgr_warn("%px: ctx: CMD: %d Tunnel error : %d \n", ctx, cmd, status);
|
||||
}
|
||||
|
||||
- return status;
|
||||
+ return (nss_capwapmgr_status_t)status;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1471,7 +1470,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_path_
|
||||
*/
|
||||
nss_capwapmgr_status_t nss_capwapmgr_update_dest_mac_addr(struct net_device *dev, uint8_t tunnel_id, uint8_t *mac_addr)
|
||||
{
|
||||
- struct nss_capwapmgr_priv *priv;
|
||||
struct nss_capwapmgr_tunnel *t;
|
||||
nss_tx_status_t nss_status;
|
||||
nss_capwapmgr_status_t status = NSS_CAPWAPMGR_SUCCESS;
|
||||
@@ -1487,7 +1485,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
|
||||
}
|
||||
|
||||
|
||||
- priv = netdev_priv(dev);
|
||||
nss_capwapmgr_info("%px: %d: tunnel update mac Addr is being called\n", dev, tunnel_id);
|
||||
|
||||
/*
|
||||
@@ -1534,7 +1531,6 @@ EXPORT_SYMBOL(nss_capwapmgr_update_dest_
|
||||
*/
|
||||
nss_capwapmgr_status_t nss_capwapmgr_update_src_interface(struct net_device *dev, uint8_t tunnel_id, uint32_t src_interface_num)
|
||||
{
|
||||
- struct nss_capwapmgr_priv *priv;
|
||||
struct nss_capwapmgr_tunnel *t;
|
||||
nss_tx_status_t nss_status;
|
||||
uint32_t outer_trustsec_enabled, dtls_enabled, forward_if_num, src_interface_num_temp;
|
||||
@@ -1548,7 +1544,6 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
|
||||
}
|
||||
|
||||
|
||||
- priv = netdev_priv(dev);
|
||||
nss_capwapmgr_info("%px: %d: tunnel update source interface is being called\n", dev, tunnel_id);
|
||||
outer_trustsec_enabled = t->capwap_rule.enabled_features & NSS_CAPWAPMGR_FEATURE_OUTER_TRUSTSEC_ENABLED;
|
||||
dtls_enabled = t->capwap_rule.enabled_features & NSS_CAPWAPMGR_FEATURE_DTLS_ENABLED;
|
||||
@@ -1587,7 +1582,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
|
||||
/*
|
||||
* Destroy the IP rule only if it already exist.
|
||||
*/
|
||||
- if (t->tunnel_state & NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
|
||||
+ if (NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
|
||||
struct nss_ipv4_destroy v4_destroy;
|
||||
v4_destroy.protocol = IPPROTO_UDP;
|
||||
v4_destroy.src_ip = t->ip_rule.v4.src_ip;
|
||||
@@ -1617,7 +1612,7 @@ nss_capwapmgr_status_t nss_capwapmgr_upd
|
||||
/*
|
||||
* Destroy the IP rule only if it already exist.
|
||||
*/
|
||||
- if (t->tunnel_state & NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
|
||||
+ if (NSS_CAPWAPMGR_TUNNEL_STATE_IPRULE_CONFIGURED) {
|
||||
struct nss_ipv6_destroy v6_destroy;
|
||||
|
||||
if (t->capwap_rule.which_udp == NSS_CAPWAP_TUNNEL_UDP) {
|
||||
@@ -1761,7 +1756,7 @@ nss_capwapmgr_status_t nss_capwapmgr_dsc
|
||||
uint8_t rule_nr = NSS_CAPWAPMGR_RULE_NR;
|
||||
uint8_t list_id, v4_rule_id, v6_rule_id;
|
||||
uint8_t lid, rid, i, j;
|
||||
- int8_t err, fail_dscp;
|
||||
+ uint8_t err, fail_dscp;
|
||||
int8_t uid = -1;
|
||||
|
||||
nss_capwapmgr_info("Setting priority %u for dscp %u mask %u\n", pri, dscp_value, dscp_mask);
|
||||
@ -7,14 +7,14 @@ config NSS_DRV_BRIDGE_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable BRIDGE"
|
||||
config NSS_DRV_C2C_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable C2C"
|
||||
config NSS_DRV_CAPWAP_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable CAPWAP"
|
||||
config NSS_DRV_C2C_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable C2C"
|
||||
config NSS_DRV_CLMAP_ENABLE
|
||||
bool
|
||||
default n
|
||||
@ -64,6 +64,7 @@ config NSS_DRV_IPV6_ENABLE
|
||||
config NSS_DRV_IPV6_REASM_ENABLE
|
||||
bool
|
||||
default n
|
||||
depends on NSS_DRV_IPV6_ENABLE
|
||||
prompt "Enable IPV6_REASM"
|
||||
config NSS_DRV_L2TP_ENABLE
|
||||
bool
|
||||
@ -93,6 +94,10 @@ config NSS_DRV_PORTID_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable PORTID"
|
||||
config NSS_DRV_LSO_RX_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable LSO RX"
|
||||
config NSS_DRV_PPE_ENABLE
|
||||
bool
|
||||
default n
|
||||
@ -116,7 +121,7 @@ config NSS_DRV_QRFS_ENABLE
|
||||
config NSS_DRV_QVPN_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable QVPN"
|
||||
prompt "Enable OpenVpn (QVPN)"
|
||||
config NSS_DRV_RMNET_ENABLE
|
||||
bool
|
||||
default n
|
||||
@ -137,6 +142,15 @@ config NSS_DRV_TRUSTSEC_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable TRUSTSEC"
|
||||
config NSS_DRV_UDP_ST_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable UDP Speedtest"
|
||||
config NSS_DRV_TRUSTSEC_RX_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable TRUSTSEC_RX"
|
||||
depends on NSS_DRV_TRUSTSEC_ENABLE
|
||||
config NSS_DRV_TSTAMP_ENABLE
|
||||
bool
|
||||
default n
|
||||
@ -161,8 +175,22 @@ config NSS_DRV_VXLAN_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable VXLAN (ipq807x)"
|
||||
config NSS_DRV_WIFI_ENABLE
|
||||
config NSS_DRV_WIFIOFFLOAD_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable WIFI"
|
||||
config NSS_DRV_WIFI_EXT_VDEV_ENABLE
|
||||
bool
|
||||
default n
|
||||
depends on NSS_DRV_WIFIOFFLOAD_ENABLE
|
||||
prompt "Enable WIFI EXT VDEV"
|
||||
config NSS_DRV_WIFI_MESH_ENABLE
|
||||
bool
|
||||
default n
|
||||
depends on NSS_DRV_WIFIOFFLOAD_ENABLE
|
||||
prompt "Enable WIFI MESH"
|
||||
config NSS_DRV_WIFI_LEGACY_ENABLE
|
||||
bool
|
||||
default n
|
||||
prompt "Enable Legacy WIFI"
|
||||
endmenu
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qca-nss-drv
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/nss-drv.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2020-03-20
|
||||
PKG_SOURCE_VERSION:=3cfb9f43
|
||||
PKG_MIRROR_HASH:=87ab6dab1c0a441b2df95b6c5d992f86a07c6ecd69a0d13eba35014fadaf98d8
|
||||
PKG_SOURCE_DATE:=2021-07-13
|
||||
PKG_SOURCE_VERSION:=22b485ac89a3a1b60f3a6d5b2fe3236d170934b9
|
||||
PKG_MIRROR_HASH:=d3129748ddc303f3c211c4bf61d8ddbc9096c1a3a411dff3cc2be884a2e829b8
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_NSS_DRV_BRIDGE_ENABLE \
|
||||
CONFIG_NSS_DRV_C2C_ENABLE \
|
||||
CONFIG_NSS_DRV_CAPWAP_ENABLE \
|
||||
CONFIG_NSS_DRV_C2C_ENABLE \
|
||||
CONFIG_NSS_DRV_CLMAP_ENABLE \
|
||||
CONFIG_NSS_DRV_CRYPTO_ENABLE \
|
||||
CONFIG_NSS_DRV_DMA_ENABLE \
|
||||
@ -28,6 +28,7 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_NSS_DRV_IPV4_REASM_ENABLE \
|
||||
CONFIG_NSS_DRV_IPV6_ENABLE \
|
||||
CONFIG_NSS_DRV_IPV6_REASM_ENABLE \
|
||||
CONFIG_NSS_DRV_LSO_RX_ENABLE \
|
||||
CONFIG_NSS_DRV_L2TP_ENABLE \
|
||||
CONFIG_NSS_DRV_LAG_ENABLE \
|
||||
CONFIG_NSS_DRV_MAPT_ENABLE \
|
||||
@ -44,18 +45,26 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_NSS_DRV_RMNET_ENABLE \
|
||||
CONFIG_NSS_DRV_SHAPER_ENABLE \
|
||||
CONFIG_NSS_DRV_SJACK_ENABLE \
|
||||
CONFIG_NSS_DRV_UDP_ST_ENABLE \
|
||||
CONFIG_NSS_DRV_TLS_ENABLE \
|
||||
CONFIG_NSS_DRV_TRUSTSEC_ENABLE \
|
||||
CONFIG_NSS_DRV_TRUSTSEC_RX_ENABLE \
|
||||
CONFIG_NSS_DRV_TSTAMP_ENABLE \
|
||||
CONFIG_NSS_DRV_TUN6RD_ENABLE \
|
||||
CONFIG_NSS_DRV_TUNIPIP6_ENABLE \
|
||||
CONFIG_NSS_DRV_VIRT_IF_ENABLE \
|
||||
CONFIG_NSS_DRV_VLAN_ENABLE \
|
||||
CONFIG_NSS_DRV_VXLAN_ENABLE \
|
||||
CONFIG_NSS_DRV_WIFI_ENABLE
|
||||
CONFIG_NSS_DRV_WIFIOFFLOAD_ENABLE \
|
||||
CONFIG_NSS_DRV_WIFI_EXT_VDEV_ENABLE \
|
||||
CONFIG_NSS_DRV_WIFI_MESH_ENABLE \
|
||||
CONFIG_NSS_DRV_WIFI_LEGACY_ENABLE
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
NSS_CLIENTS_DIR:=$(TOPDIR)/qca/src/qca-nss-clients
|
||||
|
||||
define KernelPackage/qca-nss-drv
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
@ -72,20 +81,18 @@ define KernelPackage/qca-nss-drv/config
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/debug
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/sysctl.d
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/firmware
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/firmware
|
||||
$(INSTALL_DIR) $(1)/lib/debug
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.sysdebug $(1)/sbin/sysdebug
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.debug $(1)/lib/debug/qca-nss-drv
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.init $(1)/etc/init.d/qca-nss-drv
|
||||
$(INSTALL_DATA) ./files/qca-nss-drv.sysctl $(1)/etc/sysctl.d/99-qca-nss-drv.conf
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.sysctl $(1)/etc/sysctl.d/qca-nss-drv.conf
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.conf $(1)/etc/config/nss
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.hotplug $(1)/etc/hotplug.d/firmware/10-qca-nss-fw
|
||||
$(INSTALL_DATA) ./files/qca-nss-drv.conf $(1)/etc/config/nss
|
||||
$(INSTALL_BIN) ./files/qca-nss-drv.debug $(1)/lib/debug/qca-nss-drv
|
||||
$(INSTALL_DATA) ./files/nss-firmware/qca-nss0-retail.bin $(1)/lib/firmware/qca-nss0.bin
|
||||
$(INSTALL_DATA) ./files/nss-firmware/qca-nss1-retail.bin $(1)/lib/firmware/qca-nss1.bin
|
||||
|
||||
@ -105,7 +112,10 @@ ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_64" "ipq60xx" "ipq60xx_64
|
||||
endif
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac -I$(STAGING_DIR)/usr/include/qca-nss-dp
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-gmac \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-dp \
|
||||
-I$(STAGING_DIR)/usr/include/qca-ssdk \
|
||||
-Wno-unused-variable
|
||||
|
||||
# Keeping default as ipq806x for branches that does not have subtarget framework
|
||||
ifeq ($(CONFIG_TARGET_ipq),y)
|
||||
@ -140,9 +150,6 @@ endif
|
||||
ifndef CONFIG_NSS_DRV_C2C_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_C2C_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_CAPWAP_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_CAPWAP_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_CLMAP_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_CLMAP_ENABLE=n
|
||||
endif
|
||||
@ -159,8 +166,10 @@ ifndef CONFIG_NSS_DRV_EDMA_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_EDMA_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_GRE_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-gre
|
||||
DRV_MAKE_OPTS += NSS_DRV_GRE_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_GRE_REDIR_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_GRE_REDIR_ENABLE=n
|
||||
endif
|
||||
@ -171,8 +180,10 @@ ifndef CONFIG_NSS_DRV_IGS_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_IGS_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_IPSEC_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-ipsec
|
||||
DRV_MAKE_OPTS += NSS_DRV_IPSEC_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_IPV4_REASM_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_IPV4_REASM_ENABLE=n
|
||||
endif
|
||||
@ -183,14 +194,18 @@ ifndef CONFIG_NSS_DRV_IPV6_REASM_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_IPV6_REASM_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_L2TP_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-l2tp
|
||||
DRV_MAKE_OPTS += NSS_DRV_L2TP_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_LAG_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_LAG_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_MAPT_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-nat46
|
||||
DRV_MAKE_OPTS += NSS_DRV_MAPT_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_MATCH_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_MATCH_ENABLE=n
|
||||
endif
|
||||
@ -207,11 +222,15 @@ ifndef CONFIG_NSS_DRV_PPE_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_PPE_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_PPPOE_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-pppoe
|
||||
DRV_MAKE_OPTS += NSS_DRV_PPPOE_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_PPTP_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-pptp
|
||||
DRV_MAKE_OPTS += NSS_DRV_PPTP_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_PVXLAN_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_PVXLAN_ENABLE=n
|
||||
endif
|
||||
@ -221,6 +240,9 @@ endif
|
||||
ifndef CONFIG_NSS_DRV_QVPN_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_QVPN_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_OVPN_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_OVPN_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_RMNET_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_RMNET_ENABLE=n
|
||||
endif
|
||||
@ -236,12 +258,17 @@ endif
|
||||
ifndef CONFIG_NSS_DRV_TRUSTSEC_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_TRUSTSEC_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_TRUSTSEC_RX_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_TRUSTSEC_RX_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_TSTAMP_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_TSTAMP_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_TUN6RD_ENABLE
|
||||
ifndef CONFIG_PACKAGE_kmod-sit
|
||||
DRV_MAKE_OPTS += NSS_DRV_TUN6RD_ENABLE=n
|
||||
endif
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_TUNIPIP6_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_TUNIPIP6_ENABLE=n
|
||||
endif
|
||||
@ -254,8 +281,26 @@ endif
|
||||
ifndef CONFIG_NSS_DRV_VXLAN_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_VXLAN_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_WIFI_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_WIFI_ENABLE=n
|
||||
ifndef CONFIG_NSS_DRV_WIFIOFFLOAD_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_WIFIOFFLOAD_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_WIFI_EXT_VDEV_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_WIFI_EXT_VDEV_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_WIFI_MESH_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_WIFI_MESH_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_UDP_ST_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_UDP_ST_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_CAPWAP_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_CAPWAP_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_LSO_RX_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_LSO_RX_ENABLE=n
|
||||
endif
|
||||
ifndef CONFIG_NSS_DRV_WIFI_LEGACY_ENABLE
|
||||
DRV_MAKE_OPTS += NSS_DRV_WIFI_LEGACY_ENABLE=n
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "ipq806x")
|
||||
@ -271,12 +316,14 @@ define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" $(strip $(DRV_MAKE_OPTS)) \
|
||||
+$(MAKE) -C "$(LINUX_DIR)" $(strip $(DRV_MAKE_OPTS)) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC=$(SOC) \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
SoC=$(SOC) \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_JOBS) \
|
||||
modules
|
||||
endef
|
||||
|
||||
|
||||
BIN
qca-nss-drv/files/nss-firmware/qca-nss0-retail.bin
Normal file → Executable file
BIN
qca-nss-drv/files/nss-firmware/qca-nss0-retail.bin
Normal file → Executable file
Binary file not shown.
BIN
qca-nss-drv/files/nss-firmware/qca-nss1-retail.bin
Normal file → Executable file
BIN
qca-nss-drv/files/nss-firmware/qca-nss1-retail.bin
Normal file → Executable file
Binary file not shown.
@ -1,38 +0,0 @@
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -1116,7 +1116,7 @@ static inline bool nss_core_handle_nr_fr
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd);
|
||||
+ nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
}
|
||||
#endif
|
||||
goto pull;
|
||||
@@ -1156,7 +1156,7 @@ static inline bool nss_core_handle_nr_fr
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd);
|
||||
+ nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1271,7 +1271,7 @@ static inline bool nss_core_handle_linea
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd);
|
||||
+ nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1329,7 +1329,7 @@ static inline bool nss_core_handle_linea
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd);
|
||||
+ nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1,14 +1,24 @@
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -711,7 +711,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
|
||||
/*
|
||||
* meminfo_start is the label where the start address of meminfo map is stored.
|
||||
*/
|
||||
- meminfo_start = (uint32_t *)ioremap_nocache(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET,
|
||||
+ meminfo_start = (uint32_t *)ioremap(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET,
|
||||
NSS_MEMINFO_RESERVE_AREA_SIZE);
|
||||
if (!meminfo_start) {
|
||||
nss_info_always("%p: cannot remap meminfo start\n", nss_ctx);
|
||||
From dddfe22459a988a5b86d195bc3cc3bd3c2ac7037 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Sat, 14 Jan 2023 21:52:38 +0100
|
||||
Subject: [PATCH 1/4] nss-drv: replace ioremap_nocache() with ioremap()
|
||||
|
||||
Since 5.5 ioremap_nocache is equal to ioremap on all archs and was removed
|
||||
from the kernel, so just use ioremap instead.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
nss_hal/fsm9010/nss_hal_pvt.c | 2 +-
|
||||
nss_hal/ipq50xx/nss_hal_pvt.c | 6 +++---
|
||||
nss_hal/ipq60xx/nss_hal_pvt.c | 8 ++++----
|
||||
nss_hal/ipq806x/nss_hal_pvt.c | 4 ++--
|
||||
nss_hal/ipq807x/nss_hal_pvt.c | 6 +++---
|
||||
nss_hal/ipq95xx/nss_hal_pvt.c | 6 +++---
|
||||
nss_hal/nss_hal.c | 4 ++--
|
||||
nss_meminfo.c | 2 +-
|
||||
nss_ppe.c | 2 +-
|
||||
9 files changed, 20 insertions(+), 20 deletions(-)
|
||||
|
||||
--- a/nss_hal/fsm9010/nss_hal_pvt.c
|
||||
+++ b/nss_hal/fsm9010/nss_hal_pvt.c
|
||||
@@ -145,7 +145,7 @@ static struct nss_platform_data *__nss_h
|
||||
@ -18,8 +28,35 @@
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%p: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
--- a/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq50xx/nss_hal_pvt.c
|
||||
@@ -184,13 +184,13 @@ static struct nss_platform_data *__nss_h
|
||||
npd->nphys = res_nphys.start;
|
||||
npd->qgic_phys = res_qgic_phys.start;
|
||||
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
}
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -348,7 +348,7 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq60xx/nss_hal_pvt.c
|
||||
@@ -207,13 +207,13 @@ static struct nss_platform_data *__nss_h
|
||||
@ -29,30 +66,30 @@
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%p: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
}
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%p: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -434,13 +434,13 @@ static int __nss_hal_common_reset(struct
|
||||
@@ -433,13 +433,13 @@ static int __nss_hal_common_reset(struct
|
||||
|
||||
of_node_put(cmn);
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
pr_err("%p: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
- nss_misc_reset_flag = ioremap_nocache(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag));
|
||||
+ nss_misc_reset_flag = ioremap(res_nss_misc_reset_flag.start, resource_size(&res_nss_misc_reset_flag));
|
||||
if (!nss_misc_reset_flag) {
|
||||
pr_err("%p: ioremap fail for nss_misc_reset_flag\n", nss_dev);
|
||||
pr_err("%px: ioremap fail for nss_misc_reset_flag\n", nss_dev);
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
@ -63,16 +100,16 @@
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%p: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -710,7 +710,7 @@ static int __nss_hal_common_reset(struct
|
||||
@@ -711,7 +711,7 @@ static int __nss_hal_common_reset(struct
|
||||
}
|
||||
of_node_put(cmn);
|
||||
|
||||
- fpb_base = ioremap_nocache(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base));
|
||||
+ fpb_base = ioremap(res_nss_fpb_base.start, resource_size(&res_nss_fpb_base));
|
||||
if (!fpb_base) {
|
||||
pr_err("%p: ioremap fail for nss_fpb_base\n", nss_dev);
|
||||
pr_err("%px: ioremap fail for nss_fpb_base\n", nss_dev);
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq807x/nss_hal_pvt.c
|
||||
@ -83,25 +120,25 @@
|
||||
- npd->nmap = ioremap_nocache(npd->nphys, resource_size(&res_nphys));
|
||||
+ npd->nmap = ioremap(npd->nphys, resource_size(&res_nphys));
|
||||
if (!npd->nmap) {
|
||||
nss_info_always("%p: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
nss_info_always("%px: nss%d: ioremap() fail for nphys\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -246,7 +246,7 @@ static struct nss_platform_data *__nss_h
|
||||
@@ -247,7 +247,7 @@ static struct nss_platform_data *__nss_h
|
||||
goto out;
|
||||
}
|
||||
|
||||
- npd->qgic_map = ioremap_nocache(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
+ npd->qgic_map = ioremap(npd->qgic_phys, resource_size(&res_qgic_phys));
|
||||
if (!npd->qgic_map) {
|
||||
nss_info_always("%p: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
nss_info_always("%px: nss%d: ioremap() fail for qgic map\n", nss_ctx, nss_ctx->id);
|
||||
goto out;
|
||||
@@ -466,7 +466,7 @@ static int __nss_hal_common_reset(struct
|
||||
@@ -467,7 +467,7 @@ static int __nss_hal_common_reset(struct
|
||||
}
|
||||
of_node_put(cmn);
|
||||
|
||||
- nss_misc_reset = ioremap_nocache(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
+ nss_misc_reset = ioremap(res_nss_misc_reset.start, resource_size(&res_nss_misc_reset));
|
||||
if (!nss_misc_reset) {
|
||||
pr_err("%p: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
pr_err("%px: ioremap fail for nss_misc_reset\n", nss_dev);
|
||||
return -EFAULT;
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@ -112,14 +149,25 @@
|
||||
- load_mem = ioremap_nocache(npd->load_addr, nss_fw->size);
|
||||
+ load_mem = ioremap(npd->load_addr, nss_fw->size);
|
||||
if (!load_mem) {
|
||||
- nss_info_always("%p: ioremap_nocache failed: %x", nss_ctx, npd->load_addr);
|
||||
+ nss_info_always("%p: ioremap failed: %x", nss_ctx, npd->load_addr);
|
||||
- nss_info_always("%px: ioremap_nocache failed: %x", nss_ctx, npd->load_addr);
|
||||
+ nss_info_always("%px: ioremap failed: %x", nss_ctx, npd->load_addr);
|
||||
release_firmware(nss_fw);
|
||||
return rc;
|
||||
}
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -728,7 +728,7 @@ bool nss_meminfo_init(struct nss_ctx_ins
|
||||
/*
|
||||
* meminfo_start is the label where the start address of meminfo map is stored.
|
||||
*/
|
||||
- meminfo_start = (uint32_t *)ioremap_nocache(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET,
|
||||
+ meminfo_start = (uint32_t *)ioremap(nss_ctx->load + NSS_MEMINFO_MAP_START_OFFSET,
|
||||
NSS_MEMINFO_RESERVE_AREA_SIZE);
|
||||
if (!meminfo_start) {
|
||||
nss_info_always("%px: cannot remap meminfo start\n", nss_ctx);
|
||||
--- a/nss_ppe.c
|
||||
+++ b/nss_ppe.c
|
||||
@@ -354,7 +354,7 @@ void nss_ppe_init(void)
|
||||
@@ -357,7 +357,7 @@ void nss_ppe_init(void)
|
||||
/*
|
||||
* Get the PPE base address
|
||||
*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,18 @@
|
||||
--- a/nss_dynamic_interface_stats.c
|
||||
+++ b/nss_dynamic_interface_stats.c
|
||||
@@ -87,8 +87,15 @@ const char *nss_dynamic_interface_type_n
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_MIRROR",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_WDS",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_HOST_INNER",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP_OUTER",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_EXT_VDEV_VLAN",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_INNER",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFI_MESH_OUTER"
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1,101 +0,0 @@
|
||||
--- a/exports/nss_dynamic_interface.h
|
||||
+++ b/exports/nss_dynamic_interface.h
|
||||
@@ -22,6 +22,8 @@
|
||||
#ifndef __NSS_DYNAMIC_INTERFACE_H
|
||||
#define __NSS_DYNAMIC_INTERFACE_H
|
||||
|
||||
+#include "nss_fw_version.h"
|
||||
+
|
||||
/**
|
||||
* @addtogroup nss_dynamic_interface_subsystem
|
||||
* @{
|
||||
@@ -101,9 +103,11 @@ enum nss_dynamic_interface_type {
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_MIRROR,
|
||||
+#endif
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_MAX
|
||||
};
|
||||
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -381,13 +381,14 @@ int nss_hal_probe(struct platform_device
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_GENERIC_REDIR_H2N] = nss_dev->id;
|
||||
}
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,3))
|
||||
#ifdef NSS_DRV_CAPWAP_ENABLE
|
||||
if (npd->capwap_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->capwap_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_CAPWAP] = nss_dev->id;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
+#endif
|
||||
if (npd->ipv4_reasm_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->ipv4_reasm_handler_id = nss_dev->id;
|
||||
nss_ipv4_reasm_register_handler();
|
||||
@@ -646,6 +647,7 @@ int nss_hal_probe(struct platform_device
|
||||
nss_match_init();
|
||||
}
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
#ifdef NSS_DRV_TLS_ENABLE
|
||||
#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT)
|
||||
if (npd->tls_enabled == NSS_FEATURE_ENABLED) {
|
||||
@@ -656,12 +658,15 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
+#ifdef NSS_DRV_MIRROR_ENABLE
|
||||
if (npd->mirror_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->mirror_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_MIRROR] = nss_dev->id;
|
||||
nss_mirror_register_handler();
|
||||
nss_info("%d: NSS mirror is enabled", nss_dev->id);
|
||||
}
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
if (nss_ctx->id == 0) {
|
||||
#if (NSS_FREQ_SCALE_SUPPORT == 1)
|
||||
--- a/exports/nss_ipv4.h
|
||||
+++ b/exports/nss_ipv4.h
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "nss_stats_public.h"
|
||||
#endif
|
||||
|
||||
+#include "nss_fw_version.h"
|
||||
+
|
||||
/**
|
||||
* @addtogroup nss_ipv4_subsystem
|
||||
* @{
|
||||
@@ -734,8 +736,10 @@ enum nss_ipv4_exception_events {
|
||||
NSS_IPV4_EXCEPTION_EVENT_MC_PBUF_ALLOC_FAILURE,
|
||||
NSS_IPV4_EXCEPTION_EVENT_PPPOE_BRIDGE_NO_ICME,
|
||||
NSS_IPV4_EXCEPTION_EVENT_PPPOE_NO_SESSION,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_GRE_HEADER_INCOMPLETE,
|
||||
NSS_IPV4_EXCEPTION_EVENT_ICMP_IPV4_ESP_HEADER_INCOMPLETE,
|
||||
+#endif
|
||||
NSS_IPV4_EXCEPTION_EVENT_MAX
|
||||
};
|
||||
|
||||
--- /dev/null
|
||||
+++ b/exports/nss_fw_version.h
|
||||
@@ -0,0 +1,11 @@
|
||||
+#ifndef __NSS_FW_VERSION_H
|
||||
+#define __NSS_FW_VERSION_H
|
||||
+
|
||||
+#define NSS_FW_VERSION_MAJOR 11
|
||||
+#define NSS_FW_VERSION_MINOR 0
|
||||
+
|
||||
+#define NSS_FW_VERSION(a,b) (((a) << 8) + (b))
|
||||
+
|
||||
+#define NSS_FW_VERSION_CODE NSS_FW_VERSION(NSS_FW_VERSION_MAJOR, NSS_FW_VERSION_MINOR)
|
||||
+
|
||||
+#endif /* __NSS_FW_VERSION_H */
|
||||
@ -1,29 +1,57 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -46,13 +46,7 @@ qca-nss-drv-objs := \
|
||||
nss_lso_rx.o \
|
||||
nss_lso_rx_stats.o \
|
||||
nss_lso_rx_strings.o \
|
||||
- nss_match.o \
|
||||
- nss_match_log.o \
|
||||
- nss_match_stats.o \
|
||||
@@ -5,11 +5,12 @@
|
||||
obj-m += qca-nss-drv.o
|
||||
|
||||
#
|
||||
+# Regular NSS path
|
||||
+#
|
||||
+#
|
||||
# List the files that belong to the driver in alphabetical order.
|
||||
#
|
||||
qca-nss-drv-objs := \
|
||||
- nss_bridge.o \
|
||||
- nss_bridge_log.o \
|
||||
nss_cmn.o \
|
||||
nss_core.o \
|
||||
nss_coredump.o \
|
||||
@@ -18,74 +19,70 @@ qca-nss-drv-objs := \
|
||||
nss_dynamic_interface.o \
|
||||
nss_dynamic_interface_log.o \
|
||||
nss_dynamic_interface_stats.o \
|
||||
- nss_eth_rx.o \
|
||||
- nss_eth_rx_stats.o \
|
||||
- nss_eth_rx_strings.o \
|
||||
- nss_gmac_stats.o \
|
||||
- nss_if.o \
|
||||
- nss_if_log.o \
|
||||
nss_init.o \
|
||||
- nss_ipv4.o \
|
||||
- nss_ipv4_stats.o \
|
||||
- nss_ipv4_strings.o \
|
||||
- nss_ipv4_log.o \
|
||||
- nss_ipv4_reasm.o \
|
||||
- nss_ipv4_reasm_stats.o \
|
||||
- nss_ipv4_reasm_strings.o \
|
||||
- nss_ipv6.o \
|
||||
- nss_ipv6_stats.o \
|
||||
- nss_ipv6_strings.o \
|
||||
- nss_ipv6_log.o \
|
||||
- nss_ipv6_reasm.o \
|
||||
- nss_ipv6_reasm_stats.o \
|
||||
- nss_ipv6_reasm_strings.o \
|
||||
nss_log.o \
|
||||
- nss_lso_rx.o \
|
||||
- nss_lso_rx_stats.o \
|
||||
- nss_lso_rx_strings.o \
|
||||
nss_meminfo.o \
|
||||
- nss_mirror.o \
|
||||
- nss_mirror_log.o \
|
||||
- nss_mirror_stats.o \
|
||||
nss_n2h.o \
|
||||
nss_n2h_stats.o \
|
||||
nss_n2h_strings.o \
|
||||
@@ -60,28 +54,44 @@ qca-nss-drv-objs := \
|
||||
- nss_phys_if.o \
|
||||
nss_pm.o \
|
||||
nss_profiler.o \
|
||||
nss_project.o \
|
||||
- nss_ppe.o \
|
||||
- nss_ppe_log.o \
|
||||
- nss_ppe_stats.o \
|
||||
- nss_ppe_vp.o \
|
||||
- nss_ppe_vp_log.o \
|
||||
- nss_ppe_vp_stats.o \
|
||||
- nss_pppoe.o \
|
||||
- nss_pppoe_log.o \
|
||||
- nss_pppoe_stats.o \
|
||||
@ -31,16 +59,143 @@
|
||||
nss_rps.o \
|
||||
nss_stats.o \
|
||||
nss_strings.o \
|
||||
nss_tx_msg_sync.o \
|
||||
- nss_tx_msg_sync.o \
|
||||
nss_unaligned.o \
|
||||
nss_unaligned_log.o \
|
||||
- nss_unaligned_stats.o \
|
||||
+ nss_unaligned_stats.o
|
||||
+
|
||||
+# Base NSS data plane/HAL support
|
||||
+qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
|
||||
+# Base NSS HAL support
|
||||
+qca-nss-drv-objs += nss_hal/nss_hal.o
|
||||
+
|
||||
+ifneq "$(NSS_DRV_POINT_OFFLOAD)" "y"
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_gmac_stats.o \
|
||||
+ nss_if.o \
|
||||
+ nss_if_log.o \
|
||||
+ nss_phys_if.o \
|
||||
+ nss_tx_msg_sync.o \
|
||||
nss_virt_if.o \
|
||||
- nss_virt_if_stats.o \
|
||||
- nss_vlan.o \
|
||||
- nss_vlan_log.o \
|
||||
- nss_wifi.o \
|
||||
- nss_wifi_log.o \
|
||||
- nss_wifi_stats.o \
|
||||
- nss_wifi_vdev.o \
|
||||
- nss_wifili.o \
|
||||
- nss_wifili_log.o \
|
||||
- nss_wifili_stats.o \
|
||||
- nss_wifili_strings.o \
|
||||
- nss_wifi_mac_db.o \
|
||||
- nss_wifi_ext_vdev.o \
|
||||
- nss_wifi_ext_vdev_stats.o \
|
||||
- nss_wifi_ext_vdev_log.o \
|
||||
- nss_wifi_mesh.o \
|
||||
- nss_wifi_mesh_log.o \
|
||||
- nss_wifi_mesh_stats.o \
|
||||
- nss_wifi_mesh_strings.o
|
||||
+ nss_virt_if_stats.o
|
||||
|
||||
-# Base NSS data plane/HAL support
|
||||
+# Base NSS data plane support
|
||||
qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
|
||||
-qca-nss-drv-objs += nss_hal/nss_hal.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_BRIDGE_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_bridge.o \
|
||||
+ nss_bridge_log.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_WIFI_EXT_VDEV_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_WIFI_EXT_VDEV_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_wifi_ext_vdev.o \
|
||||
+ nss_wifi_ext_vdev_stats.o \
|
||||
+ nss_wifi_ext_vdev_log.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_WIFI_MESH_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_WIFI_MESH_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_wifi_mesh.o \
|
||||
+ nss_wifi_mesh_log.o \
|
||||
+ nss_wifi_mesh_stats.o \
|
||||
+ nss_wifi_mesh_strings.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_IPV4_REASM_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV4_REASM_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_ipv4_reasm.o \
|
||||
+ nss_ipv4_reasm_stats.o \
|
||||
+ nss_ipv4_reasm_strings.o
|
||||
+endif
|
||||
|
||||
ifneq "$(NSS_DRV_L2TP_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_L2TP_ENABLE
|
||||
@@ -111,6 +108,22 @@ qca-nss-drv-objs += \
|
||||
nss_pvxlan_stats.o
|
||||
endif
|
||||
|
||||
+ifneq "$(NSS_DRV_IPV6_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV6_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_ipv6.o \
|
||||
+ nss_ipv6_stats.o \
|
||||
+ nss_ipv6_strings.o \
|
||||
+ nss_ipv6_log.o
|
||||
+ifneq "$(NSS_DRV_IPV6_REASM_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV6_REASM_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_ipv6_reasm.o \
|
||||
+ nss_ipv6_reasm_stats.o \
|
||||
+ nss_ipv6_reasm_strings.o
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_TSTAMP_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
@@ -213,6 +226,14 @@ qca-nss-drv-objs += \
|
||||
nss_trustsec_tx_stats.o
|
||||
endif
|
||||
|
||||
+ifneq "$(NSS_DRV_TRUSTSEC_RX_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_TRUSTSEC_RX_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_trustsec_rx.o \
|
||||
+ nss_trustsec_rx_log.o \
|
||||
+ nss_trustsec_rx_stats.o
|
||||
+endif
|
||||
+
|
||||
ifneq "$(NSS_DRV_TUNIPIP6_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_TUNIPIP6_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
@@ -303,7 +324,70 @@ qca-nss-drv-objs += \
|
||||
nss_udp_st_strings.o
|
||||
endif
|
||||
|
||||
+ifneq "$(NSS_DRV_IPV4_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV4_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_ipv4.o \
|
||||
+ nss_ipv4_stats.o \
|
||||
+ nss_ipv4_strings.o \
|
||||
+ nss_ipv4_log.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_ETH_RX_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_ETH_RX_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_eth_rx.o \
|
||||
+ nss_eth_rx_stats.o \
|
||||
+ nss_eth_rx_strings.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_PPPOE_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_PPPOE_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
@ -50,209 +205,149 @@
|
||||
+ nss_pppoe_strings.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_VIRT_IF_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_VIRT_IF_ENABLE
|
||||
+ifneq "$(NSS_DRV_WIFIOFFLOAD_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_WIFIOFFLOAD_ENABLE
|
||||
+ifneq "$(NSS_DRV_WIFI_LEGACY_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_WIFI_LEGACY_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
nss_virt_if.o \
|
||||
- nss_virt_if_stats.o \
|
||||
+ nss_virt_if_stats.o
|
||||
+ nss_wifi.o \
|
||||
+ nss_wifi_log.o \
|
||||
+ nss_wifi_stats.o
|
||||
+ifeq ($(SoC),$(filter $(SoC),ipq806x))
|
||||
+ccflags-y += -DNSS_HAL_IPQ806x_SUPPORT
|
||||
+endif
|
||||
+endif
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_wifi_vdev.o \
|
||||
+ nss_wifili.o \
|
||||
+ nss_wifili_log.o \
|
||||
+ nss_wifili_stats.o \
|
||||
+ nss_wifili_strings.o \
|
||||
+ nss_wifi_mac_db.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_VLAN_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_VLAN_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
nss_vlan.o \
|
||||
- nss_vlan_log.o \
|
||||
- nss_wifi.o \
|
||||
+ nss_vlan.o \
|
||||
+ nss_vlan_log.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_WIFI_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_WIFI_ENABLE
|
||||
+qca-nss-drv-objs += nss_wifi.o \
|
||||
nss_wifi_log.o \
|
||||
nss_wifi_stats.o \
|
||||
nss_wifi_vdev.o \
|
||||
@@ -92,10 +102,7 @@ qca-nss-drv-objs := \
|
||||
nss_wifili_stats.o \
|
||||
nss_wifili_strings.o \
|
||||
nss_wifi_mac_db.o
|
||||
-
|
||||
-# Base NSS data plane/HAL support
|
||||
-qca-nss-drv-objs += nss_data_plane/nss_data_plane_common.o
|
||||
-qca-nss-drv-objs += nss_hal/nss_hal.o
|
||||
+endif
|
||||
|
||||
ifneq "$(NSS_DRV_L2TP_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_L2TP_ENABLE
|
||||
@@ -121,6 +128,22 @@ qca-nss-drv-objs += \
|
||||
nss_pvxlan_stats.o
|
||||
endif
|
||||
|
||||
+ifneq "$(NSS_DRV_MATCH_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_MATCH_ENABLE
|
||||
+ifneq "$(NSS_DRV_LSO_RX_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_LSO_RX_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_match.o \
|
||||
+ nss_match_log.o \
|
||||
+ nss_match_stats.o
|
||||
+ nss_lso_rx.o \
|
||||
+ nss_lso_rx_stats.o \
|
||||
+ nss_lso_rx_strings.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_MIRROR_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_MIRROR_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_mirror.o \
|
||||
+ nss_mirror_log.o \
|
||||
+ nss_mirror_stats.o
|
||||
+endif
|
||||
+
|
||||
ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_TSTAMP_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
@@ -292,6 +315,7 @@ endif
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq806x ipq40xx))
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq806x))
|
||||
+ccflags-y += -DNSS_DRV_IPV4_ENABLE -DNSS_DRV_IPV6_ENABLE
|
||||
qca-nss-drv-objs += nss_data_plane/nss_data_plane_gmac.o \
|
||||
nss_hal/ipq806x/nss_hal_pvt.o
|
||||
+
|
||||
ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_IPSEC_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
@@ -317,7 +341,16 @@ ccflags-y += -I$(obj)/nss_hal/ipq806x -D
|
||||
|
||||
@@ -409,6 +493,51 @@ qca-nss-drv-objs += \
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64 ipq807x ipq807x_64))
|
||||
-qca-nss-drv-objs += nss_data_plane/nss_data_plane.o
|
||||
+qca-nss-drv-objs += nss_data_plane/nss_data_plane.o \
|
||||
+ nss_ppe.o \
|
||||
+ nss_ppe_log.o \
|
||||
+ nss_ppe_stats.o \
|
||||
+ nss_ppe_vp.o \
|
||||
+ nss_ppe_vp_log.o \
|
||||
+ nss_ppe_vp_stats.o
|
||||
+ifeq ($(SoC),$(filter $(SoC),ipq95xx))
|
||||
+qca-nss-drv-objs += nss_hal/ipq95xx/nss_hal_pvt.o
|
||||
+qca-nss-drv-objs += nss_data_plane/nss_data_plane_lite.o
|
||||
+qca-nss-drv-objs += nss_edma_lite.o \
|
||||
+ nss_edma_lite_stats.o \
|
||||
+ nss_edma_lite_strings.o
|
||||
+
|
||||
+ccflags-y += -DNSS_DRV_PPE_ENABLE
|
||||
+ccflags-y += -DNSS_DRV_EDMA_ENABLE
|
||||
+ccflags-y += -DNSS_DATA_PLANE_LITE_SUPPORT
|
||||
+ccflags-y += -DNSS_DRV_EDMA_LITE_ENABLE
|
||||
+ccflags-y += -DNSS_DRV_POINT_OFFLOAD
|
||||
+
|
||||
+ifneq "$(NSS_DRV_CRYPTO_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_CRYPTO_ENABLE
|
||||
+ccflags-y += -DNSS_DRV_DMA_ENABLE
|
||||
+
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_crypto.o \
|
||||
+ nss_crypto_log.o \
|
||||
+ nss_crypto_cmn.o \
|
||||
+ nss_crypto_cmn_log.o \
|
||||
+ nss_crypto_cmn_stats.o \
|
||||
+ nss_crypto_cmn_strings.o \
|
||||
+ nss_dma.o \
|
||||
+ nss_dma_log.o \
|
||||
+ nss_dma_stats.o \
|
||||
+ nss_dma_strings.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_DTLS_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_DTLS_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_dtls.o \
|
||||
+ nss_dtls_log.o \
|
||||
+ nss_dtls_stats.o \
|
||||
+ nss_dtls_cmn.o \
|
||||
+ nss_dtls_cmn_log.o \
|
||||
+ nss_dtls_cmn_stats.o \
|
||||
+ nss_dtls_cmn_strings.o
|
||||
+endif
|
||||
+
|
||||
+ccflags-y += -I$(obj)/nss_hal/ipq95xx -DNSS_HAL_IPQ95XX_SUPPORT -DNSS_MULTI_H2N_DATA_RING_SUPPORT
|
||||
+else
|
||||
+ccflags-y += -DNSS_DATA_PLANE_GENERIC_SUPPORT
|
||||
+endif
|
||||
+
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
|
||||
qca-nss-drv-objs += nss_hal/ipq807x/nss_hal_pvt.o \
|
||||
nss_data_plane/hal/nss_ipq807x.o
|
||||
@@ -467,6 +596,7 @@ ccflags-y += -I$(obj)/nss_hal/ipq50xx -D
|
||||
endif
|
||||
|
||||
ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_IPSEC_ENABLE
|
||||
ccflags-y += -I$(obj)/nss_hal/include -I$(obj)/nss_data_plane/include -I$(obj)/exports -DNSS_DEBUG_LEVEL=0 -DNSS_PKT_STATS_ENABLED=1
|
||||
+
|
||||
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
|
||||
@@ -481,7 +611,14 @@ NSS_CCFLAGS = -DNSS_DT_SUPPORT=1 -DNSS_F
|
||||
ccflags-y += -I$(obj)
|
||||
endif
|
||||
|
||||
+# Fabric scaling is supported in 3.14 and 4.4 only
|
||||
+ifneq ($(findstring 3.14, $(KERNELVERSION)),)
|
||||
+NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1
|
||||
+else ifneq ($(findstring 4.4, $(KERNELVERSION)),)
|
||||
+NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=1
|
||||
+else
|
||||
NSS_CCFLAGS += -DNSS_FABRIC_SCALING_SUPPORT=0
|
||||
+endif
|
||||
|
||||
# Disable Frequency scaling
|
||||
ifeq "$(NSS_FREQ_SCALE_DISABLE)" "y"
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -458,16 +458,20 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
@@ -65,9 +65,9 @@ int nss_hal_firmware_load(struct nss_ctx
|
||||
int rc;
|
||||
|
||||
+#ifdef NSS_DRV_PPPOE_ENABLE
|
||||
if (npd->pppoe_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->pppoe_handler_id = nss_dev->id;
|
||||
nss_pppoe_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
+#ifdef NSS_DRV_PPE_ENABLE
|
||||
if (npd->ppe_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->ppe_handler_id = nss_dev->id;
|
||||
nss_ppe_register_handler();
|
||||
nss_ppe_vp_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_L2TP_ENABLE
|
||||
if (npd->l2tpv2_enabled == NSS_FEATURE_ENABLED) {
|
||||
@@ -554,6 +558,7 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_WIFI_ENABLE
|
||||
if (npd->wifioffload_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->wifi_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id;
|
||||
@@ -569,6 +574,7 @@ int nss_hal_probe(struct platform_device
|
||||
nss_top->wmdb_handler_id = nss_dev->id;
|
||||
nss_wifi_mac_db_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_OAM_ENABLE
|
||||
if (npd->oam_enabled == NSS_FEATURE_ENABLED) {
|
||||
@@ -583,11 +589,13 @@ int nss_hal_probe(struct platform_device
|
||||
nss_bridge_init();
|
||||
}
|
||||
|
||||
+#ifdef NSS_DRV_VLAN_ENABLE
|
||||
if (npd->vlan_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->vlan_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VLAN] = nss_dev->id;
|
||||
nss_vlan_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_QVPN_ENABLE
|
||||
#if defined(NSS_HAL_IPQ807x_SUPPORT) || defined(NSS_HAL_IPQ60XX_SUPPORT)
|
||||
@@ -641,11 +649,13 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_MATCH_ENABLE
|
||||
if (npd->match_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->match_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_MATCH] = nss_dev->id;
|
||||
nss_match_init();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
#ifdef NSS_DRV_TLS_ENABLE
|
||||
if (nss_ctx->id == 0) {
|
||||
- rc = request_firmware(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev));
|
||||
+ rc = firmware_request_nowarn(&nss_fw, NSS_AP0_IMAGE, &(nss_dev->dev));
|
||||
} else if (nss_ctx->id == 1) {
|
||||
- rc = request_firmware(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev));
|
||||
+ rc = firmware_request_nowarn(&nss_fw, NSS_AP1_IMAGE, &(nss_dev->dev));
|
||||
} else {
|
||||
nss_warning("%px: Invalid nss dev: %d\n", nss_ctx, nss_ctx->id);
|
||||
return -EINVAL;
|
||||
--- a/nss_init.c
|
||||
+++ b/nss_init.c
|
||||
@@ -771,11 +771,12 @@ static int __init nss_init(void)
|
||||
*/
|
||||
nss_project_register_sysctl();
|
||||
|
||||
+#ifdef NSS_DRV_PPPOE_ENABLE
|
||||
/*
|
||||
* Registering sysctl for pppoe specific config.
|
||||
*/
|
||||
nss_pppoe_register_sysctl();
|
||||
-
|
||||
+#endif
|
||||
/*
|
||||
* Setup Runtime Sample values
|
||||
*/
|
||||
@@ -860,9 +861,9 @@ static int __init nss_init(void)
|
||||
/*
|
||||
* INIT ppe on supported platform
|
||||
*/
|
||||
- if (of_machine_is_compatible("qcom,ipq807x") || of_machine_is_compatible("qcom,ipq8074")|| of_machine_is_compatible("qcom,ipq6018")) {
|
||||
- nss_ppe_init();
|
||||
- }
|
||||
+#ifdef NSS_DRV_PPE_ENABLE
|
||||
+ nss_ppe_init();
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_DMA_ENABLE
|
||||
nss_dma_init();
|
||||
@@ -902,10 +903,12 @@ static void __exit nss_cleanup(void)
|
||||
nss_c2c_tx_unregister_sysctl();
|
||||
@@ -935,6 +935,13 @@ nss_info("Init NSS driver");
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_PPPOE_ENABLE
|
||||
/*
|
||||
* Unregister pppoe specific sysctl
|
||||
*/
|
||||
nss_pppoe_unregister_sysctl();
|
||||
+ * Init Wi-Fi mesh
|
||||
+ */
|
||||
+#ifdef NSS_DRV_WIFI_MESH_ENABLE
|
||||
+ nss_wifi_mesh_init();
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Unregister ipv4/6 specific sysctl
|
||||
@@ -925,9 +928,9 @@ static void __exit nss_cleanup(void)
|
||||
/*
|
||||
* cleanup ppe on supported platform
|
||||
+
|
||||
+ /*
|
||||
* Register platform_driver
|
||||
*/
|
||||
- if (of_machine_is_compatible("qcom,ipq807x") || of_machine_is_compatible("qcom,ipq6018")) {
|
||||
- nss_ppe_free();
|
||||
- }
|
||||
+#ifdef NSS_DRV_PPE_ENABLE
|
||||
+ nss_ppe_free();
|
||||
+#endif
|
||||
|
||||
platform_driver_unregister(&nss_driver);
|
||||
}
|
||||
return platform_driver_register(&nss_driver);
|
||||
|
||||
@ -1,716 +0,0 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -8,8 +8,6 @@ obj-m += qca-nss-drv.o
|
||||
# List the files that belong to the driver in alphabetical order.
|
||||
#
|
||||
qca-nss-drv-objs := \
|
||||
- nss_bridge.o \
|
||||
- nss_bridge_log.o \
|
||||
nss_cmn.o \
|
||||
nss_core.o \
|
||||
nss_coredump.o \
|
||||
@@ -18,9 +16,6 @@ qca-nss-drv-objs := \
|
||||
nss_dynamic_interface.o \
|
||||
nss_dynamic_interface_log.o \
|
||||
nss_dynamic_interface_stats.o \
|
||||
- nss_edma.o \
|
||||
- nss_edma_stats.o \
|
||||
- nss_edma_strings.o \
|
||||
nss_eth_rx.o \
|
||||
nss_eth_rx_stats.o \
|
||||
nss_eth_rx_strings.o \
|
||||
@@ -32,16 +27,6 @@ qca-nss-drv-objs := \
|
||||
nss_ipv4_stats.o \
|
||||
nss_ipv4_strings.o \
|
||||
nss_ipv4_log.o \
|
||||
- nss_ipv4_reasm.o \
|
||||
- nss_ipv4_reasm_stats.o \
|
||||
- nss_ipv4_reasm_strings.o \
|
||||
- nss_ipv6.o \
|
||||
- nss_ipv6_stats.o \
|
||||
- nss_ipv6_strings.o \
|
||||
- nss_ipv6_log.o \
|
||||
- nss_ipv6_reasm.o \
|
||||
- nss_ipv6_reasm_stats.o \
|
||||
- nss_ipv6_reasm_strings.o \
|
||||
nss_log.o \
|
||||
nss_lso_rx.o \
|
||||
nss_lso_rx_stats.o \
|
||||
@@ -104,6 +89,21 @@ qca-nss-drv-objs += nss_wifi.o \
|
||||
nss_wifi_mac_db.o
|
||||
endif
|
||||
|
||||
+ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_BRIDGE_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_bridge.o \
|
||||
+ nss_bridge_log.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_IPV4_REASM_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV4_REASM_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_ipv4_reasm.o \
|
||||
+ nss_ipv4_reasm_stats.o \
|
||||
+ nss_ipv4_reasm_strings.o
|
||||
+endif
|
||||
+
|
||||
ifneq "$(NSS_DRV_L2TP_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_L2TP_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
@@ -128,20 +128,20 @@ qca-nss-drv-objs += \
|
||||
nss_pvxlan_stats.o
|
||||
endif
|
||||
|
||||
-ifneq "$(NSS_DRV_MATCH_ENABLE)" "n"
|
||||
-ccflags-y += -DNSS_DRV_MATCH_ENABLE
|
||||
+ifneq "$(NSS_DRV_IPV6_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV6_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
- nss_match.o \
|
||||
- nss_match_log.o \
|
||||
- nss_match_stats.o
|
||||
+ nss_ipv6.o \
|
||||
+ nss_ipv6_stats.o \
|
||||
+ nss_ipv6_strings.o \
|
||||
+ nss_ipv6_log.o
|
||||
+ifneq "$(NSS_DRV_IPV6_REASM_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_IPV6_REASM_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_ipv6_reasm.o \
|
||||
+ nss_ipv6_reasm_stats.o \
|
||||
+ nss_ipv6_reasm_strings.o
|
||||
endif
|
||||
-
|
||||
-ifneq "$(NSS_DRV_MIRROR_ENABLE)" "n"
|
||||
-ccflags-y += -DNSS_DRV_MIRROR_ENABLE
|
||||
-qca-nss-drv-objs += \
|
||||
- nss_mirror.o \
|
||||
- nss_mirror_log.o \
|
||||
- nss_mirror_stats.o
|
||||
endif
|
||||
|
||||
ifneq "$(NSS_DRV_TSTAMP_ENABLE)" "n"
|
||||
@@ -292,17 +292,6 @@ qca-nss-drv-objs += \
|
||||
nss_clmap_stats.o
|
||||
endif
|
||||
|
||||
-ifneq "$(NSS_DRV_C2C_ENABLE)" "n"
|
||||
-ccflags-y += -DNSS_DRV_C2C_ENABLE
|
||||
-qca-nss-drv-objs += \
|
||||
- nss_c2c_tx.o \
|
||||
- nss_c2c_tx_log.o \
|
||||
- nss_c2c_tx_stats.o \
|
||||
- nss_c2c_tx_strings.o \
|
||||
- nss_c2c_rx.o \
|
||||
- nss_c2c_rx_stats.o \
|
||||
- nss_c2c_rx_strings.o
|
||||
-endif
|
||||
|
||||
ifneq "$(NSS_DRV_VXLAN_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_VXLAN_ENABLE
|
||||
@@ -312,10 +301,37 @@ qca-nss-drv-objs += \
|
||||
nss_vxlan_stats.o
|
||||
endif
|
||||
|
||||
-ifeq ($(SoC),$(filter $(SoC),ipq806x ipq40xx))
|
||||
+ifneq "$(NSS_DRV_MATCH_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_MATCH_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_match.o \
|
||||
+ nss_match_log.o \
|
||||
+ nss_match_stats.o
|
||||
+endif
|
||||
+
|
||||
+ifneq "$(NSS_DRV_MIRROR_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_MIRROR_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_mirror.o \
|
||||
+ nss_mirror_log.o \
|
||||
+ nss_mirror_stats.o
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(SoC),$(filter $(SoC),ipq806x))
|
||||
qca-nss-drv-objs += nss_data_plane/nss_data_plane_gmac.o \
|
||||
nss_hal/ipq806x/nss_hal_pvt.o
|
||||
|
||||
+ifneq "$(NSS_DRV_C2C_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_C2C_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_c2c_tx.o \
|
||||
+ nss_c2c_tx_log.o \
|
||||
+ nss_c2c_tx_stats.o \
|
||||
+ nss_c2c_tx_strings.o \
|
||||
+ nss_c2c_rx.o \
|
||||
+ nss_c2c_rx_stats.o \
|
||||
+ nss_c2c_rx_strings.o
|
||||
+endif
|
||||
ifneq "$(NSS_DRV_IPSEC_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_IPSEC_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
@@ -342,6 +358,9 @@ endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64 ipq807x ipq807x_64))
|
||||
qca-nss-drv-objs += nss_data_plane/nss_data_plane.o \
|
||||
+ nss_edma.o \
|
||||
+ nss_edma_stats.o \
|
||||
+ nss_edma_strings.o \
|
||||
nss_ppe.o \
|
||||
nss_ppe_log.o \
|
||||
nss_ppe_stats.o \
|
||||
@@ -382,9 +401,9 @@ endif
|
||||
ifneq "$(NSS_DRV_QVPN_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_QVPN_ENABLE
|
||||
qca-nss-drv-objs += \
|
||||
- nss_qvpn.o \
|
||||
- nss_qvpn_stats.o \
|
||||
- nss_qvpn_log.o
|
||||
+ nss_qvpn.o \
|
||||
+ nss_qvpn_log.o \
|
||||
+ nss_qvpn_stats.o
|
||||
endif
|
||||
ifneq "$(NSS_DRV_TLS_ENABLE)" "n"
|
||||
ccflags-y += -DNSS_DRV_TLS_ENABLE
|
||||
@@ -397,6 +416,17 @@ endif
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
|
||||
qca-nss-drv-objs += nss_hal/ipq807x/nss_hal_pvt.o \
|
||||
nss_data_plane/hal/nss_ipq807x.o
|
||||
+ifneq "$(NSS_DRV_C2C_ENABLE)" "n"
|
||||
+ccflags-y += -DNSS_DRV_C2C_ENABLE
|
||||
+qca-nss-drv-objs += \
|
||||
+ nss_c2c_tx.o \
|
||||
+ nss_c2c_tx_log.o \
|
||||
+ nss_c2c_tx_stats.o \
|
||||
+ nss_c2c_tx_strings.o \
|
||||
+ nss_c2c_rx.o \
|
||||
+ nss_c2c_rx_stats.o \
|
||||
+ nss_c2c_rx_strings.o
|
||||
+endif
|
||||
ccflags-y += -I$(obj)/nss_hal/ipq807x -DNSS_HAL_IPQ807x_SUPPORT -DNSS_MULTI_H2N_DATA_RING_SUPPORT
|
||||
endif
|
||||
|
||||
@@ -437,7 +467,7 @@ endif
|
||||
ccflags-y += -I$(obj)/nss_hal/include -I$(obj)/nss_data_plane/include -I$(obj)/exports -DNSS_DEBUG_LEVEL=0 -DNSS_PKT_STATS_ENABLED=1
|
||||
ccflags-y += -I$(obj)/nss_data_plane/hal/include
|
||||
ccflags-y += -DNSS_PM_DEBUG_LEVEL=0 -DNSS_SKB_REUSE_SUPPORT=1
|
||||
-ccflags-y += -Werror
|
||||
+ccflags-y += -Wall -Werror
|
||||
|
||||
KERNELVERSION := $(word 1, $(subst ., ,$(KERNELVERSION))).$(word 2, $(subst ., ,$(KERNELVERSION)))
|
||||
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -895,7 +895,7 @@ static inline void nss_core_handle_buffe
|
||||
/*
|
||||
* linearize or free if requested.
|
||||
*/
|
||||
- if (unlikely(skb_is_nonlinear(nbuf))) {
|
||||
+ if (unlikely(skb_is_nonlinear(nbuf))) {
|
||||
if (nss_core_skb_needs_linearize(nbuf, ndev->features) && __skb_linearize(nbuf)) {
|
||||
dev_kfree_skb_any(nbuf);
|
||||
return;
|
||||
@@ -953,11 +953,11 @@ static inline void nss_core_handle_ext_b
|
||||
ext_cb = subsys_dp_reg->ext_cb;
|
||||
if (likely(ext_cb) && likely(ndev)) {
|
||||
|
||||
- if (unlikely(skb_is_nonlinear(nbuf))) {
|
||||
+ if (unlikely(skb_is_nonlinear(nbuf))) {
|
||||
if (nss_core_skb_needs_linearize(nbuf, ndev->features) && __skb_linearize(nbuf)) {
|
||||
/*
|
||||
- * We needed to linearize, but __skb_linearize() failed. So free the nbuf.
|
||||
- */
|
||||
+ * We needed to linearize, but __skb_linearize() failed. So free the nbuf.
|
||||
+ */
|
||||
dev_kfree_skb_any(nbuf);
|
||||
return;
|
||||
}
|
||||
@@ -1067,6 +1067,21 @@ static inline void nss_core_rx_pbuf(stru
|
||||
}
|
||||
|
||||
/*
|
||||
+ * nss_core_set_skb_classify()
|
||||
+ * Set skb field to avoid ingress shaping.
|
||||
+ */
|
||||
+static inline void nss_core_set_skb_classify(struct sk_buff *nbuf)
|
||||
+{
|
||||
+#ifdef CONFIG_NET_CLS_ACT
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0))
|
||||
+ nbuf->tc_verd = SET_TC_NCLS_NSS(nbuf->tc_verd);
|
||||
+#else
|
||||
+ skb_skip_tc_classify(nbuf);
|
||||
+#endif
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* nss_core_handle_nrfrag_skb()
|
||||
* Handled the processing of fragmented skb's
|
||||
*/
|
||||
@@ -1119,9 +1134,10 @@ static inline bool nss_core_handle_nr_fr
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
+ nss_core_set_skb_classify(nbuf);
|
||||
}
|
||||
#endif
|
||||
+
|
||||
goto pull;
|
||||
}
|
||||
|
||||
@@ -1159,7 +1175,7 @@ static inline bool nss_core_handle_nr_fr
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
+ nss_core_set_skb_classify(nbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1274,7 +1290,7 @@ static inline bool nss_core_handle_linea
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
+ nss_core_set_skb_classify(nbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1332,7 +1348,7 @@ static inline bool nss_core_handle_linea
|
||||
* ingress shaped flag set.
|
||||
*/
|
||||
if (unlikely(desc->bit_flags & N2H_BIT_FLAG_INGRESS_SHAPED)) {
|
||||
- nbuf->tc_verd_qca_nss = SET_TC_NCLS_NSS(nbuf->tc_verd_qca_nss);
|
||||
+ nss_core_set_skb_classify(nbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1702,7 +1718,7 @@ static void nss_core_init_nss(struct nss
|
||||
if (nss_ctx->id) {
|
||||
ret = nss_n2h_update_queue_config_async(nss_ctx, pn_mq_en, pn_qlimits);
|
||||
if (ret != NSS_TX_SUCCESS) {
|
||||
- nss_warning("Failed to send pnode queue config to core 1\n");
|
||||
+ nss_warning("%px: Failed to send pnode queue config to core 1\n", nss_ctx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1717,9 +1733,14 @@ static void nss_core_init_nss(struct nss
|
||||
* connections supported by the accelerator.
|
||||
*/
|
||||
nss_ipv4_conn_cfg = max_ipv4_conn;
|
||||
+
|
||||
+#ifdef NSS_DRV_IPV6_ENABLE
|
||||
nss_ipv6_conn_cfg = max_ipv6_conn;
|
||||
nss_ipv4_update_conn_count(max_ipv4_conn);
|
||||
nss_ipv6_update_conn_count(max_ipv6_conn);
|
||||
+#else
|
||||
+ nss_ipv4_update_conn_count(max_ipv4_conn);
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_MEM_PROFILE_LOW
|
||||
/*
|
||||
--- a/nss_core.h
|
||||
+++ b/nss_core.h
|
||||
@@ -232,6 +232,8 @@ static inline void nss_core_dma_cache_ma
|
||||
* INFO: The LOW and MAX value together describe the "performance" band that we should operate the frequency at.
|
||||
*
|
||||
*/
|
||||
+#define NSS_FREQ_SCALE_NA 0xFAADFAAD /* Frequency scale not supported */
|
||||
+
|
||||
#define NSS_FREQ_110 110000000 /* Frequency in hz */
|
||||
#define NSS_FREQ_110_MIN 0x03000 /* Instructions Per ms Min */
|
||||
#define NSS_FREQ_110_MAX 0x07000 /* Instructions Per ms Max */
|
||||
--- a/nss_coredump.c
|
||||
+++ b/nss_coredump.c
|
||||
@@ -1,6 +1,8 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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.
|
||||
@@ -47,7 +49,8 @@ static struct workqueue_struct *coredump
|
||||
*/
|
||||
static void nss_coredump_wait(struct work_struct *work)
|
||||
{
|
||||
- panic("did not get all coredump finished signals\n");
|
||||
+ if (!(nss_cmd_buf.coredump & 0xFFFFFFFE))
|
||||
+ panic("did not get all coredump finished signals\n");
|
||||
}
|
||||
|
||||
/*
|
||||
--- a/nss_dma.c
|
||||
+++ b/nss_dma.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2020-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
|
||||
@@ -120,7 +120,7 @@ static void nss_dma_msg_handler(struct n
|
||||
*/
|
||||
if (ndm->cm.type == NSS_DMA_MSG_TYPE_SYNC_STATS) {
|
||||
nss_dma_stats_sync(nss_ctx, &ndm->msg.stats);
|
||||
-
|
||||
+ nss_dma_stats_notify(nss_ctx);
|
||||
}
|
||||
|
||||
/*
|
||||
--- a/nss_dma_stats.c
|
||||
+++ b/nss_dma_stats.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2020-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
|
||||
@@ -17,10 +17,16 @@
|
||||
*/
|
||||
|
||||
#include "nss_core.h"
|
||||
+#include "nss_dma.h"
|
||||
#include "nss_dma_stats.h"
|
||||
#include "nss_dma_strings.h"
|
||||
|
||||
/*
|
||||
+ * Declare atomic notifier data structure for statistics.
|
||||
+ */
|
||||
+ATOMIC_NOTIFIER_HEAD(nss_dma_stats_notifier);
|
||||
+
|
||||
+/*
|
||||
* Spinlock to protect DMA statistics update/read
|
||||
*/
|
||||
DEFINE_SPINLOCK(nss_dma_stats_lock);
|
||||
@@ -117,3 +123,41 @@ void nss_dma_stats_sync(struct nss_ctx_i
|
||||
|
||||
spin_unlock_bh(&nss_dma_stats_lock);
|
||||
}
|
||||
+
|
||||
+/*
|
||||
+ * nss_dma_stats_notify()
|
||||
+ * Sends notifications to all the registered modules.
|
||||
+ *
|
||||
+ * Leverage NSS-FW statistics timing to update Netlink.
|
||||
+ */
|
||||
+void nss_dma_stats_notify(struct nss_ctx_instance *nss_ctx)
|
||||
+{
|
||||
+ struct nss_dma_stats_notification dma_stats;
|
||||
+
|
||||
+ spin_lock_bh(&nss_dma_stats_lock);
|
||||
+ dma_stats.core_id = nss_ctx->id;
|
||||
+ memcpy(dma_stats.stats_ctx, nss_dma_stats, sizeof(dma_stats.stats_ctx));
|
||||
+ spin_unlock_bh(&nss_dma_stats_lock);
|
||||
+
|
||||
+ atomic_notifier_call_chain(&nss_dma_stats_notifier, NSS_STATS_EVENT_NOTIFY, &dma_stats);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * nss_dma_stats_unregister_notifier()
|
||||
+ * Deregisters statistics notifier.
|
||||
+ */
|
||||
+int nss_dma_stats_unregister_notifier(struct notifier_block *nb)
|
||||
+{
|
||||
+ return atomic_notifier_chain_unregister(&nss_dma_stats_notifier, nb);
|
||||
+}
|
||||
+EXPORT_SYMBOL(nss_dma_stats_unregister_notifier);
|
||||
+
|
||||
+/*
|
||||
+ * nss_dma_stats_register_notifier()
|
||||
+ * Registers statistics notifier.
|
||||
+ */
|
||||
+int nss_dma_stats_register_notifier(struct notifier_block *nb)
|
||||
+{
|
||||
+ return atomic_notifier_chain_register(&nss_dma_stats_notifier, nb);
|
||||
+}
|
||||
+EXPORT_SYMBOL(nss_dma_stats_register_notifier);
|
||||
--- a/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
+++ b/nss_hal/ipq806x/nss_hal_pvt.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2013, 2015-2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2013, 2015-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.
|
||||
@@ -464,6 +464,7 @@ static struct nss_platform_data *__nss_h
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ nss_assert(npd->vphys);
|
||||
npd->vmap = ioremap_cache(npd->vphys, resource_size(&res_vphys));
|
||||
if (!npd->vmap) {
|
||||
nss_info_always("%px: nss%d: ioremap() fail for vphys\n", nss_ctx, nss_ctx->id);
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2016-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.
|
||||
@@ -41,7 +41,6 @@
|
||||
/*
|
||||
* Macros
|
||||
*/
|
||||
-#define MIN_IMG_SIZE (64*1024)
|
||||
#define NSS_AP0_IMAGE "qca-nss0.bin"
|
||||
#define NSS_AP1_IMAGE "qca-nss1.bin"
|
||||
|
||||
@@ -74,10 +73,6 @@ int nss_hal_firmware_load(struct nss_ctx
|
||||
return rc;
|
||||
}
|
||||
|
||||
- if (nss_fw->size < MIN_IMG_SIZE) {
|
||||
- nss_info_always("%px: nss firmware is truncated, size:%d", nss_ctx, (int)nss_fw->size);
|
||||
- return rc;
|
||||
- }
|
||||
|
||||
load_mem = ioremap(npd->load_addr, nss_fw->size);
|
||||
if (!load_mem) {
|
||||
@@ -293,7 +288,6 @@ int nss_hal_probe(struct platform_device
|
||||
* Physical address of logical registers space
|
||||
*/
|
||||
nss_ctx->vphys = npd->vphys;
|
||||
- nss_assert(nss_ctx->vphys);
|
||||
nss_info("%d:ctx=%px, vphys=%x, vmap=%px, nphys=%x, nmap=%px", nss_ctx->id,
|
||||
nss_ctx, nss_ctx->vphys, nss_ctx->vmap, nss_ctx->nphys, nss_ctx->nmap);
|
||||
|
||||
@@ -364,8 +358,10 @@ int nss_hal_probe(struct platform_device
|
||||
nss_top->ipv4_handler_id = nss_dev->id;
|
||||
nss_ipv4_register_handler();
|
||||
|
||||
+#ifdef NSS_DRV_EDMA_ENABLE
|
||||
nss_top->edma_handler_id = nss_dev->id;
|
||||
nss_edma_register_handler();
|
||||
+#endif
|
||||
nss_eth_rx_register_handler(nss_ctx);
|
||||
#ifdef NSS_DRV_LAG_ENABLE
|
||||
nss_lag_register_handler();
|
||||
@@ -389,20 +385,27 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
+
|
||||
+#ifdef NSS_DRV_IPV4_REASM_ENABLE
|
||||
if (npd->ipv4_reasm_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->ipv4_reasm_handler_id = nss_dev->id;
|
||||
nss_ipv4_reasm_register_handler();
|
||||
}
|
||||
+#endif
|
||||
|
||||
+#ifdef NSS_DRV_IPV6_ENABLE
|
||||
if (npd->ipv6_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->ipv6_handler_id = nss_dev->id;
|
||||
nss_ipv6_register_handler();
|
||||
}
|
||||
|
||||
+#ifdef NSS_DRV_IPV6_REASM_ENABLE
|
||||
if (npd->ipv6_reasm_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->ipv6_reasm_handler_id = nss_dev->id;
|
||||
nss_ipv6_reasm_register_handler();
|
||||
}
|
||||
+#endif
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_CRYPTO_ENABLE
|
||||
/*
|
||||
@@ -583,11 +586,13 @@ int nss_hal_probe(struct platform_device
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef NSS_DRV_BRIDGE_ENABLE
|
||||
if (npd->bridge_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->bridge_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE] = nss_dev->id;
|
||||
nss_bridge_init();
|
||||
}
|
||||
+#endif
|
||||
|
||||
#ifdef NSS_DRV_VLAN_ENABLE
|
||||
if (npd->vlan_enabled == NSS_FEATURE_ENABLED) {
|
||||
--- a/nss_hlos_if.h
|
||||
+++ b/nss_hlos_if.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2013-2019, 2021, The Linux Foundation. All rights reserved.
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all copies.
|
||||
@@ -33,7 +33,11 @@
|
||||
*/
|
||||
#if defined (NSS_MEM_PROFILE_LOW)
|
||||
#define NSS_DEFAULT_NUM_CONN 512 /* Default number of connections for IPv4 and IPv6 each, for low memory profile */
|
||||
+#if defined (NSS_DRV_IPV6_ENABLE)
|
||||
#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 1024 /* MAX Connection shared between IPv4 and IPv6 for low memory profile */
|
||||
+#else
|
||||
+#define NSS_MAX_TOTAL_NUM_CONN_IPV4_IPV6 512 /* MAX Connection for IPv4 for low memory profile */
|
||||
+#endif
|
||||
#define NSS_LOW_MEM_EMPTY_POOL_BUF_SZ 4096 /* Default empty buffer pool size for low profile */
|
||||
#elif defined (NSS_MEM_PROFILE_MEDIUM)
|
||||
#define NSS_DEFAULT_NUM_CONN 2048 /* Default number of connections for IPv4 and IPv6 each, for medium memory profile */
|
||||
--- a/nss_init.c
|
||||
+++ b/nss_init.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2013-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.
|
||||
@@ -307,7 +307,9 @@ static int nss_get_freq_table_handler(st
|
||||
|
||||
i = 0;
|
||||
while (i < NSS_FREQ_MAX_SCALE) {
|
||||
- printk("%d Hz ", nss_runtime_samples.freq_scale[i].frequency);
|
||||
+ if (nss_runtime_samples.freq_scale[i].frequency != NSS_FREQ_SCALE_NA) {
|
||||
+ printk("%d Hz ", nss_runtime_samples.freq_scale[i].frequency);
|
||||
+ }
|
||||
i++;
|
||||
}
|
||||
printk("\n");
|
||||
@@ -738,7 +740,9 @@ static int __init nss_init(void)
|
||||
* Registering sysctl for ipv4/6 specific config.
|
||||
*/
|
||||
nss_ipv4_register_sysctl();
|
||||
+#ifdef NSS_DRV_IPV6_ENABLE
|
||||
nss_ipv6_register_sysctl();
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Registering sysctl for n2h specific config.
|
||||
@@ -911,16 +915,15 @@ static void __exit nss_cleanup(void)
|
||||
#endif
|
||||
|
||||
/*
|
||||
- * Unregister ipv4/6 specific sysctl
|
||||
+ * Unregister ipv4/6 specific sysctl and free allocated to connection tables
|
||||
*/
|
||||
nss_ipv4_unregister_sysctl();
|
||||
- nss_ipv6_unregister_sysctl();
|
||||
-
|
||||
- /*
|
||||
- * Free Memory allocated for connection tables
|
||||
- */
|
||||
nss_ipv4_free_conn_tables();
|
||||
+
|
||||
+#ifdef NSS_DRV_IPV6_ENABLE
|
||||
+ nss_ipv6_unregister_sysctl();
|
||||
nss_ipv6_free_conn_tables();
|
||||
+#endif
|
||||
|
||||
nss_project_unregister_sysctl();
|
||||
nss_data_plane_destroy_delay_work();
|
||||
--- a/nss_meminfo.c
|
||||
+++ b/nss_meminfo.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 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
|
||||
@@ -311,6 +311,15 @@ static bool nss_meminfo_init_block_lists
|
||||
switch (mtype) {
|
||||
case NSS_MEMINFO_MEMTYPE_IMEM:
|
||||
/*
|
||||
+ * For SOC's where TCM is not present
|
||||
+ */
|
||||
+ if (!nss_ctx->vphys) {
|
||||
+ nss_info_always("%px:IMEM requested but TCM not defined "
|
||||
+ "for this SOC\n", nss_ctx);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
* Return SoC real address for IMEM as DMA address.
|
||||
*/
|
||||
dma_addr = nss_meminfo_alloc_imem(nss_ctx, r->size, r->alignment);
|
||||
@@ -453,6 +462,15 @@ static bool nss_meminfo_allocate_n2h_h2n
|
||||
}
|
||||
break;
|
||||
case NSS_MEMINFO_MEMTYPE_IMEM:
|
||||
+ /*
|
||||
+ * For SOC's where TCM is not present
|
||||
+ */
|
||||
+ if (!nss_ctx->vphys) {
|
||||
+ nss_info_always("%px:IMEM requested but TCM not defined "
|
||||
+ "for this SOC\n", nss_ctx);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
info->dma_addr = nss_meminfo_alloc_imem(nss_ctx, info->total_size, L1_CACHE_BYTES);
|
||||
if (!info->dma_addr)
|
||||
return false;
|
||||
@@ -517,6 +535,13 @@ static bool nss_meminfo_configure_n2h_h2
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Returning true allows to execute firmware bin
|
||||
+ */
|
||||
+ if (!mem_ctx->if_map) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
* Bring a fresh copy of if_map from memory in order to read it correctly.
|
||||
*/
|
||||
if_map = mem_ctx->if_map;
|
||||
@@ -705,7 +730,6 @@ bool nss_meminfo_init(struct nss_ctx_ins
|
||||
struct nss_meminfo_map *map;
|
||||
struct nss_top_instance *nss_top = &nss_top_main;
|
||||
|
||||
- NSS_VERIFY_CTX_MAGIC(nss_ctx);
|
||||
mem_ctx = &nss_ctx->meminfo_ctx;
|
||||
|
||||
/*
|
||||
--- a/nss_profiler.c
|
||||
+++ b/nss_profiler.c
|
||||
@@ -153,8 +153,10 @@ void nss_profiler_release_dma(struct nss
|
||||
|
||||
ctrl = nss_ctx->meminfo_ctx.sdma_ctrl;
|
||||
|
||||
- if (ctrl && ctrl->consumer[0].ring.kp)
|
||||
+ if (ctrl && ctrl->consumer[0].ring.kp) {
|
||||
kfree(ctrl->consumer[0].ring.kp);
|
||||
+ ctrl->consumer[0].ring.kp = NULL;
|
||||
+ }
|
||||
}
|
||||
EXPORT_SYMBOL(nss_profiler_release_dma);
|
||||
|
||||
@@ -198,10 +200,12 @@ EXPORT_SYMBOL(nss_profile_dma_deregister
|
||||
struct nss_profile_sdma_ctrl *nss_profile_dma_get_ctrl(struct nss_ctx_instance *nss_ctx)
|
||||
{
|
||||
struct nss_profile_sdma_ctrl *ctrl = nss_ctx->meminfo_ctx.sdma_ctrl;
|
||||
- if (ctrl) {
|
||||
- dmac_inv_range(ctrl, &ctrl->cidx);
|
||||
- dsb(sy);
|
||||
+ if (!ctrl) {
|
||||
+ return ctrl;
|
||||
}
|
||||
+
|
||||
+ dmac_inv_range(ctrl, &ctrl->cidx);
|
||||
+ dsb(sy);
|
||||
return ctrl;
|
||||
}
|
||||
EXPORT_SYMBOL(nss_profile_dma_get_ctrl);
|
||||
@@ -233,7 +237,7 @@ void nss_profiler_notify_unregister(nss_
|
||||
{
|
||||
nss_assert(core_id < NSS_CORE_MAX);
|
||||
|
||||
- nss_core_register_handler(&nss_top_main.nss[core_id], NSS_PROFILER_INTERFACE, NULL, NULL);
|
||||
+ nss_core_unregister_handler(&nss_top_main.nss[core_id], NSS_PROFILER_INTERFACE);
|
||||
nss_top_main.profiler_callback[core_id] = NULL;
|
||||
nss_top_main.profiler_ctx[core_id] = NULL;
|
||||
}
|
||||
2861
qca-nss-drv/patches/0013-backport-12.4.patch
Normal file
2861
qca-nss-drv/patches/0013-backport-12.4.patch
Normal file
File diff suppressed because it is too large
Load Diff
12
qca-nss-drv/patches/0013-nss-drv-remove-legacy-wifi.patch
Normal file
12
qca-nss-drv/patches/0013-nss-drv-remove-legacy-wifi.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -593,7 +593,9 @@ int nss_hal_probe(struct platform_device
|
||||
if (npd->wifioffload_enabled == NSS_FEATURE_ENABLED) {
|
||||
nss_top->wifi_handler_id = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id;
|
||||
+#if defined(NSS_HAL_IPQ806x_SUPPORT)
|
||||
nss_wifi_register_handler();
|
||||
+#endif
|
||||
nss_wifili_register_handler();
|
||||
#ifdef NSS_DRV_WIFI_EXT_VDEV_ENABLE
|
||||
nss_wifi_ext_vdev_register_handler();
|
||||
@ -0,0 +1,14 @@
|
||||
--- a/nss_stats.c
|
||||
+++ b/nss_stats.c
|
||||
@@ -380,8 +380,9 @@ size_t nss_stats_print(char *node, char
|
||||
*/
|
||||
void nss_stats_create_dentry(char *name, const struct file_operations *ops)
|
||||
{
|
||||
- if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
|
||||
- nss_warning("Failed to create debug entry for subsystem %s\n", name);
|
||||
+ if (!debugfs_lookup(name, nss_top_main.stats_dentry))
|
||||
+ if (!debugfs_create_file(name, 0400, nss_top_main.stats_dentry, &nss_top_main, ops)) {
|
||||
+ nss_warning("Failed to create debug entry for subsystem %s\n", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,393 +0,0 @@
|
||||
--- a/exports/nss_tunipip6.h
|
||||
+++ b/exports/nss_tunipip6.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2014, 2017-2018, 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2014, 2017-2018, 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.
|
||||
@@ -30,18 +30,16 @@
|
||||
#define NSS_TUNIPIP6_MAX_FMR_NUMBER 4 /**< Maximum number of forward mapping rule (FMR). */
|
||||
|
||||
/**
|
||||
- * nss_tunipip6_map_rule
|
||||
- * Mapping rule (FMR/BMR) for forwarding traffic to the node in the same domain.
|
||||
+ * nss_tunipip6_fmr
|
||||
+ * Forward mapping rule (FMR) for direct forwarding traffic to the node in the same domain.
|
||||
*/
|
||||
-struct nss_tunipip6_map_rule {
|
||||
+struct nss_tunipip6_fmr {
|
||||
uint32_t ip6_prefix[4]; /**< An IPv6 prefix assigned by a mapping rule. */
|
||||
uint32_t ip4_prefix; /**< An IPv4 prefix assigned by a mapping rule. */
|
||||
uint32_t ip6_prefix_len; /**< IPv6 prefix length. */
|
||||
uint32_t ip4_prefix_len; /**< IPv4 prefix length. */
|
||||
- uint32_t ip6_suffix[4]; /**< IPv6 suffix. */
|
||||
- uint32_t ip6_suffix_len; /**< IPv6 suffix length. */
|
||||
uint32_t ea_len; /**< Embedded Address (EA) bits. */
|
||||
- uint32_t psid_offset; /**< PSID offset default 6. */
|
||||
+ uint32_t offset; /**< PSID offset default 6. */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -52,11 +50,6 @@ enum nss_tunipip6_metadata_types {
|
||||
NSS_TUNIPIP6_TX_ENCAP_IF_CREATE,
|
||||
NSS_TUNIPIP6_TX_DECAP_IF_CREATE,
|
||||
NSS_TUNIPIP6_RX_STATS_SYNC,
|
||||
- NSS_TUNIPIP6_FMR_RULE_ADD,
|
||||
- NSS_TUNIPIP6_FMR_RULE_DEL,
|
||||
- NSS_TUNIPIP6_FMR_RULE_FLUSH,
|
||||
- NSS_TUNIPIP6_BMR_RULE_ADD,
|
||||
- NSS_TUNIPIP6_BMR_RULE_DEL,
|
||||
NSS_TUNIPIP6_MAX,
|
||||
};
|
||||
|
||||
@@ -65,16 +58,16 @@ enum nss_tunipip6_metadata_types {
|
||||
* Payload for configuring the DS-Lite interface.
|
||||
*/
|
||||
struct nss_tunipip6_create_msg {
|
||||
+ struct nss_tunipip6_fmr fmr[NSS_TUNIPIP6_MAX_FMR_NUMBER]; /**< Tunnel FMR array. */
|
||||
uint32_t saddr[4]; /**< Tunnel source address. */
|
||||
uint32_t daddr[4]; /**< Tunnel destination address. */
|
||||
uint32_t flowlabel; /**< Tunnel IPv6 flow label. */
|
||||
uint32_t flags; /**< Tunnel additional flags. */
|
||||
+ uint32_t fmr_number; /**< Tunnel FMR number. */
|
||||
uint32_t sibling_if_num; /**< Sibling interface number. */
|
||||
+ uint16_t reserved1; /**< Reserved for alignment. */
|
||||
uint8_t hop_limit; /**< Tunnel IPv6 hop limit. */
|
||||
uint8_t draft03; /**< Use MAP-E draft03 specification. */
|
||||
- bool ttl_inherit; /**< Inherit IPv4 TTL to hoplimit. */
|
||||
- bool tos_inherit; /**< Inherit IPv4 ToS. */
|
||||
- bool frag_id_update; /**< Enable update of fragment identifier of IPv4. */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -97,12 +90,10 @@ struct nss_tunipip6_msg {
|
||||
*/
|
||||
union {
|
||||
struct nss_tunipip6_create_msg tunipip6_create;
|
||||
- /**< Create a DS-Lite/IPIP6 tunnel. */
|
||||
+ /**< Create a DS-Lite tunnel. */
|
||||
struct nss_tunipip6_stats_sync_msg stats_sync;
|
||||
/**< Synchronized statistics for the DS-Lite interface. */
|
||||
- struct nss_tunipip6_map_rule map_rule;
|
||||
- /**< BMR/FMR rule to add/delete, new or existing rules. */
|
||||
- } msg; /**< Message payload for IPIP6 tunnel messages exchanged with NSS core. */
|
||||
+ } msg; /**< Message payload for IPIP6 Tunnel messages exchanged with NSS core. */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -133,22 +124,6 @@ typedef void (*nss_tunipip6_msg_callback
|
||||
extern nss_tx_status_t nss_tunipip6_tx(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg);
|
||||
|
||||
/**
|
||||
- * nss_tunipip6_tx_sync
|
||||
- * Sends a DS-Lite message to NSS core synchronously.
|
||||
- *
|
||||
- * @datatypes
|
||||
- * nss_ctx_instance \n
|
||||
- * nss_tunipip6_msg
|
||||
- *
|
||||
- * @param[in] nss_ctx Pointer to the NSS context.
|
||||
- * @param[in] msg Pointer to the message data.
|
||||
- *
|
||||
- * @return
|
||||
- * Status of the Tx operation.
|
||||
- */
|
||||
-extern nss_tx_status_t nss_tunipip6_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg);
|
||||
-
|
||||
-/**
|
||||
* Callback function for receiving DS-Lite data.
|
||||
*
|
||||
* @datatypes
|
||||
--- a/nss_tunipip6.c
|
||||
+++ b/nss_tunipip6.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2014-2018, 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2014-2018, 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.
|
||||
@@ -17,19 +17,6 @@
|
||||
#include "nss_tx_rx_common.h"
|
||||
#include "nss_tunipip6_log.h"
|
||||
|
||||
-#define NSS_TUNIPIP6_TX_TIMEOUT 3000
|
||||
-
|
||||
-/*
|
||||
- * Data structure used to handle sync message.
|
||||
- */
|
||||
-static struct nss_tunipip6_pvt {
|
||||
- struct semaphore sem; /* Semaphore structure. */
|
||||
- struct completion complete; /* Completion structure. */
|
||||
- int response; /* Response from FW. */
|
||||
- void *cb; /* Original cb for msgs. */
|
||||
- void *app_data; /* Original app_data for msgs. */
|
||||
-} tunipip6_pvt;
|
||||
-
|
||||
/*
|
||||
* nss_tunipip6_verify_if_num
|
||||
* Verify the interface is a valid interface
|
||||
@@ -70,12 +57,12 @@ static void nss_tunipip6_handler(struct
|
||||
* Is this a valid request/response packet?
|
||||
*/
|
||||
if (ncm->type >= NSS_TUNIPIP6_MAX) {
|
||||
- nss_warning("%px: received invalid message %d for DS-Lite interface", nss_ctx, ncm->type);
|
||||
+ nss_warning("%p: received invalid message %d for DS-Lite interface", nss_ctx, ncm->type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_tunipip6_msg)) {
|
||||
- nss_warning("%px: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm));
|
||||
+ nss_warning("%p: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,7 +96,7 @@ static void nss_tunipip6_handler(struct
|
||||
* call ipip6 tunnel callback
|
||||
*/
|
||||
if (!ctx) {
|
||||
- nss_warning("%px: Event received for DS-Lite tunnel interface %d before registration", nss_ctx, ncm->interface);
|
||||
+ nss_warning("%p: Event received for DS-Lite tunnel interface %d before registration", nss_ctx, ncm->interface);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,12 +120,12 @@ nss_tx_status_t nss_tunipip6_tx(struct n
|
||||
* Sanity check the message
|
||||
*/
|
||||
if (!nss_tunipip6_verify_if_num(ncm->interface)) {
|
||||
- nss_warning("%px: tx request for another interface: %d", nss_ctx, ncm->interface);
|
||||
+ nss_warning("%p: tx request for another interface: %d", nss_ctx, ncm->interface);
|
||||
return NSS_TX_FAILURE;
|
||||
}
|
||||
|
||||
if (ncm->type > NSS_TUNIPIP6_MAX) {
|
||||
- nss_warning("%px: message type out of range: %d", nss_ctx, ncm->type);
|
||||
+ nss_warning("%p: message type out of range: %d", nss_ctx, ncm->type);
|
||||
return NSS_TX_FAILURE;
|
||||
}
|
||||
|
||||
@@ -147,60 +134,6 @@ nss_tx_status_t nss_tunipip6_tx(struct n
|
||||
EXPORT_SYMBOL(nss_tunipip6_tx);
|
||||
|
||||
/*
|
||||
- * nss_tunipip6_callback()
|
||||
- * Callback to handle the completion of NSS->HLOS messages.
|
||||
- */
|
||||
-static void nss_tunipip6_callback(void *app_data, struct nss_tunipip6_msg *nclm)
|
||||
-{
|
||||
- tunipip6_pvt.response = NSS_TX_SUCCESS;
|
||||
- tunipip6_pvt.cb = NULL;
|
||||
- tunipip6_pvt.app_data = NULL;
|
||||
-
|
||||
- if (nclm->cm.response != NSS_CMN_RESPONSE_ACK) {
|
||||
- nss_warning("%px: tunipip6 Error response %d Error: %d\n", app_data, nclm->cm.response, nclm->cm.error);
|
||||
- tunipip6_pvt.response = nclm->cm.response;
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * Write memory barrier.
|
||||
- */
|
||||
- smp_wmb();
|
||||
- complete(&tunipip6_pvt.complete);
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
- * nss_tunipip6_tx_sync()
|
||||
- * Transmit a tunipip6 message to NSSFW synchronously.
|
||||
- */
|
||||
-nss_tx_status_t nss_tunipip6_tx_sync(struct nss_ctx_instance *nss_ctx, struct nss_tunipip6_msg *msg)
|
||||
-{
|
||||
- nss_tx_status_t status;
|
||||
- int ret;
|
||||
-
|
||||
- down(&tunipip6_pvt.sem);
|
||||
- msg->cm.cb = (nss_ptr_t)nss_tunipip6_callback;
|
||||
- msg->cm.app_data = (nss_ptr_t)NULL;
|
||||
-
|
||||
- status = nss_tunipip6_tx(nss_ctx, msg);
|
||||
- if (status != NSS_TX_SUCCESS) {
|
||||
- nss_warning("%px: tunipip6_tx_msg failed\n", nss_ctx);
|
||||
- up(&tunipip6_pvt.sem);
|
||||
- return status;
|
||||
- }
|
||||
-
|
||||
- ret = wait_for_completion_timeout(&tunipip6_pvt.complete, msecs_to_jiffies(NSS_TUNIPIP6_TX_TIMEOUT));
|
||||
- if (!ret) {
|
||||
- nss_warning("%px: tunipip6 tx sync failed due to timeout\n", nss_ctx);
|
||||
- tunipip6_pvt.response = NSS_TX_FAILURE;
|
||||
- }
|
||||
-
|
||||
- status = tunipip6_pvt.response;
|
||||
- up(&tunipip6_pvt.sem);
|
||||
- return status;
|
||||
-}
|
||||
-EXPORT_SYMBOL(nss_tunipip6_tx_sync);
|
||||
-
|
||||
-/*
|
||||
* **********************************
|
||||
* Register/Unregister/Miscellaneous APIs
|
||||
* **********************************
|
||||
@@ -264,8 +197,6 @@ void nss_tunipip6_register_handler()
|
||||
struct nss_ctx_instance *nss_ctx = nss_tunipip6_get_context();
|
||||
|
||||
nss_core_register_handler(nss_ctx, NSS_TUNIPIP6_INTERFACE, nss_tunipip6_handler, NULL);
|
||||
- sema_init(&tunipip6_pvt.sem, 1);
|
||||
- init_completion(&tunipip6_pvt.complete);
|
||||
}
|
||||
|
||||
/*
|
||||
--- a/nss_tunipip6_log.c
|
||||
+++ b/nss_tunipip6_log.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
- * Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2018, 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.
|
||||
@@ -26,63 +26,47 @@
|
||||
* NSS TUNIPIP6 message strings
|
||||
*/
|
||||
static int8_t *nss_tunipip6_log_message_types_str[NSS_TUNIPIP6_MAX] __maybe_unused = {
|
||||
- "TUNIPIP6 Encap Interface Create",
|
||||
- "TUNIPIP6 Decap Interface Create",
|
||||
+ "TUNIPIP6 Interface Create",
|
||||
"TUNIPIP6 Stats",
|
||||
- "TUNIPIP6 FMR add",
|
||||
- "TUNIPIP6 FMR delete",
|
||||
- "TUNIPIP6 FMR flush",
|
||||
- "TUNIPIP6 BMR add",
|
||||
- "TUNIPIP6 BMR delete",
|
||||
};
|
||||
|
||||
/*
|
||||
- * nss_tunipip6_log_map_rule()
|
||||
- * Log NSS TUNIPIP6 map rule.
|
||||
- */
|
||||
-static void nss_tunipip6_log_map_rule(struct nss_tunipip6_msg *ntm)
|
||||
-{
|
||||
- struct nss_tunipip6_map_rule *nmr __maybe_unused = &ntm->msg.map_rule;
|
||||
- nss_trace("%px: NSS TUNIPIP6 Interface Create message \n"
|
||||
- "TUNIPIP6 Map Rule IPv6 prefix: %pI6\n"
|
||||
- "TUNIPIP6 Map Rule IPv6 prefix length: %d\n"
|
||||
- "TUNIPIP6 Map Rule IPv4 prefix: %pI4\n"
|
||||
- "TUNIPIP6 Map Rule IPv4 prefix length: %d\n"
|
||||
- "TUNIPIP6 Map Rule IPv6 suffix: %pI6\n"
|
||||
- "TUNIPIP6 Map Rule IPv6 suffix length: %d\n"
|
||||
- "TUNIPIP6 Map Rule EA length: %d\n"
|
||||
- "TUNIPIP6 Map Rule PSID offset: %d\n",
|
||||
- nmr, nmr->ip6_prefix,
|
||||
- nmr->ip6_prefix_len,&nmr->ip4_prefix,
|
||||
- nmr->ip4_prefix_len, nmr->ip6_suffix,
|
||||
- nmr->ip6_suffix_len, nmr->ea_len,
|
||||
- nmr->psid_offset);
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
* nss_tunipip6_log_if_create_msg()
|
||||
* Log NSS TUNIPIP6 Interface Create
|
||||
*/
|
||||
static void nss_tunipip6_log_if_create_msg(struct nss_tunipip6_msg *ntm)
|
||||
{
|
||||
struct nss_tunipip6_create_msg *ntcm __maybe_unused = &ntm->msg.tunipip6_create;
|
||||
- nss_trace("%px: NSS TUNIPIP6 Interface Create message \n"
|
||||
+ int32_t i;
|
||||
+ nss_trace("%p: NSS TUNIPIP6 Interface Create message \n"
|
||||
"TUNIPIP6 Source Address: %pI6\n"
|
||||
"TUNIPIP6 Destination Address: %pI6\n"
|
||||
"TUNIPIP6 Flow Label: %d\n"
|
||||
"TUNIPIP6 Flags: %d\n"
|
||||
"TUNIPIP6 Hop Limit: %d\n"
|
||||
"TUNIPIP6 Draft03 Specification: %d\n"
|
||||
- "TUNIPIP6 TTL inherit: %s\n"
|
||||
- "TUNIPIP6 TOS inherit: %s\n"
|
||||
- "TUNIPIP6 Frag ID Update: %s\n",
|
||||
+ "TUNIPIP6 FMR Number: %d\n",
|
||||
ntcm, ntcm->saddr,
|
||||
ntcm->daddr, ntcm->flowlabel,
|
||||
ntcm->flags, ntcm->hop_limit,
|
||||
- ntcm->draft03,
|
||||
- ntcm->ttl_inherit ? "true":"false",
|
||||
- ntcm->tos_inherit ? "true":"false",
|
||||
- ntcm->frag_id_update ? "true":"false");
|
||||
+ ntcm->draft03, ntcm->fmr_number);
|
||||
+ /*
|
||||
+ * Continuation of the log.
|
||||
+ */
|
||||
+ for (i = 0; i < NSS_TUNIPIP6_MAX_FMR_NUMBER; i++) {
|
||||
+ nss_trace("TUNIPIP6 FMR[%d] IPv6 Prefix: %pI6\n"
|
||||
+ "TUNIPIP6 FMR[%d] IPv4 Prefix: %pI4\n"
|
||||
+ "TUNIPIP6 FMR[%d] IPv6 Prefix Length: %d\n"
|
||||
+ "TUNIPIP6 FMR[%d] IPv4 Prefix Length: %d\n"
|
||||
+ "TUNIPIP6 FMR[%d] Embedded Address Length: %d\n"
|
||||
+ "TUNIPIP6 FMR[%d] offset: %d",
|
||||
+ i, ntcm->fmr[i].ip6_prefix,
|
||||
+ i, &ntcm->fmr[i].ip4_prefix,
|
||||
+ i, ntcm->fmr[i].ip6_prefix_len,
|
||||
+ i, ntcm->fmr[i].ip4_prefix_len,
|
||||
+ i, ntcm->fmr[i].ea_len,
|
||||
+ i, ntcm->fmr[i].offset);
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -103,17 +87,8 @@ static void nss_tunipip6_log_verbose(str
|
||||
*/
|
||||
break;
|
||||
|
||||
- case NSS_TUNIPIP6_BMR_RULE_ADD:
|
||||
- case NSS_TUNIPIP6_BMR_RULE_DEL:
|
||||
- case NSS_TUNIPIP6_FMR_RULE_ADD:
|
||||
- case NSS_TUNIPIP6_FMR_RULE_DEL:
|
||||
- nss_tunipip6_log_map_rule(ntm);
|
||||
- break;
|
||||
- case NSS_TUNIPIP6_FMR_RULE_FLUSH:
|
||||
- nss_trace("%px: FMR rule flush.\n", ntm);
|
||||
- break;
|
||||
default:
|
||||
- nss_trace("%px: Invalid message type\n", ntm);
|
||||
+ nss_trace("%p: Invalid message type\n", ntm);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -125,11 +100,11 @@ static void nss_tunipip6_log_verbose(str
|
||||
void nss_tunipip6_log_tx_msg(struct nss_tunipip6_msg *ntm)
|
||||
{
|
||||
if (ntm->cm.type >= NSS_TUNIPIP6_MAX) {
|
||||
- nss_warning("%px: Invalid message type\n", ntm);
|
||||
+ nss_warning("%p: Invalid message type\n", ntm);
|
||||
return;
|
||||
}
|
||||
|
||||
- nss_info("%px: type[%d]:%s\n", ntm, ntm->cm.type, nss_tunipip6_log_message_types_str[ntm->cm.type]);
|
||||
+ nss_info("%p: type[%d]:%s\n", ntm, ntm->cm.type, nss_tunipip6_log_message_types_str[ntm->cm.type]);
|
||||
nss_tunipip6_log_verbose(ntm);
|
||||
}
|
||||
|
||||
@@ -140,18 +115,18 @@ void nss_tunipip6_log_tx_msg(struct nss_
|
||||
void nss_tunipip6_log_rx_msg(struct nss_tunipip6_msg *ntm)
|
||||
{
|
||||
if (ntm->cm.response >= NSS_CMN_RESPONSE_LAST) {
|
||||
- nss_warning("%px: Invalid response\n", ntm);
|
||||
+ nss_warning("%p: Invalid response\n", ntm);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ntm->cm.response == NSS_CMN_RESPONSE_NOTIFY || (ntm->cm.response == NSS_CMN_RESPONSE_ACK)) {
|
||||
- nss_info("%px: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type,
|
||||
+ nss_info("%p: type[%d]:%s, response[%d]:%s\n", ntm, ntm->cm.type,
|
||||
nss_tunipip6_log_message_types_str[ntm->cm.type],
|
||||
ntm->cm.response, nss_cmn_response_str[ntm->cm.response]);
|
||||
goto verbose;
|
||||
}
|
||||
|
||||
- nss_info("%px: msg nack - type[%d]:%s, response[%d]:%s\n",
|
||||
+ nss_info("%p: msg nack - type[%d]:%s, response[%d]:%s\n",
|
||||
ntm, ntm->cm.type, nss_tunipip6_log_message_types_str[ntm->cm.type],
|
||||
ntm->cm.response, nss_cmn_response_str[ntm->cm.response]);
|
||||
|
||||
@ -1,528 +0,0 @@
|
||||
--- a/exports/nss_api_if.h
|
||||
+++ b/exports/nss_api_if.h
|
||||
@@ -119,7 +119,11 @@
|
||||
#define NSS_MAX_PHYSICAL_INTERFACES 8 /**< Maximum number of physical interfaces. */
|
||||
#define NSS_MAX_VIRTUAL_INTERFACES 16 /**< Maximum number of virtual interfaces. */
|
||||
#define NSS_MAX_TUNNEL_INTERFACES 4 /**< Maximum number of tunnel interfaces. */
|
||||
+#if (NSS_FW_VERSION_CODE < NSS_FW_VERSION(11,1))
|
||||
+#define NSS_MAX_SPECIAL_INTERFACES 55 /**< Maximum number of special interfaces. */
|
||||
+#else
|
||||
#define NSS_MAX_SPECIAL_INTERFACES 67 /**< Maximum number of special interfaces. */
|
||||
+#endif
|
||||
#define NSS_MAX_WIFI_RADIO_INTERFACES 3 /**< Maximum number of radio interfaces. */
|
||||
|
||||
/*
|
||||
@@ -253,6 +257,10 @@
|
||||
/**< Special interface number for timestamp receive. */
|
||||
#define NSS_GRE_REDIR_MARK_INTERFACE (NSS_SPECIAL_IF_START + 56)
|
||||
/**< Special interface number for GRE redirect mark. */
|
||||
+#if (NSS_FW_VERSION_CODE < NSS_FW_VERSION(11,1))
|
||||
+#define NSS_RMNET_RX_INTERFACE (NSS_SPECIAL_IF_START + 57)
|
||||
+ /**< Special interface number for RMNET receive handler. */
|
||||
+#else
|
||||
#define NSS_VXLAN_INTERFACE (NSS_SPECIAL_IF_START + 57)
|
||||
/**< Special interface number for VxLAN handler. */
|
||||
#define NSS_RMNET_RX_INTERFACE (NSS_SPECIAL_IF_START + 58)
|
||||
@@ -269,7 +277,7 @@
|
||||
/**< Special interface number for the Wi-Fi MAC database. */
|
||||
#define NSS_DMA_INTERFACE (NSS_SPECIAL_IF_START + 66)
|
||||
/**< Special interface number for the DMA interface. */
|
||||
-
|
||||
+#endif
|
||||
|
||||
#ifdef __KERNEL__ /* only kernel will use. */
|
||||
|
||||
--- a/exports/nss_dynamic_interface.h
|
||||
+++ b/exports/nss_dynamic_interface.h
|
||||
@@ -59,7 +59,11 @@ enum nss_dynamic_interface_type {
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_VLAN,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_3,
|
||||
+#if (NSS_FW_VERSION_CODE <= NSS_FW_VERSION(11,0))
|
||||
+ NSS_DYNAMIC_INTERFACE_TYPE_WIFILI,
|
||||
+#else
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL,
|
||||
+#endif
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_INNER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_OUTER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER,
|
||||
@@ -96,14 +100,16 @@ enum nss_dynamic_interface_type {
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_IGS,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_DS,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_MATCH,
|
||||
+#endif
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1,
|
||||
-#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER,
|
||||
NSS_DYNAMIC_INTERFACE_TYPE_MIRROR,
|
||||
--- a/nss_core.c
|
||||
+++ b/nss_core.c
|
||||
@@ -924,6 +924,7 @@ static inline void nss_core_handle_buffe
|
||||
dev_put(ndev);
|
||||
}
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
/*
|
||||
* nss_core_handle_ext_buffer_pkt()
|
||||
* Handle Extended data plane packet received on physical or virtual interface.
|
||||
@@ -968,6 +969,7 @@ static inline void nss_core_handle_ext_b
|
||||
dev_kfree_skb_any(nbuf);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* nss_core_rx_pbuf()
|
||||
@@ -984,7 +986,9 @@ static inline void nss_core_rx_pbuf(stru
|
||||
NSS_PKT_STATS_DEC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_NSS_SKB_COUNT]);
|
||||
|
||||
if (interface_num >= NSS_MAX_NET_INTERFACES) {
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_INVALID_INTERFACE]);
|
||||
+#endif
|
||||
nss_warning("%px: Invalid interface_num: %d", nss_ctx, interface_num);
|
||||
dev_kfree_skb_any(nbuf);
|
||||
return;
|
||||
@@ -994,7 +998,9 @@ static inline void nss_core_rx_pbuf(stru
|
||||
* Check if core_id value is valid.
|
||||
*/
|
||||
if (core_id > nss_top_main.num_nss) {
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_INVALID_CORE_ID]);
|
||||
+#endif
|
||||
nss_warning("%px: Invalid core id: %d", nss_ctx, core_id);
|
||||
dev_kfree_skb_any(nbuf);
|
||||
return;
|
||||
@@ -1026,9 +1032,11 @@ static inline void nss_core_rx_pbuf(stru
|
||||
nss_core_handle_bounced_pkt(nss_ctx, reg, nbuf);
|
||||
break;
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
case N2H_BUFFER_PACKET_EXT:
|
||||
nss_core_handle_ext_buffer_pkt(nss_ctx, interface_num, nbuf, napi, desc->bit_flags);
|
||||
break;
|
||||
+#endif
|
||||
|
||||
case N2H_BUFFER_STATUS:
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_STATUS]);
|
||||
@@ -1060,7 +1068,9 @@ static inline void nss_core_rx_pbuf(stru
|
||||
break;
|
||||
|
||||
default:
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_PKT_STATS_INC(&nss_ctx->nss_top->stats_drv[NSS_DRV_STATS_RX_INVALID_BUFFER_TYPE]);
|
||||
+#endif
|
||||
nss_warning("%px: Invalid buffer type %d received from NSS", nss_ctx, buffer_type);
|
||||
dev_kfree_skb_any(nbuf);
|
||||
}
|
||||
--- a/nss_dynamic_interface_stats.c
|
||||
+++ b/nss_dynamic_interface_stats.c
|
||||
@@ -43,7 +43,11 @@ const char *nss_dynamic_interface_type_n
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_BRIDGE",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_VLAN",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_RESERVED_3",
|
||||
+#if (NSS_FW_VERSION_CODE <= NSS_FW_VERSION(11,0))
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_WIFILI",
|
||||
+#else
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL",
|
||||
+#endif
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_INNER",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_MAP_T_OUTER",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_GRE_TUNNEL_INNER",
|
||||
@@ -80,13 +84,22 @@ const char *nss_dynamic_interface_type_n
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_IGS",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_US",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_CLMAP_DS",
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_INNER",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_VXLAN_OUTER",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_MATCH",
|
||||
+#endif
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_N2H",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_RMNET_RX_H2N",
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0",
|
||||
"NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1",
|
||||
+#endif
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_TLS_INNER",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_TLS_OUTER",
|
||||
+ "NSS_DYNAMIC_INTERFACE_TYPE_MIRROR",
|
||||
+#endif
|
||||
};
|
||||
|
||||
/*
|
||||
--- a/nss_n2h_strings.c
|
||||
+++ b/nss_n2h_strings.c
|
||||
@@ -38,14 +38,14 @@ struct nss_stats_info nss_n2h_strings_st
|
||||
{"ticks" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"worst_ticks" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"iterations" , NSS_STATS_TYPE_SPECIAL},
|
||||
- {"pbuf_ocm_total_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
- {"pbuf_ocm_free_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"pbuf_ocm_alloc_fail_payload" , NSS_STATS_TYPE_SPECIAL},
|
||||
+ {"pbuf_ocm_free_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
+ {"pbuf_ocm_total_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"pbuf_ocm_alloc_fail_nopayload", NSS_STATS_TYPE_SPECIAL},
|
||||
- {"pbuf_def_total_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
- {"pbuf_def_free_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"pbuf_def_alloc_fail_payload" , NSS_STATS_TYPE_SPECIAL},
|
||||
+ {"pbuf_def_free_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"pbuf_def_alloc_fail_nopayload", NSS_STATS_TYPE_SPECIAL},
|
||||
+ {"pbuf_def_total_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"payload_alloc_fails" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"payload_free_count" , NSS_STATS_TYPE_SPECIAL},
|
||||
{"h2n_control_pkts" , NSS_STATS_TYPE_SPECIAL},
|
||||
--- a/nss_hal/nss_hal.c
|
||||
+++ b/nss_hal/nss_hal.c
|
||||
@@ -88,6 +88,7 @@ int nss_hal_firmware_load(struct nss_ctx
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
/*
|
||||
* nss_hal_dt_parse_features()
|
||||
*/
|
||||
@@ -98,14 +99,12 @@ void nss_hal_dt_parse_features(struct de
|
||||
*/
|
||||
npd->bridge_enabled = of_property_read_bool(np, "qcom,bridge-enabled");
|
||||
npd->capwap_enabled = of_property_read_bool(np, "qcom,capwap-enabled");
|
||||
- npd->clmap_enabled = of_property_read_bool(np, "qcom,clmap-enabled");
|
||||
npd->crypto_enabled = of_property_read_bool(np, "qcom,crypto-enabled");
|
||||
npd->dtls_enabled = of_property_read_bool(np, "qcom,dtls-enabled");
|
||||
npd->gre_enabled = of_property_read_bool(np, "qcom,gre-enabled");
|
||||
npd->gre_redir_enabled = of_property_read_bool(np, "qcom,gre-redir-enabled");
|
||||
npd->gre_tunnel_enabled = of_property_read_bool(np, "qcom,gre_tunnel_enabled");
|
||||
npd->gre_redir_mark_enabled = of_property_read_bool(np, "qcom,gre-redir-mark-enabled");
|
||||
- npd->igs_enabled = of_property_read_bool(np, "qcom,igs-enabled");
|
||||
npd->ipsec_enabled = of_property_read_bool(np, "qcom,ipsec-enabled");
|
||||
npd->ipv4_enabled = of_property_read_bool(np, "qcom,ipv4-enabled");
|
||||
npd->ipv4_reasm_enabled = of_property_read_bool(np, "qcom,ipv4-reasm-enabled");
|
||||
@@ -119,20 +118,18 @@ void nss_hal_dt_parse_features(struct de
|
||||
npd->pptp_enabled = of_property_read_bool(np, "qcom,pptp-enabled");
|
||||
npd->portid_enabled = of_property_read_bool(np, "qcom,portid-enabled");
|
||||
npd->pvxlan_enabled = of_property_read_bool(np, "qcom,pvxlan-enabled");
|
||||
+ npd->clmap_enabled = of_property_read_bool(np, "qcom,clmap-enabled");
|
||||
npd->qvpn_enabled = of_property_read_bool(np, "qcom,qvpn-enabled");
|
||||
npd->rmnet_rx_enabled = of_property_read_bool(np, "qcom,rmnet_rx-enabled");
|
||||
npd->shaping_enabled = of_property_read_bool(np, "qcom,shaping-enabled");
|
||||
- npd->tls_enabled = of_property_read_bool(np, "qcom,tls-enabled");
|
||||
npd->tstamp_enabled = of_property_read_bool(np, "qcom,tstamp-enabled");
|
||||
npd->turbo_frequency = of_property_read_bool(np, "qcom,turbo-frequency");
|
||||
npd->tun6rd_enabled = of_property_read_bool(np, "qcom,tun6rd-enabled");
|
||||
npd->tunipip6_enabled = of_property_read_bool(np, "qcom,tunipip6-enabled");
|
||||
npd->vlan_enabled = of_property_read_bool(np, "qcom,vlan-enabled");
|
||||
- npd->vxlan_enabled = of_property_read_bool(np, "qcom,vxlan-enabled");
|
||||
npd->wlanredirect_enabled = of_property_read_bool(np, "qcom,wlanredirect-enabled");
|
||||
npd->wifioffload_enabled = of_property_read_bool(np, "qcom,wlan-dataplane-offload-enabled");
|
||||
- npd->match_enabled = of_property_read_bool(np, "qcom,match-enabled");
|
||||
- npd->mirror_enabled = of_property_read_bool(np, "qcom,mirror-enabled");
|
||||
+ npd->igs_enabled = of_property_read_bool(np, "qcom,igs-enabled");
|
||||
}
|
||||
/*
|
||||
* nss_hal_clean_up_irq()
|
||||
@@ -567,15 +564,18 @@ int nss_hal_probe(struct platform_device
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_VAP] = nss_dev->id;
|
||||
nss_wifi_register_handler();
|
||||
nss_wifili_register_handler();
|
||||
+#if (NSS_FW_VERSION_CODE <= NSS_FW_VERSION(11,0))
|
||||
+ nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI] = nss_dev->id;
|
||||
+#else
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_INTERNAL] = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL0] = nss_dev->id;
|
||||
nss_top->dynamic_interface_table[NSS_DYNAMIC_INTERFACE_TYPE_WIFILI_EXTERNAL1] = nss_dev->id;
|
||||
-
|
||||
/*
|
||||
* Register wifi mac database when offload enabled
|
||||
*/
|
||||
nss_top->wmdb_handler_id = nss_dev->id;
|
||||
nss_wifi_mac_db_register_handler();
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
--- a/nss_wifili.c
|
||||
+++ b/nss_wifili.c
|
||||
@@ -50,8 +50,11 @@ static void nss_wifili_handler(struct ns
|
||||
*/
|
||||
BUG_ON((nss_is_dynamic_interface(ncm->interface))
|
||||
|| ((ncm->interface != NSS_WIFILI_INTERNAL_INTERFACE)
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
&& (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE0)
|
||||
- && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE1)));
|
||||
+ && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE1)
|
||||
+#endif
|
||||
+ ));
|
||||
|
||||
/*
|
||||
* Trace messages.
|
||||
@@ -172,8 +175,13 @@ nss_tx_status_t nss_wifili_tx_msg(struct
|
||||
* The interface number shall be one of the wifili soc interfaces
|
||||
*/
|
||||
if ((ncm->interface != NSS_WIFILI_INTERNAL_INTERFACE)
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
&& (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE0)
|
||||
- && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE1)) {
|
||||
+ && (ncm->interface != NSS_WIFILI_EXTERNAL_INTERFACE1))
|
||||
+#else
|
||||
+ )
|
||||
+#endif
|
||||
+ {
|
||||
nss_warning("%px: tx request for interface that is not a wifili: %d", nss_ctx, ncm->interface);
|
||||
return NSS_TX_FAILURE;
|
||||
}
|
||||
@@ -230,6 +238,7 @@ EXPORT_SYMBOL(nss_wifili_get_context);
|
||||
* nss_get_available_wifili_external_if()
|
||||
* Check and return the available external interface
|
||||
*/
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
uint32_t nss_get_available_wifili_external_if(void)
|
||||
{
|
||||
struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.wifi_handler_id];
|
||||
@@ -250,7 +259,7 @@ uint32_t nss_get_available_wifili_extern
|
||||
return NSS_MAX_NET_INTERFACES;
|
||||
}
|
||||
EXPORT_SYMBOL(nss_get_available_wifili_external_if);
|
||||
-
|
||||
+#endif
|
||||
/*
|
||||
* nss_wifili_msg_init()
|
||||
* Initialize nss_wifili_msg.
|
||||
@@ -362,9 +371,10 @@ void nss_wifili_register_handler(void)
|
||||
|
||||
nss_info("nss_wifili_register_handler");
|
||||
nss_core_register_handler(nss_ctx, NSS_WIFILI_INTERNAL_INTERFACE, nss_wifili_handler, NULL);
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
nss_core_register_handler(nss_ctx, NSS_WIFILI_EXTERNAL_INTERFACE0, nss_wifili_handler, NULL);
|
||||
nss_core_register_handler(nss_ctx, NSS_WIFILI_EXTERNAL_INTERFACE1, nss_wifili_handler, NULL);
|
||||
-
|
||||
+#endif
|
||||
nss_wifili_stats_dentry_create();
|
||||
nss_wifili_strings_dentry_create();
|
||||
|
||||
--- a/nss_wifili_stats.c
|
||||
+++ b/nss_wifili_stats.c
|
||||
@@ -248,6 +248,7 @@ void nss_wifili_stats_sync(struct nss_ct
|
||||
nwss->soc_maxpdev = NSS_WIFILI_MAX_PDEV_NUM_MSG;
|
||||
break;
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
case NSS_WIFILI_EXTERNAL_INTERFACE0:
|
||||
nwss = &soc_stats[1];
|
||||
nwss->soc_maxpdev = NSS_WIFILI_SOC_ATTACHED_MAX_PDEV_NUM;
|
||||
@@ -257,6 +258,7 @@ void nss_wifili_stats_sync(struct nss_ct
|
||||
nwss = &soc_stats[2];
|
||||
nwss->soc_maxpdev = NSS_WIFILI_SOC_ATTACHED_MAX_PDEV_NUM;
|
||||
break;
|
||||
+#endif
|
||||
|
||||
default:
|
||||
nss_warning("%px: Invalid wifili interface\n", nss_ctx);
|
||||
@@ -470,6 +472,7 @@ void nss_wifili_stats_notify(struct nss_
|
||||
index = 0;
|
||||
break;
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
case NSS_WIFILI_EXTERNAL_INTERFACE0:
|
||||
index = 1;
|
||||
break;
|
||||
@@ -477,6 +480,7 @@ void nss_wifili_stats_notify(struct nss_
|
||||
case NSS_WIFILI_EXTERNAL_INTERFACE1:
|
||||
index = 2;
|
||||
break;
|
||||
+#endif
|
||||
|
||||
default:
|
||||
nss_warning("%px: Invalid wifili interface\n", nss_ctx);
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -85,8 +85,10 @@ qca-nss-drv-objs += nss_wifi.o \
|
||||
nss_wifili.o \
|
||||
nss_wifili_log.o \
|
||||
nss_wifili_stats.o \
|
||||
- nss_wifili_strings.o \
|
||||
- nss_wifi_mac_db.o
|
||||
+ nss_wifili_strings.o
|
||||
+ifeq ($(shell test $(TARGET_NSS_MINOR_VERSION) -gt 0; echo $$?),0)
|
||||
+qca-nss-drv-objs += nss_wifi_mac_db.o
|
||||
+endif
|
||||
endif
|
||||
|
||||
ifneq "$(NSS_DRV_BRIDGE_ENABLE)" "n"
|
||||
--- a/nss_tx_rx_common.h
|
||||
+++ b/nss_tx_rx_common.h
|
||||
@@ -96,7 +96,9 @@ extern void nss_wifili_register_handler(
|
||||
extern void nss_ppe_register_handler(void);
|
||||
extern void nss_gre_redir_mark_register_handler(void);
|
||||
extern void nss_ppe_vp_register_handler(void);
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
extern void nss_wifi_mac_db_register_handler(void);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* nss_if_msg_handler()
|
||||
--- a/exports/nss_n2h.h
|
||||
+++ b/exports/nss_n2h.h
|
||||
@@ -73,40 +73,43 @@ struct nss_n2h_cfg_pvt {
|
||||
*/
|
||||
enum nss_n2h_stats_types {
|
||||
NSS_N2H_STATS_QUEUE_DROPPED = NSS_STATS_NODE_MAX,
|
||||
- /**< Number of packets dropped because the exception queue is too full. */
|
||||
- NSS_N2H_STATS_TOTAL_TICKS, /**< Total clock ticks spend inside the N2H. */
|
||||
- NSS_N2H_STATS_WORST_CASE_TICKS, /**< Worst case iteration of the exception path in ticks. */
|
||||
- NSS_N2H_STATS_ITERATIONS, /**< Number of iterations around the N2H. */
|
||||
- NSS_N2H_STATS_PBUF_OCM_TOTAL_COUNT, /**< Number of pbuf OCM total count. */
|
||||
- NSS_N2H_STATS_PBUF_OCM_FREE_COUNT, /**< Number of pbuf OCM free count. */
|
||||
+ /* Number of packets dropped because the exception queue is too full */
|
||||
+ NSS_N2H_STATS_TOTAL_TICKS, /* Total clock ticks spend inside the N2H */
|
||||
+ NSS_N2H_STATS_WORST_CASE_TICKS, /* Worst case iteration of the exception path in ticks */
|
||||
+ NSS_N2H_STATS_ITERATIONS, /* Number of iterations around the N2H */
|
||||
+
|
||||
NSS_N2H_STATS_PBUF_OCM_ALLOC_FAILS_WITH_PAYLOAD,
|
||||
- /**< Number of pbuf OCM allocations that have failed with payload. */
|
||||
+ /* Number of pbuf ocm allocations that have failed with payload */
|
||||
+ NSS_N2H_STATS_PBUF_OCM_FREE_COUNT, /* Number of pbuf ocm free count */
|
||||
+ NSS_N2H_STATS_PBUF_OCM_TOTAL_COUNT, /* Number of pbuf ocm total count */
|
||||
NSS_N2H_STATS_PBUF_OCM_ALLOC_FAILS_NO_PAYLOAD,
|
||||
- /**< Number of pbuf OCM allocations that have failed without payload. */
|
||||
- NSS_N2H_STATS_PBUF_DEFAULT_TOTAL_COUNT, /**< Number of pbuf default total count. */
|
||||
- NSS_N2H_STATS_PBUF_DEFAULT_FREE_COUNT, /**< Number of pbuf default free count. */
|
||||
+ /* Number of pbuf ocm allocations that have failed without payload */
|
||||
+
|
||||
NSS_N2H_STATS_PBUF_DEFAULT_ALLOC_FAILS_WITH_PAYLOAD,
|
||||
- /**< Number of pbuf default allocations that have failed with payload. */
|
||||
+ /* Number of pbuf default allocations that have failed with payload */
|
||||
+
|
||||
+ NSS_N2H_STATS_PBUF_DEFAULT_FREE_COUNT, /* Number of pbuf default free count */
|
||||
+ NSS_N2H_STATS_PBUF_DEFAULT_TOTAL_COUNT, /* Number of pbuf default total count */
|
||||
NSS_N2H_STATS_PBUF_DEFAULT_ALLOC_FAILS_NO_PAYLOAD,
|
||||
- /**< Number of pbuf default allocations that have failed without payload. */
|
||||
+ /* Number of pbuf default allocations that have failed without payload */
|
||||
+
|
||||
+ NSS_N2H_STATS_PAYLOAD_ALLOC_FAILS, /* Number of pbuf allocations that have failed because there were no free payloads */
|
||||
+ NSS_N2H_STATS_PAYLOAD_FREE_COUNT, /* Number of free payloads that exist */
|
||||
|
||||
- NSS_N2H_STATS_PAYLOAD_ALLOC_FAILS, /**< Number of pbuf allocations that have failed because there were no free payloads. */
|
||||
- NSS_N2H_STATS_PAYLOAD_FREE_COUNT, /**< Number of free payloads that exist. */
|
||||
+ NSS_N2H_STATS_H2N_CONTROL_PACKETS, /* Control packets received from HLOS */
|
||||
+ NSS_N2H_STATS_H2N_CONTROL_BYTES, /* Control bytes received from HLOS */
|
||||
+ NSS_N2H_STATS_N2H_CONTROL_PACKETS, /* Control packets sent to HLOS */
|
||||
+ NSS_N2H_STATS_N2H_CONTROL_BYTES, /* Control bytes sent to HLOS */
|
||||
|
||||
- NSS_N2H_STATS_H2N_CONTROL_PACKETS, /**< Control packets received from HLOS. */
|
||||
- NSS_N2H_STATS_H2N_CONTROL_BYTES, /**< Control bytes received from HLOS. */
|
||||
- NSS_N2H_STATS_N2H_CONTROL_PACKETS, /**< Control packets sent to HLOS. */
|
||||
- NSS_N2H_STATS_N2H_CONTROL_BYTES, /**< Control bytes sent to HLOS. */
|
||||
-
|
||||
- NSS_N2H_STATS_H2N_DATA_PACKETS, /**< Data packets received from HLOS. */
|
||||
- NSS_N2H_STATS_H2N_DATA_BYTES, /**< Data bytes received from HLOS. */
|
||||
- NSS_N2H_STATS_N2H_DATA_PACKETS, /**< Data packets sent to HLOS. */
|
||||
- NSS_N2H_STATS_N2H_DATA_BYTES, /**< Data bytes sent to HLOS. */
|
||||
- NSS_N2H_STATS_N2H_TOT_PAYLOADS, /**< Number of payloads in NSS. */
|
||||
- NSS_N2H_STATS_N2H_INTERFACE_INVALID, /**< Number of bad interface access. */
|
||||
- NSS_N2H_STATS_ENQUEUE_RETRIES, /**< Number of enqueue retries by N2H. */
|
||||
+ NSS_N2H_STATS_H2N_DATA_PACKETS, /* Data packets received from HLOS */
|
||||
+ NSS_N2H_STATS_H2N_DATA_BYTES, /* Data bytes received from HLOS */
|
||||
+ NSS_N2H_STATS_N2H_DATA_PACKETS, /* Data packets sent to HLOS */
|
||||
+ NSS_N2H_STATS_N2H_DATA_BYTES, /* Data bytes sent to HLOS */
|
||||
+ NSS_N2H_STATS_N2H_TOT_PAYLOADS, /* No. of payloads in NSS */
|
||||
+ NSS_N2H_STATS_N2H_INTERFACE_INVALID, /* No. of bad interface access */
|
||||
+ NSS_N2H_STATS_ENQUEUE_RETRIES, /* No. of enqueue retries by N2H */
|
||||
|
||||
- NSS_N2H_STATS_MAX, /**< Maximum message type. */
|
||||
+ NSS_N2H_STATS_MAX,
|
||||
};
|
||||
|
||||
/**
|
||||
--- a/nss_ipv4_strings.c
|
||||
+++ b/nss_ipv4_strings.c
|
||||
@@ -106,8 +106,10 @@ struct nss_stats_info nss_ipv4_strings_e
|
||||
{"mc_pbuf_alloc_failure" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"pppoe_bridge_no_icme" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"pppoe_no_session" , NSS_STATS_TYPE_DROP},
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
{"icmp_ipv4_gre_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"icmp_ipv4_esp_hdr_incomplete" , NSS_STATS_TYPE_EXCEPTION},
|
||||
+#endif
|
||||
};
|
||||
|
||||
/*
|
||||
--- a/nss_n2h_stats.c
|
||||
+++ b/nss_n2h_stats.c
|
||||
@@ -38,7 +38,7 @@ static ssize_t nss_n2h_stats_read(struct
|
||||
* Max output lines = #stats + few blank lines for banner printing +
|
||||
* Number of Extra outputlines for future reference to add new stats
|
||||
*/
|
||||
- uint32_t max_output_lines = (NSS_N2H_STATS_MAX + 3) * NSS_MAX_CORES + NSS_STATS_EXTRA_OUTPUT_LINES;
|
||||
+ uint32_t max_output_lines = (NSS_N2H_STATS_MAX + 3) * 2 + 5;
|
||||
size_t size_al = NSS_STATS_MAX_STR_LENGTH * max_output_lines;
|
||||
size_t size_wr = 0;
|
||||
ssize_t bytes_read = 0;
|
||||
--- a/exports/nss_ipv6.h
|
||||
+++ b/exports/nss_ipv6.h
|
||||
@@ -276,10 +276,14 @@ enum nss_ipv6_exception_events {
|
||||
NSS_IPV6_EXCEPTION_EVENT_TUNIPIP6_NEEDS_FRAGMENTATION,
|
||||
NSS_IPV6_EXCEPTION_EVENT_PPPOE_BRIDGE_NO_ICME,
|
||||
NSS_IPV6_EXCEPTION_EVENT_DONT_FRAG_SET,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_IPV6_EXCEPTION_EVENT_REASSEMBLY_NOT_SUPPORTED,
|
||||
+#endif
|
||||
NSS_IPV6_EXCEPTION_EVENT_PPPOE_NO_SESSION,
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_GRE_HEADER_INCOMPLETE,
|
||||
NSS_IPV6_EXCEPTION_EVENT_ICMP_IPV6_ESP_HEADER_INCOMPLETE,
|
||||
+#endif
|
||||
NSS_IPV6_EXCEPTION_EVENT_MAX
|
||||
};
|
||||
|
||||
@@ -469,20 +473,24 @@ enum nss_ipv6_error_response_types {
|
||||
/**< Invalid interface for updating multicast. */
|
||||
NSS_IPV6_CR_ACCEL_MODE_CONFIG_INVALID,
|
||||
/**< Invalid config value for acceleration mode. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_IPV6_CR_INVALID_MSG_ERROR,
|
||||
/**< Invalid message size error. */
|
||||
NSS_IPV6_CR_DSCP2PRI_PRI_INVALID,
|
||||
/**< Priority value out of range error. */
|
||||
NSS_IPV6_CR_DSCP2PRI_CONFIG_INVALID,
|
||||
/**< Invalid DSCP value. */
|
||||
+#endif
|
||||
NSS_IPV6_CR_INVALID_RPS,
|
||||
/**< Invalid RPS Value. */
|
||||
NSS_IPV6_HASH_BITMAP_INVALID,
|
||||
/**< Invalid hash bitmap. */
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
NSS_IPV6_DR_HW_DECEL_FAIL_ERROR,
|
||||
/**< Hardware deceleration fail error. */
|
||||
NSS_IPV6_CR_RETURN_EXIST_ERROR,
|
||||
/**< Rule creation failed because a 5-tuple return already exists. */
|
||||
+#endif
|
||||
NSS_IPV6_LAST
|
||||
/**< Maximum number of error responses. */
|
||||
};
|
||||
--- a/nss_ipv6_strings.c
|
||||
+++ b/nss_ipv6_strings.c
|
||||
@@ -81,10 +81,14 @@ struct nss_stats_info nss_ipv6_strings_e
|
||||
{"tunipip6_needs_fragmentation" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"pppoe_bridge_no_icme" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"dont_frag_set" , NSS_STATS_TYPE_EXCEPTION},
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,0))
|
||||
{"reassembly_not_supported" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"pppoe_no_session" , NSS_STATS_TYPE_DROP},
|
||||
{"icmp_gre_header_incomplete" , NSS_STATS_TYPE_EXCEPTION},
|
||||
{"icmp_esp_header_incomplete" , NSS_STATS_TYPE_EXCEPTION},
|
||||
+#else
|
||||
+ {"pppoe_no_session" , NSS_STATS_TYPE_DROP},
|
||||
+#endif
|
||||
};
|
||||
|
||||
/*
|
||||
@ -5,223 +5,91 @@ PKG_NAME:=qca-nss-ecm
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-nss-ecm.git
|
||||
PKG_SOURCE_DATE:=2023-02-27
|
||||
PKG_SOURCE_DATE:=2023-01-20
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fc9d9a22ba64ea7757b82e3608847b6df8626d8a
|
||||
PKG_MIRROR_HASH:=4cf206fee6e1d921508ecafd6d95a1de0afc2d479d65a67e1abdb4cb9c50d62f
|
||||
PKG_MIRROR_HASH:=390c2b1bfccc969b86269e9b6b8f53d77ea13322212bde6bf4bb655fa72c0270
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_BUILD_FLAGS:=gc-sections lto
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
LOCAL_VARIANT=$(patsubst qca-nss-ecm-%,%,$(patsubst qca-nss-ecm-%,%,$(BUILD_VARIANT)))
|
||||
|
||||
ifeq ($(CONFIG_QCA_NSS_ECM_EXAMPLES_PCC),y)
|
||||
ECM_MAKE_OPTS+=ECM_CLASSIFIER_PCC_ENABLE=y
|
||||
FILES_EXAMPLES=$(PKG_BUILD_DIR)/examples/ecm_pcc_test.ko
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_QCA_NSS_ECM_EXAMPLES_MARK),y)
|
||||
FILES_EXAMPLES+=$(PKG_BUILD_DIR)/examples/ecm_mark_test.ko
|
||||
endif
|
||||
|
||||
#Explicitly enable OVS external module, if ovsmgr is enabled.
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
|
||||
CONFIG_QCA_NSS_ECM_OVS=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_QCA_NSS_ECM_OVS),y)
|
||||
FILES_EXAMPLES+=$(PKG_BUILD_DIR)/examples/ecm_ovs.ko
|
||||
endif
|
||||
|
||||
define KernelPackage/qca-nss-ecm/Default
|
||||
define KernelPackage/qca-nss-ecm
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Support
|
||||
DEPENDS:=@(TARGET_ipq806x||TARGET_qualcommax||TARGET_ipq60xx) \
|
||||
+@NSS_DRV_IPV6_ENABLE \
|
||||
+@NSS_DRV_VIRT_IF_ENABLE \
|
||||
+@NSS_DRV_WIFI_ENABLE \
|
||||
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
||||
+kmod-nf-conntrack \
|
||||
+PACKAGE_kmod-qca-mcs:kmod-qca-mcs \
|
||||
+PACKAGE_kmod-bonding:kmod-bonding \
|
||||
+PACKAGE_kmod-vxlan:kmod-vxlan \
|
||||
+PACKAGE_kmod-nat46:kmod-nat46 \
|
||||
+PACKAGE_kmod-pppoe:kmod-pppoe \
|
||||
+PACKAGE_kmod-pppoe:kmod-pptp \
|
||||
+PACKAGE_kmod-pppoe:kmod-pppol2tp \
|
||||
+@(PACKAGE_kmod-pppoe):NSS_DRV_PPPOE_ENABLE
|
||||
TITLE:=QCA NSS Enhanced Connection Manager (ECM)
|
||||
FILES:=$(PKG_BUILD_DIR)/*.ko $(FILES_EXAMPLES)
|
||||
FILES:=$(PKG_BUILD_DIR)/ecm.ko
|
||||
KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_DSCPREMARK_EXT=y
|
||||
MENU:=1
|
||||
PROVIDES:=kmod-qca-nss-ecm
|
||||
$(call AddDepends/qca-nss-ecm/Default)
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_DSCPREMARK_EXT=y
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm/Description/Default
|
||||
define KernelPackage/qca-nss-ecm/Description
|
||||
This package contains the QCA NSS Enhanced Connection Manager
|
||||
endef
|
||||
|
||||
define AddDepends/qca-nss-ecm/Default
|
||||
SUBMENU:=Network Support
|
||||
DEPENDS:= \
|
||||
+@NSS_DRV_IPV6_ENABLE \
|
||||
+@NSS_DRV_PPE_ENABLE \
|
||||
+@NSS_DRV_TUN6RD_ENABLE \
|
||||
+@NSS_DRV_PPPOE_ENABLE \
|
||||
+@NSS_DRV_PPTP_ENABLE \
|
||||
+@NSS_DRV_VIRT_IF_ENABLE \
|
||||
+@NSS_DRV_WIFI_ENABLE \
|
||||
+kmod-qca-nss-drv \
|
||||
+kmod-nf-conntrack \
|
||||
+kmod-ppp +kmod-pppoe +kmod-pptp
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm/Default/install
|
||||
$(INSTALL_DIR) $(1)/etc/firewall.d $(1)/etc/init.d $(1)/usr/bin $(1)/lib/netifd/offload $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/sysctl.d
|
||||
define KernelPackage/qca-nss-ecm/install
|
||||
$(INSTALL_DIR) $(1)/etc/firewall.d $(1)/etc/init.d $(1)/usr/bin $(1)/lib/netifd/offload $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/sysctl.d $(1)/etc/hotplug.d/net
|
||||
$(INSTALL_DATA) ./files/qca-nss-ecm.firewall $(1)/etc/firewall.d/qca-nss-ecm
|
||||
$(INSTALL_BIN) ./files/qca-nss-ecm.init $(1)/etc/init.d/qca-nss-ecm
|
||||
$(INSTALL_BIN) ./files/ecm_dump.sh $(1)/usr/bin/
|
||||
$(INSTALL_BIN) ./files/disable_offloads.sh $(1)/usr/bin/
|
||||
$(INSTALL_BIN) ./files/on-demand-down $(1)/lib/netifd/offload/on-demand-down
|
||||
$(INSTALL_DATA) ./files/qca-nss-ecm.uci $(1)/etc/config/ecm
|
||||
$(INSTALL_DATA) ./files/qca-nss-ecm.defaults $(1)/etc/uci-defaults/99-qca-nss-ecm
|
||||
$(INSTALL_BIN) ./files/qca-nss-ecm.sysctl $(1)/etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),256)
|
||||
echo 'net.netfilter.nf_conntrack_max=2048' >> $(1)/etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
endif
|
||||
ifeq ($(CONFIG_KERNEL_IPQ_MEM_PROFILE),512)
|
||||
echo 'net.netfilter.nf_conntrack_max=8192' >> $(1)/etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-standard
|
||||
$(call KernelPackage/qca-nss-ecm/Default)
|
||||
DEPENDS+= \
|
||||
+PACKAGE_kmod-qca-mcs:kmod-qca-mcs \
|
||||
+PACKAGE_kmod-pppol2tp:kmod-pppol2tp \
|
||||
+PACKAGE_kmod-qca-nat46:kmod-qca-nat46
|
||||
VARIANT:=standard
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-standard/description
|
||||
$(call KernelPackage/qca-nss-ecm/Description/Default)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-standard/install
|
||||
$(call KernelPackage/qca-nss-ecm/Default/install, $(1))
|
||||
endef
|
||||
|
||||
# Variant with additional features enabled for premium profile
|
||||
define KernelPackage/qca-nss-ecm-premium/Default
|
||||
$(call KernelPackage/qca-nss-ecm/Default)
|
||||
TITLE+:= (with premium features)
|
||||
VARIANT:=premium
|
||||
DEPENDS+:=+kmod-qca-hyfi-bridge +kmod-qca-mcs +kmod-qca-nat46
|
||||
ifeq ($(CONFIG_TARGET_ipq_ipq40xx)$(CONFIG_TARGET_ipq40xx),)
|
||||
DEPENDS+=+kmod-bonding
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium/Description/Default
|
||||
$(call KernelPackage/qca-nss-ecm/Description/Default)
|
||||
with the premium features enabled
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium/Default/install
|
||||
$(call KernelPackage/qca-nss-ecm/install)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium
|
||||
$(call KernelPackage/qca-nss-ecm-premium/Default)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium/description
|
||||
$(call KernelPackage/qca-nss-ecm-premium/Description/Default)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium/install
|
||||
$(call KernelPackage/qca-nss-ecm-standard/install, $(1))
|
||||
endef
|
||||
|
||||
# Variant with additional features enabled for noload profile
|
||||
define KernelPackage/qca-nss-ecm-noload
|
||||
$(call KernelPackage/qca-nss-ecm/Default)
|
||||
TITLE+:= (with noload features)
|
||||
PROVIDES:=kmod-qca-nss-ecm
|
||||
VARIANT:=noload
|
||||
ifeq ($(CONFIG_TARGET_ipq_ipq40xx)$(CONFIG_TARGET_ipq40xx),)
|
||||
DEPENDS+=+kmod-bonding
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-noload/description
|
||||
$(call KernelPackage/qca-nss-ecm/Description/Default)
|
||||
When selected, this package installs the driver but does not load it at init.
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-noload/install
|
||||
$(call KernelPackage/qca-nss-ecm/Default/install, $(1))
|
||||
#
|
||||
# Remove the START line from the init script, so that the symlink
|
||||
# in the /etc/rc.d directory is not created.
|
||||
#
|
||||
sed -i '/START=/d' $(1)/etc/init.d/qca-nss-ecm
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium-noload
|
||||
$(call KernelPackage/qca-nss-ecm-premium/Default)
|
||||
TITLE+:= (noload)
|
||||
PROVIDES:=kmod-qca-nss-ecm-premium
|
||||
VARIANT:=premium-noload
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium-noload/description
|
||||
$(call KernelPackage/qca-nss-ecm-premium/Description/Default)
|
||||
When selected, this package installs the driver but does not load it at init.
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-premium-noload/install
|
||||
$(call KernelPackage/qca-nss-ecm-premium/Default/install, $(1))
|
||||
endef
|
||||
|
||||
define Build/InstallDev/qca-nss-ecm
|
||||
$(INSTALL_DIR) $(1)/usr/include/qca-nss-ecm
|
||||
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-ecm/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/qca-nss-ecm,$(1))
|
||||
$(INSTALL_BIN) ./files/qca-nss-ecm.sysctl $(1)/etc/sysctl.d/qca-nss-ecm.conf
|
||||
$(INSTALL_BIN) ./files/disable_offloads.hotplug $(1)/etc/hotplug.d/net/99-disable_offloads
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+= \
|
||||
-I$(STAGING_DIR)/usr/include/hyfibr \
|
||||
-I$(STAGING_DIR)/usr/include/qca-mcs \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
|
||||
-I$(STAGING_DIR)/usr/include/shortcut-fe \
|
||||
-I$(STAGING_DIR)/usr/include/nat46
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
|
||||
-I$(STAGING_DIR)/usr/include/qca-mcs \
|
||||
-I$(STAGING_DIR)/usr/include/nat46
|
||||
|
||||
ECM_MAKE_OPTS:=ECM_CLASSIFIER_HYFI_ENABLE=n
|
||||
ifeq ($(LOCAL_VARIANT),standard)
|
||||
ECM_MAKE_OPTS+=ECM_NON_PORTED_SUPPORT_ENABLE=y \
|
||||
ECM_STATE_OUTPUT_ENABLE=y \
|
||||
ECM_INTERFACE_VLAN_ENABLE=y \
|
||||
ECM_CLASSIFIER_DSCP_ENABLE=y \
|
||||
ECM_CLASSIFIER_MARK_ENABLE=y \
|
||||
ECM_CLASSIFIER_NL_ENABLE=y \
|
||||
ECM_TRACKER_DPI_SUPPORT_ENABLE=y \
|
||||
ECM_DB_ADVANCED_STATS_ENABLE=y \
|
||||
ECM_CLASSIFIER_EMESH_ENABLE=n
|
||||
|
||||
ifeq ($(CONFIG_TARGET_ipq_ipq40xx)$(CONFIG_TARGET_ipq40xx),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_BOND_ENABLE=n
|
||||
endif
|
||||
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "ipq806x" "qualcommax" "ipq60xx"))
|
||||
ECM_MAKE_OPTS+=ECM_FRONT_END_NSS_ENABLE=y \
|
||||
ECM_FRONT_END_SFE_ENABLE=n \
|
||||
ECM_NON_PORTED_SUPPORT_ENABLE=y \
|
||||
ECM_INTERFACE_VLAN_ENABLE=y \
|
||||
ECM_CLASSIFIER_MARK_ENABLE=y \
|
||||
ECM_CLASSIFIER_DSCP_ENABLE=y \
|
||||
ECM_CLASSIFIER_PCC_ENABLE=n \
|
||||
ECM_BAND_STEERING_ENABLE=n
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nat46),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_MAP_T_ENABLE=y
|
||||
# Disable ECM IPv6 support when global IPv6 support is disabled.
|
||||
ifneq ($(CONFIG_IPV6),)
|
||||
ECM_MAKE_OPTS+=ECM_IPV6_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_OVPN_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr),)
|
||||
ifeq ($(CONFIG_PACKAGE_kmod-vxlan),y)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_VXLAN_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_OVS_BRIDGE_ENABLE=y \
|
||||
ECM_CLASSIFIER_OVS_ENABLE=y
|
||||
ECM_CLASSIFIER_OVS_ENABLE=y
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-ovsmgr
|
||||
endif
|
||||
|
||||
@ -233,23 +101,33 @@ ifneq ($(CONFIG_PACKAGE_kmod-qca-mcs),)
|
||||
ECM_MAKE_OPTS+=ECM_MULTICAST_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-nat46),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_MAP_T_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-ipsec),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_IPSEC_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-pppoe),)
|
||||
ECM_MAKE_OPTS+= ECM_INTERFACE_PPPOE_ENABLE=y \
|
||||
ECM_INTERFACE_PPTP_ENABLE=y \
|
||||
ECM_INTERFACE_PPP_ENABLE=y
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_PPPOE_ENABLE=y \
|
||||
ECM_INTERFACE_PPTP_ENABLE=y \
|
||||
ECM_INTERFACE_PPP_ENABLE=y
|
||||
else
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_PPPOE_ENABLE=n \
|
||||
ECM_INTERFACE_PPTP_ENABLE=n \
|
||||
ECM_INTERFACE_PPP_ENABLE=n
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-pppol2tp),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_L2TPV2_ENABLE=y
|
||||
else
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_L2TPV2_ENABLE=n
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-gre)$(CONFIG_PACKAGE_kmod-gre6),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_GRE_TAP_ENABLE=y \
|
||||
ECM_INTERFACE_GRE_TUN_ENABLE=y
|
||||
ECM_INTERFACE_GRE_TUN_ENABLE=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-sit),)
|
||||
@ -264,71 +142,31 @@ ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mscs),)
|
||||
ECM_MAKE_OPTS+=ECM_CLASSIFIER_MSCS_ENABLE=y
|
||||
endif
|
||||
|
||||
# Disable ECM IPv6 support when global IPv6 support is disabled.
|
||||
ifneq ($(CONFIG_IPV6),)
|
||||
ECM_MAKE_OPTS+=ECM_IPV6_ENABLE=y
|
||||
endif
|
||||
|
||||
# Enable NSS frontend for all the platforms except ipq40xx
|
||||
ifeq ($(CONFIG_TARGET_ipq_ipq40xx)$(CONFIG_TARGET_ipq40xx),)
|
||||
ifneq ($(BUILD_VARIANT), nonss)
|
||||
ECM_MAKE_OPTS+=ECM_FRONT_END_NSS_ENABLE=y
|
||||
endif
|
||||
endif
|
||||
|
||||
# Keeping default as ipq806x for branches that does not have subtarget framework
|
||||
ifeq ($(CONFIG_TARGET_ipq),y)
|
||||
subtarget:=$(SUBTARGET)
|
||||
else
|
||||
subtarget:=$(CONFIG_TARGET_BOARD)
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-bonding),)
|
||||
ECM_MAKE_OPTS+=ECM_INTERFACE_BOND_ENABLE=y
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/qca-nss-ecm
|
||||
mkdir -p $(1)/usr/include/qca-nss-ecm
|
||||
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-ecm
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_BOARD), "qualcommax")
|
||||
SOC:=$(CONFIG_TARGET_SUBTARGET)
|
||||
else
|
||||
SOC:=$(CONFIG_TARGET_BOARD)
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" $(strip $(ECM_MAKE_OPTS)) \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_MAKE_FLAGS) \
|
||||
+$(MAKE) -C "$(LINUX_DIR)" $(strip $(ECM_MAKE_OPTS)) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(subtarget)" \
|
||||
EXAMPLES_BUILD_PCC="$(CONFIG_QCA_NSS_ECM_EXAMPLES_PCC)" \
|
||||
EXAMPLES_BUILD_MARK="$(CONFIG_QCA_NSS_ECM_EXAMPLES_MARK)" \
|
||||
EXAMPLES_BUILD_OVS="$(CONFIG_QCA_NSS_ECM_OVS)" \
|
||||
ECM_FRONT_END_SFE_ENABLE="$(CONFIG_QCA_ECM_SFE_SUPPORT)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS) -Wno-error=unused-function " \
|
||||
SoC=$(SOC) \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_JOBS) \
|
||||
modules
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-ecm-standard/config
|
||||
menu "ECM Configuration"
|
||||
|
||||
config QCA_NSS_ECM_EXAMPLES_PCC
|
||||
bool "Build PCC usage example"
|
||||
help
|
||||
Selecting this will build the PCC classifier usage example module.
|
||||
default n
|
||||
|
||||
config QCA_NSS_ECM_EXAMPLES_MARK
|
||||
bool "Build Mark classifier usage example"
|
||||
help
|
||||
Selecting this will build the Mark classifier usage example module.
|
||||
default n
|
||||
|
||||
config QCA_NSS_ECM_OVS
|
||||
bool "Build OVS classifier external module"
|
||||
help
|
||||
Selecting this will build the OVS classifier external module.
|
||||
default n
|
||||
|
||||
config QCA_ECM_SFE_SUPPORT
|
||||
bool "Add SFE support to ECM driver"
|
||||
default n
|
||||
endmenu
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,qca-nss-ecm-noload))
|
||||
$(eval $(call KernelPackage,qca-nss-ecm-standard))
|
||||
$(eval $(call KernelPackage,qca-nss-ecm-premium-noload))
|
||||
$(eval $(call KernelPackage,qca-nss-ecm-premium))
|
||||
$(eval $(call KernelPackage,qca-nss-ecm))
|
||||
|
||||
187
qca-nss-ecm/files/disable_offloads.hotplug
Executable file
187
qca-nss-ecm/files/disable_offloads.hotplug
Executable file
@ -0,0 +1,187 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" != "add" ] && exit
|
||||
|
||||
function log()
|
||||
{
|
||||
local status="$1"
|
||||
local feature="$2"
|
||||
local interface="$3"
|
||||
|
||||
if [ $status -eq 0 ]; then
|
||||
logger "[ethtool] $feature: disabled on $interface"
|
||||
fi
|
||||
|
||||
if [ $status -eq 1 ]; then
|
||||
logger -s "[ethtool] $feature: failed to disable on $interface"
|
||||
fi
|
||||
|
||||
if [ $status -gt 1 ]; then
|
||||
logger "[ethtool] $feature: no changes performed on $interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function interface_is_virtual()
|
||||
{
|
||||
local interface="$1"
|
||||
[ -d /sys/devices/virtual/net/"$interface"/ ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
function get_base_interface()
|
||||
{
|
||||
local interface="$1"
|
||||
echo "$interface" | grep -Eo '^[a-z]*[0-9]*' 2>/dev/null || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
function disable_offloads()
|
||||
{
|
||||
local interface="$1"
|
||||
local features
|
||||
local cmd
|
||||
|
||||
# Check if we can change features
|
||||
if ethtool -k $interface 1>/dev/null 2>/dev/null; then
|
||||
# Filter whitespaces
|
||||
# Get only enabled/not fixed features
|
||||
# Filter features that are only changeable by global keyword
|
||||
# Filter empty lines
|
||||
# Cut to First column
|
||||
features=$(ethtool -k "$interface" | awk '{$1=$1;print}' \
|
||||
| grep -E '^.+: on$' \
|
||||
| grep -v -E '^tx-checksum-.+$' \
|
||||
| grep -v -E '^tx-scatter-gather.+$' \
|
||||
| grep -v -E '^tx-tcp.+segmentation.+$' \
|
||||
| grep -v -E '^tx-udp-fragmentation$' \
|
||||
| grep -v -E '^tx-generic-segmentation$' \
|
||||
| grep -v -E '^rx-gro$' \
|
||||
| grep -v -E '^rx-gro$' \
|
||||
| grep -v -E '^$' \
|
||||
| cut -d: -f1)
|
||||
|
||||
# Replace feature name by global keyword
|
||||
features=$(echo "$features" | sed -e s/rx-checksumming/rx/ \
|
||||
-e s/tx-checksumming/tx/ \
|
||||
-e s/scatter-gather/sg/ \
|
||||
-e s/tcp-segmentation-offload/tso/ \
|
||||
-e s/udp-fragmentation-offload/ufo/ \
|
||||
-e s/generic-segmentation-offload/gso/ \
|
||||
-e s/generic-receive-offload/gro/ \
|
||||
-e s/large-receive-offload/lro/ \
|
||||
-e s/rx-vlan-offload/rxvlan/ \
|
||||
-e s/tx-vlan-offload/txvlan/ \
|
||||
-e s/ntuple-filters/ntuple/ \
|
||||
-e s/receive-hashing/rxhash/)
|
||||
|
||||
# Check if we can disable anything
|
||||
if [ -z "$features" ]; then
|
||||
logger "[ethtool] offloads: no changes performed on $interface"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Construct ethtool command line
|
||||
cmd="-K $interface"
|
||||
|
||||
for feature in $features; do
|
||||
cmd="$cmd $feature off"
|
||||
done
|
||||
|
||||
# Try to disable offloads
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Offloads" "$interface"
|
||||
|
||||
else
|
||||
log $? "Offloads" "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function disable_flow_control()
|
||||
{
|
||||
local interface="$1"
|
||||
local features
|
||||
local cmd
|
||||
|
||||
# Check if we can change settings
|
||||
if ethtool -a $interface 1>/dev/null 2>/dev/null; then
|
||||
# Construct ethtool command line
|
||||
cmd="-A $interface autoneg off tx off rx off"
|
||||
|
||||
# Try to disable flow control
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Flow Control" "$interface"
|
||||
|
||||
else
|
||||
log $? "Flow Control" "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function disable_interrupt_moderation()
|
||||
{
|
||||
local interface="$1"
|
||||
local features
|
||||
local cmd
|
||||
|
||||
# Check if we can change settings
|
||||
if ethtool -c $interface 1>/dev/null 2>/dev/null; then
|
||||
# Construct ethtool command line
|
||||
cmd="-C $interface adaptive-tx off adaptive-rx off"
|
||||
|
||||
# Try to disable adaptive interrupt moderation
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Adaptive Interrupt Moderation" "$interface"
|
||||
|
||||
features=$(ethtool -c $interface | awk '{$1=$1;print}' \
|
||||
| grep -v -E '^.+: 0$|Adaptive|Coalesce' \
|
||||
| grep -v -E '^$' \
|
||||
| cut -d: -f1)
|
||||
|
||||
# Check if we can disable anything
|
||||
if [ -z "$features" ]; then
|
||||
logger "[ethtool] Interrupt Moderation: no changes performed on $interface"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Construct ethtool command line
|
||||
cmd="-C $interface"
|
||||
|
||||
for feature in $features; do
|
||||
cmd="$cmd $feature 0"
|
||||
done
|
||||
|
||||
# Try to disable interrupt Moderation
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Interrupt Moderation" "$interface"
|
||||
|
||||
else
|
||||
log $? "Interrupt Moderation" "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function disable_interface_offloads() {
|
||||
#local interface=$(get_base_interface "$1")
|
||||
#{ [ -z "$interface" ] || interface_is_virtual "$interface"; } && exit 0
|
||||
|
||||
local interface="$1"
|
||||
|
||||
local disable_offloads="$(uci get ecm.@general[0].disable_offloads)"
|
||||
if [ "$disable_offloads" -eq 1 ]; then
|
||||
disable_offloads "$interface"
|
||||
fi
|
||||
|
||||
local disable_flow_control="$(uci get ecm.@general[0].disable_flow_control)"
|
||||
if [ "$disable_flow_control" -eq 1 ]; then
|
||||
disable_flow_control "$interface"
|
||||
fi
|
||||
|
||||
local disable_interrupt_moderation="$(uci get ecm.@general[0].disable_interrupt_moderation)"
|
||||
if [ "$disable_interrupt_moderation" -eq 1 ]; then
|
||||
disable_interrupt_moderation "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$ACTION" = add ]; then
|
||||
disable_interface_offloads "$INTERFACE"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
189
qca-nss-ecm/files/disable_offloads.sh
Executable file
189
qca-nss-ecm/files/disable_offloads.sh
Executable file
@ -0,0 +1,189 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Helper script which uses ethtool to disable (most)
|
||||
# interface offloads, if possible.
|
||||
#
|
||||
# Reference:
|
||||
# https://forum.openwrt.org/t/how-to-make-ethtool-setting-persistent-on-br-lan/6433/14
|
||||
#
|
||||
|
||||
function log()
|
||||
{
|
||||
local status="$1"
|
||||
local feature="$2"
|
||||
local interface="$3"
|
||||
|
||||
if [ $status -eq 0 ]; then
|
||||
logger "[ethtool] $feature: disabled on $interface"
|
||||
fi
|
||||
|
||||
if [ $status -eq 1 ]; then
|
||||
logger -s "[ethtool] $feature: failed to disable on $interface"
|
||||
fi
|
||||
|
||||
if [ $status -gt 1 ]; then
|
||||
logger "[ethtool] $feature: no changes performed on $interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function interface_is_virtual()
|
||||
{
|
||||
local interface="$1"
|
||||
[ -d /sys/devices/virtual/net/"$interface"/ ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
function get_base_interface()
|
||||
{
|
||||
local interface="$1"
|
||||
echo "$interface" | grep -Eo '^[a-z]*[0-9]*' 2>/dev/null || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
function disable_offloads()
|
||||
{
|
||||
local interface="$1"
|
||||
local features
|
||||
local cmd
|
||||
|
||||
# Check if we can change features
|
||||
if ethtool -k $interface 1>/dev/null 2>/dev/null; then
|
||||
|
||||
# Filter whitespaces
|
||||
# Get only enabled/not fixed features
|
||||
# Filter features that are only changeable by global keyword
|
||||
# Filter empty lines
|
||||
# Cut to First column
|
||||
features=$(ethtool -k "$interface" | awk '{$1=$1;print}' \
|
||||
| grep -E '^.+: on$' \
|
||||
| grep -v -E '^tx-checksum-.+$' \
|
||||
| grep -v -E '^tx-scatter-gather.+$' \
|
||||
| grep -v -E '^tx-tcp.+segmentation.+$' \
|
||||
| grep -v -E '^tx-udp-fragmentation$' \
|
||||
| grep -v -E '^tx-generic-segmentation$' \
|
||||
| grep -v -E '^rx-gro$' \
|
||||
| grep -v -E '^rx-gro$' \
|
||||
| grep -v -E '^$' \
|
||||
| cut -d: -f1)
|
||||
|
||||
# Replace feature name by global keyword
|
||||
features=$(echo "$features" | sed -e s/rx-checksumming/rx/ \
|
||||
-e s/tx-checksumming/tx/ \
|
||||
-e s/scatter-gather/sg/ \
|
||||
-e s/tcp-segmentation-offload/tso/ \
|
||||
-e s/udp-fragmentation-offload/ufo/ \
|
||||
-e s/generic-segmentation-offload/gso/ \
|
||||
-e s/generic-receive-offload/gro/ \
|
||||
-e s/large-receive-offload/lro/ \
|
||||
-e s/rx-vlan-offload/rxvlan/ \
|
||||
-e s/tx-vlan-offload/txvlan/ \
|
||||
-e s/ntuple-filters/ntuple/ \
|
||||
-e s/receive-hashing/rxhash/)
|
||||
|
||||
# Check if we can disable anything
|
||||
if [ -z "$features" ]; then
|
||||
logger "[ethtool] offloads: no changes performed on $interface"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Construct ethtool command line
|
||||
cmd="-K $interface"
|
||||
|
||||
for feature in $features; do
|
||||
cmd="$cmd $feature off"
|
||||
done
|
||||
|
||||
# Try to disable offloads
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Offloads" "$interface"
|
||||
|
||||
else
|
||||
log $? "Offloads" "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function disable_flow_control()
|
||||
{
|
||||
local interface="$1"
|
||||
local features
|
||||
local cmd
|
||||
|
||||
# Check if we can change settings
|
||||
if ethtool -a $interface 1>/dev/null 2>/dev/null; then
|
||||
|
||||
# Construct ethtool command line
|
||||
cmd="-A $interface autoneg off tx off rx off"
|
||||
|
||||
# Try to disable flow control
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Flow Control" "$interface"
|
||||
|
||||
else
|
||||
log $? "Flow Control" "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function disable_interrupt_moderation()
|
||||
{
|
||||
local interface="$1"
|
||||
local features
|
||||
local cmd
|
||||
|
||||
# Check if we can change settings
|
||||
if ethtool -c $interface 1>/dev/null 2>/dev/null; then
|
||||
# Construct ethtool command line
|
||||
cmd="-C $interface adaptive-tx off adaptive-rx off"
|
||||
|
||||
# Try to disable adaptive interrupt moderation
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Adaptive Interrupt Moderation" "$interface"
|
||||
|
||||
features=$(ethtool -c $interface | awk '{$1=$1;print}' \
|
||||
| grep -v -E '^.+: 0$|Adaptive|Coalesce' \
|
||||
| grep -v -E '^$' \
|
||||
| cut -d: -f1)
|
||||
|
||||
# Check if we can disable anything
|
||||
if [ -z "$features" ]; then
|
||||
logger "[ethtool] Interrupt Moderation: no changes performed on $interface"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Construct ethtool command line
|
||||
cmd="-C $interface"
|
||||
|
||||
for feature in $features; do
|
||||
cmd="$cmd $feature 0"
|
||||
done
|
||||
|
||||
# Try to disable interrupt Moderation
|
||||
ethtool $cmd 1>/dev/null 2>/dev/null
|
||||
log $? "Interrupt Moderation" "$interface"
|
||||
|
||||
else
|
||||
log $? "Interrupt Moderation" "$interface"
|
||||
fi
|
||||
}
|
||||
|
||||
function main()
|
||||
{
|
||||
for interface in /sys/class/net/*; do
|
||||
interface=$(basename $interface)
|
||||
|
||||
#interface=$(get_base_interface "$interface")
|
||||
#{ [ -z "$interface" ] || interface_is_virtual "$interface"; } && exit 0
|
||||
|
||||
# Skip Loopback
|
||||
if [ $interface == lo ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
disable_offloads "$interface"
|
||||
disable_flow_control "$interface"
|
||||
disable_interrupt_moderation "$interface"
|
||||
done
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
exit 0
|
||||
0
qca-nss-ecm/files/ecm_dump.sh
Normal file → Executable file
0
qca-nss-ecm/files/ecm_dump.sh
Normal file → Executable file
@ -1,13 +1,34 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
uci -q batch << EOF
|
||||
delete firewall.nss_ecm
|
||||
set firewall.nss_ecm=include
|
||||
set firewall.nss_ecm.type=script
|
||||
set firewall.nss_ecm.path=/etc/firewall.d/qca-nss-ecm
|
||||
set firewall.nss_ecm.family=any
|
||||
set firewall.nss_ecm.reload=1
|
||||
commit firewall
|
||||
delete firewall.qcanssecm
|
||||
set firewall.qcanssecm=include
|
||||
set firewall.qcanssecm.type=script
|
||||
set firewall.qcanssecm.path=/etc/firewall.d/qca-nss-ecm
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
grep -q "fw3" /etc/init.d/firewall && {
|
||||
uci -q batch << EOF
|
||||
set firewall.qcanssecm.family=any
|
||||
set firewall.qcanssecm.reload=1
|
||||
commit firewall
|
||||
EOF
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
#!/bin/sh
|
||||
if [ ! -r /sbin/fw4 ]; then
|
||||
iptables-save|grep physdev-is-bridged|while read a; do
|
||||
iptables -D FORWARD -m physdev --physdev-is-bridged -j ACCEPT
|
||||
done
|
||||
iptables -I FORWARD 1 -m physdev --physdev-is-bridged -j ACCEPT
|
||||
|
||||
if grep -q "fw3" /etc/init.d/firewall; then
|
||||
iptables -nvL | grep -q "Chain RATE-LIMIT" && iptables -F RATE-LIMIT
|
||||
iptables -nvL | grep -q "Chain RATE-LIMIT" || iptables -N RATE-LIMIT
|
||||
iptables -A RATE-LIMIT --match limit --limit 1000/sec --limit-burst 1000 -j RETURN
|
||||
iptables -A RATE-LIMIT -j DROP
|
||||
iptables -I zone_wan_forward 5 --match conntrack --ctstate NEW -j RATE-LIMIT
|
||||
elif grep -q "fw4" /etc/init.d/firewall; then
|
||||
nft add chain inet fw4 RATE-LIMIT
|
||||
nft add rule inet fw4 RATE-LIMIT limit rate 1000/second burst 1000 packets counter return
|
||||
nft add rule inet fw4 RATE-LIMIT counter drop
|
||||
nft insert rule inet fw4 forward_wan ct state new counter jump RATE-LIMIT
|
||||
fi
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (c) 2014, 2019 The Linux Foundation. All rights reserved.
|
||||
# Copyright (c) 2014, 2019-2020 The Linux Foundation. All rights reserved.
|
||||
#
|
||||
# Permission to use, copy, modify, and/or distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
@ -18,39 +18,44 @@
|
||||
# openwrt build scripts automatically enable this package starting
|
||||
# at boot.
|
||||
|
||||
START=19
|
||||
START=26
|
||||
|
||||
sysctl_update() {
|
||||
local name value file
|
||||
name=${1//\//\\/}
|
||||
value=${2//\//\\/}
|
||||
file=${3:-/etc/sysctl.d/qca-nss-ecm.conf}
|
||||
sed -i -e '/^#\?\(\s*'"${name}"'\s*=\s*\).*/{s//\1'"${value}"'/;:a;n;ba;q}' \
|
||||
-e '$a'"${name}"'='"${value}" "${file}"
|
||||
sysctl -w ${name}=${value}
|
||||
}
|
||||
|
||||
get_front_end_mode() {
|
||||
config_load "ecm"
|
||||
config_get front_end global acceleration_engine "nss"
|
||||
config_get front_end global acceleration_engine "auto"
|
||||
|
||||
case $front_end in
|
||||
auto)
|
||||
echo 0
|
||||
echo '0'
|
||||
;;
|
||||
nss)
|
||||
echo 1
|
||||
;;
|
||||
sfe)
|
||||
echo 2
|
||||
echo '1'
|
||||
;;
|
||||
*)
|
||||
echo "uci_option_acceleration_engine is invalid"
|
||||
;;
|
||||
echo 'uci_option_acceleration_engine is invalid'
|
||||
esac
|
||||
}
|
||||
|
||||
support_bridge() {
|
||||
#NSS support bridge acceleration
|
||||
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && return 0
|
||||
#SFE doesn't support bridge acceleration
|
||||
[ -d /sys/kernel/debug/ecm/ecm_sfe_ipv4 ] && return 1
|
||||
enable_bridge_filtering() {
|
||||
sysctl_update net.bridge.bridge-nf-call-arptables 1
|
||||
sysctl_update net.bridge.bridge-nf-call-iptables 1
|
||||
sysctl_update net.bridge.bridge-nf-call-ip6tables 1
|
||||
}
|
||||
|
||||
load_sfe() {
|
||||
[ -d /sys/module/shortcut_fe ] || insmod shortcut-fe
|
||||
[ -d /sys/module/shortcut_fe_ipv6 ] || insmod shortcut-fe-ipv6
|
||||
[ -d /sys/module/shortcut_fe_drv ] || insmod shortcut-fe-drv
|
||||
disable_bridge_filtering() {
|
||||
sysctl_update net.bridge.bridge-nf-call-arptables 0
|
||||
sysctl_update net.bridge.bridge-nf-call-iptables 0
|
||||
sysctl_update net.bridge.bridge-nf-call-ip6tables 0
|
||||
}
|
||||
|
||||
load_ecm() {
|
||||
@ -59,15 +64,23 @@ load_ecm() {
|
||||
echo 1 > /sys/kernel/debug/ecm/ecm_classifier_default/accel_delay_pkts
|
||||
}
|
||||
|
||||
support_bridge && {
|
||||
sysctl -w net.bridge.bridge-nf-call-ip6tables=1
|
||||
sysctl -w net.bridge.bridge-nf-call-iptables=1
|
||||
}
|
||||
# Set conntrack event mode to 1 for 6.1 kernel to get the conntrack events from ECM
|
||||
local kernel_major
|
||||
kernel_major=$(uname -r |cut -d. -f1)
|
||||
if [ "$kernel_major" -eq 6 ]; then
|
||||
echo 1 > /proc/sys/net/netfilter/nf_conntrack_events
|
||||
fi
|
||||
}
|
||||
|
||||
unload_ecm() {
|
||||
sysctl -w net.bridge.bridge-nf-call-ip6tables=0
|
||||
sysctl -w net.bridge.bridge-nf-call-iptables=0
|
||||
disable_bridge_filtering
|
||||
|
||||
# Change it back to 6.1 linux's default setting
|
||||
local kernel_major
|
||||
kernel_major="$(uname -r |cut -d. -f1)"
|
||||
if [ "$kernel_major" -eq 6 ]; then
|
||||
echo 2 > /proc/sys/net/netfilter/nf_conntrack_events
|
||||
fi
|
||||
|
||||
if [ -d /sys/module/ecm ]; then
|
||||
#
|
||||
@ -90,26 +103,32 @@ unload_ecm() {
|
||||
start() {
|
||||
load_ecm
|
||||
|
||||
# If the acceleration engine is NSS, enable wifi redirect.
|
||||
# If the acceleration engine is NSS, enable wifi redirect
|
||||
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=1
|
||||
|
||||
support_bridge && {
|
||||
sed -i '/^net.bridge.bridge-nf-call-ip/d' /etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
echo 'net.bridge.bridge-nf-call-ip6tables=1' >> /etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
echo 'net.bridge.bridge-nf-call-iptables=1' >> /etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
}
|
||||
# If bridge filtering is enabled, apply and persist the sysctl flags
|
||||
local bridge_filtering_enabled
|
||||
bridge_filtering_enabled="$(uci get ecm.@general[0].enable_bridge_filtering)"
|
||||
if [ "$bridge_filtering_enabled" -eq 1 ]; then
|
||||
echo "Bridge filtering is enabled in the ECM config, this will cause issues with NAT loopback!"
|
||||
enable_bridge_filtering
|
||||
else
|
||||
disable_bridge_filtering
|
||||
fi
|
||||
|
||||
if [ -d /sys/module/qca_ovsmgr ]; then
|
||||
insmod ecm_ovs
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
stop() {
|
||||
# If the acceleration engine is NSS, disable wifi redirect.
|
||||
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=0
|
||||
# If ECM is already not loaded, just return
|
||||
if [ ! -d /sys/module/ecm ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i '/^net.bridge.bridge-nf-call-ip/d' /etc/sysctl.d/99-qca-nss-ecm.conf
|
||||
# If the acceleration engine is NSS, disable wifi redirect
|
||||
[ -d /sys/kernel/debug/ecm/ecm_nss_ipv4 ] && sysctl -w dev.nss.general.redirect=0
|
||||
|
||||
if [ -d /sys/module/ecm_ovs ]; then
|
||||
rmmod ecm_ovs
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
# nf_conntrack_tcp_no_window_check is 0 by default, set it to 1
|
||||
net.netfilter.nf_conntrack_tcp_no_window_check=1
|
||||
net.netfilter.nf_conntrack_max=32768
|
||||
|
||||
@ -1,2 +1,8 @@
|
||||
config ecm 'global'
|
||||
option acceleration_engine 'auto'
|
||||
|
||||
config general
|
||||
option enable_bridge_filtering '0'
|
||||
option disable_offloads '0'
|
||||
option disable_flow_control '0'
|
||||
option disable_interrupt_moderation '0'
|
||||
|
||||
42
qca-nss-ecm/patches/0012-ecm_add-check-for-pppoe.patch
Normal file
42
qca-nss-ecm/patches/0012-ecm_add-check-for-pppoe.patch
Normal file
@ -0,0 +1,42 @@
|
||||
--- a/frontends/include/ecm_front_end_common.h
|
||||
+++ b/frontends/include/ecm_front_end_common.h
|
||||
@@ -332,15 +332,19 @@ static inline bool ecm_front_end_ppppoe_
|
||||
fe_type = ecm_front_end_type_get();
|
||||
switch (fe_type) {
|
||||
#ifdef ECM_FRONT_END_NSS_ENABLE
|
||||
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
|
||||
case ECM_FRONT_END_TYPE_NSS:
|
||||
ret = (nss_pppoe_get_br_accel_mode() == NSS_PPPOE_BR_ACCEL_MODE_DIS);
|
||||
break;
|
||||
#endif
|
||||
+#endif
|
||||
#ifdef ECM_FRONT_END_SFE_ENABLE
|
||||
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
|
||||
case ECM_FRONT_END_TYPE_SFE:
|
||||
ret = (sfe_pppoe_get_br_accel_mode() == SFE_PPPOE_BR_ACCEL_MODE_DISABLED);
|
||||
break;
|
||||
#endif
|
||||
+#endif
|
||||
default:
|
||||
DEBUG_TRACE("front end type: %d\n", fe_type);
|
||||
break;
|
||||
@@ -362,15 +366,19 @@ static inline bool ecm_front_end_ppppoe_
|
||||
fe_type = ecm_front_end_type_get();
|
||||
switch (fe_type) {
|
||||
#ifdef ECM_FRONT_END_NSS_ENABLE
|
||||
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
|
||||
case ECM_FRONT_END_TYPE_NSS:
|
||||
ret = (nss_pppoe_get_br_accel_mode() == NSS_PPPOE_BR_ACCEL_MODE_EN_3T);
|
||||
break;
|
||||
#endif
|
||||
+#endif
|
||||
#ifdef ECM_FRONT_END_SFE_ENABLE
|
||||
+#ifdef ECM_INTERFACE_PPPOE_ENABLE
|
||||
case ECM_FRONT_END_TYPE_SFE:
|
||||
ret = (sfe_pppoe_get_br_accel_mode() == SFE_PPPOE_BR_ACCEL_MODE_EN_3T);
|
||||
break;
|
||||
#endif
|
||||
+#endif
|
||||
default:
|
||||
DEBUG_WARN("front end type: %d is not supported\n", fe_type);
|
||||
break;
|
||||
@ -1,40 +1,6 @@
|
||||
--- a/frontends/nss/ecm_nss_common.h
|
||||
+++ b/frontends/nss/ecm_nss_common.h
|
||||
@@ -310,6 +310,7 @@ static inline bool ecm_nss_common_igs_ac
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
#ifdef ECM_CLASSIFIER_PCC_ENABLE
|
||||
/*
|
||||
* ecm_nss_common_fill_mirror_info()
|
||||
@@ -363,6 +364,7 @@ static inline bool ecm_nss_common_fill_m
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
bool ecm_nss_ipv6_is_conn_limit_reached(void);
|
||||
bool ecm_nss_ipv4_is_conn_limit_reached(void);
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv4.c
|
||||
@@ -1043,6 +1043,7 @@ static void ecm_nss_ported_ipv4_connecti
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
#ifdef ECM_CLASSIFIER_PCC_ENABLE
|
||||
/*
|
||||
* Set up the interfaces for mirroring.
|
||||
@@ -1067,6 +1068,7 @@ static void ecm_nss_ported_ipv4_connecti
|
||||
nircm->valid_flags |= NSS_IPV4_RULE_CREATE_MIRROR_VALID;
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
if (ecm_nss_ipv4_vlan_passthrough_enable && !ecm_db_connection_is_routed_get(feci->ci) &&
|
||||
(nircm->vlan_primary_rule.ingress_vlan_tag == ECM_FRONT_END_VLAN_ID_NOT_CONFIGURED) &&
|
||||
@@ -1896,14 +1898,8 @@ struct ecm_front_end_connection_instance
|
||||
@@ -1896,14 +1896,8 @@ struct ecm_front_end_connection_instance
|
||||
*/
|
||||
bool ecm_nss_ported_ipv4_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
@ -52,23 +18,7 @@
|
||||
&ecm_nss_ported_ipv4_accelerated_count[ECM_FRONT_END_PORTED_PROTO_TCP]);
|
||||
--- a/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
+++ b/frontends/nss/ecm_nss_ported_ipv6.c
|
||||
@@ -1012,6 +1012,7 @@ static void ecm_nss_ported_ipv6_connecti
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if (NSS_FW_VERSION_CODE > NSS_FW_VERSION(11,1))
|
||||
#ifdef ECM_CLASSIFIER_PCC_ENABLE
|
||||
/*
|
||||
* Set up the interfaces for mirroring.
|
||||
@@ -1036,6 +1037,7 @@ static void ecm_nss_ported_ipv6_connecti
|
||||
nircm->valid_flags |= NSS_IPV6_RULE_CREATE_MIRROR_VALID;
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
if (ecm_nss_ipv6_vlan_passthrough_enable && !ecm_db_connection_is_routed_get(feci->ci) &&
|
||||
(nircm->vlan_primary_rule.ingress_vlan_tag == ECM_FRONT_END_VLAN_ID_NOT_CONFIGURED) &&
|
||||
@@ -1809,14 +1811,8 @@ struct ecm_front_end_connection_instance
|
||||
@@ -1809,14 +1809,8 @@ struct ecm_front_end_connection_instance
|
||||
*/
|
||||
bool ecm_nss_ported_ipv6_debugfs_init(struct dentry *dentry)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user