Allow resetting some stats via debugfs interface.
Not all stats are resettable,
```sh
echo 0 > /sys/kernel/debug/qca-nss-drv/stats/drv
```
Signed-off-by: Sean Khan <datapronix@protonmail.com>
If the kernel passes smaller user buffer to copy stats
than required, copy the partial content from local buffer
and in next call copy the remaining content.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This is just a functional fix, the underlying framework for PPE VP is
not really useful for anything on ipq807x.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
When debug logging is enabled for bridge or gre a null
pointer deref error was causing system to crash
Signed-off-by: Sean Khan <datapronix@protonmail.com>
IPQ5018 and IPQ6018 are limited to 512MB so set default accordingly.
RMNET is also only supported on IPQ807x and IPQ5018.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Reworked SMP affinity handling for better balancing of PPDU and USBs
```
Pinning IRQ(46) nss_queue0 to CPU 0 (NSS Core 0)
Pinning IRQ(47) nss_queue1 to CPU 1 (NSS Core 0)
Pinning IRQ(48) nss_queue2 to CPU 2 (NSS Core 0)
Pinning IRQ(49) nss_queue3 to CPU 3 (NSS Core 0)
Pinning IRQ(57) nss_queue0 to CPU 3 (NSS Core 1)
Pinning IRQ(58) nss_queue1 to CPU 2 (NSS Core 1)
Pinning IRQ(59) nss_queue2 to CPU 1 (NSS Core 1)
Pinning IRQ(60) nss_queue3 to CPU 0 (NSS Core 1)
Pinning IRQ(43) nss_empty_buf_sos to CPU 0 (NSS Core 0)
Pinning IRQ(44) nss_empty_buf_queue to CPU 0 (NSS Core 0)
Pinning IRQ(53) nss_empty_buf_sos to CPU 3 (NSS Core 1)
Pinning IRQ(55) nss_empty_buf_queue to CPU 3 (NSS Core 1)
Pinning IRQ(41) xhci-hcd:usb1 to CPU 2
Pinning IRQ(42) xhci-hcd:usb3 to CPU 2
Pinning IRQ(79) ppdu-end-interrupts-mac1 to CPU 2
Pinning IRQ(83) ppdu-end-interrupts-mac2 to CPU 3
Pinning IRQ(81) ppdu-end-interrupts-mac3 to CPU 1
```
Primarily meant to improve performance on Arcadyan AW1000 which uses USB
based cellular modems (xhci-hcd:usb3). They are now pinned to CPU 2
Signed-off-by: Sean Khan <datapronix@protonmail.com>
It's not necessary to escape '#' and '=' in awk regexes, doing so
causes gawk to throw warnings.
Busybox awk is more permissive and does not throw warnings.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Prevent selecting or building NSS features that are ipq806x specific
These include:
- Port ID (nss_portid.c)
- OAM (nss_oam.c)
- Timestamping (nss_tstamp.c)
- Legacy WiFi Offload (nss_wifi.c)
Signed-off-by: Sean Khan <datapronix@protonmail.com>
It was accidentally removed in commit: de828e39b
("treewide: Additional fixes for kernel 6.12 + GCC 14.3")
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Overhaul the way platform-specific requirements are handled since
IPQ60xx and IPQ50xx don't support all the same features as IPQ807x.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
First attempt at backporting the 12.5 ipq50xx fixes to 11.4.
Fixes compilation errors, but not tested on hardware yet.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
- Added proper CONFLICTS which should allow building multiple
firmwares in the same build tree.
- Updated version string for 11.4 (it was 5 when it's been 6 for a while)
- Adjusted nss-eip-firmware dependency to match IPQ807x/IPQ60xx since
'TARGET_qualcommax` included IPQ50xx which does not have EIP hardware.
- PKG_RELEASE bumped to 2
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Mostly cosmetic changes, but also:
* Extend kernel version handling so kernels 6.1–6.14
are supported (untested on > 6.6)
* Replace various `NSS_SUCCESS`/`NSS_FAILURE` return codes with
`NSS_TX_SUCCESS`/`NSS_TX_FAILURE`
* Change di_data.response initialization in the dynamic interface
to use NSS_CMN_RESPONSE_ACK.
Primary affects `0016-nss-drv-add-support-for-kernel-6.6.patch`, while
other patches were refreshed.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
When building NSS GRE feature for non IPQ807x targets, the GRE `stats_ctx`
was not being properly defined.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit updates 12.5 version of the nss-drv from:
30fbfa4 -> 4dfab93
Bringing in the following changes:
```
2024-11-13 - d5ee67b - Add support for clearing N2H stats
2024-11-13 - 4850be3 - Add support for clearing DRV stats
2024-11-13 - 3d7c16d - Add support for clearing capwap stats
2024-11-13 - 163fbf4 - Add support clearing Crypto CMN stats
2024-11-13 - 084b475 - Add support for clearing DTLS CMN stats
2024-11-13 - e32f844 - Add support clearing PVxLAN stats
2024-11-13 - 2f54141 - Add support for clearing ipv6 stats
2024-11-13 - 702b14c - Add support for clearing C2C TX stats
2024-11-13 - 201dbc5 - Add support for clearing ipv4 stats
2024-11-13 - 24b6f1a - Add support for clearing eth_rx stats
2024-11-05 - 6e242de - Add support for clearing C2C RX stats
2024-11-05 - 942593c - Added a flag to identify if HW UDP checksum is supported for udp_st
2024-11-05 - e11eb4e - Add support for clearing Trustsec TX stats
2024-11-05 - 4f01399 - Add support for clearing EDMA Lite stats
2024-11-05 - 45b9a31 - Add support for clearing Trustsec RX stats
2024-11-05 - 57b338d - Add baseline stats write functionality
2024-10-16 - b671190 - Fix dtsi parameter that controls enabling UBI
2024-10-08 - 9514a99 - Enabling qca-nss-drv on 6.6 kernel
2024-07-16 - e96972f - udp_st: Add a new mode to handle unsynchronized time.
2024-05-16 - 1db9e55 - Add missing error code for wifili pkg.
```
Stats can be cleared by echoing `0` to the corresponding stats file.
For example, to clear the N2H stats, you can run:
```
echo 0 > /sys/kernel/debug/qca-nss-drv/stats/n2h
```
* qca-nss-drv: add ipq5018 support
* qca-nss-clients: add ipq5018 support
* qca-nss-crypto: add ipq5018 support
* qca-nss-cfi: add ipq5018 support
* qca-nss-macsec: add ipq5018 support
mac80211 is built inside of the main openwrt fork, so it will always
generate a more up to date `/etc/ipq_release` when being packaged.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Replace showing `gro` (Generic Recieve Offload) with
`rx-gro-list` (GRO Fraglist) as that is the more problematic
feature known to cause issues.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This is meant to ease debugging when asking for support. Just run the
command "nss_diag" and include in your issues/forum posts.
Example of output
```
MODEL: Linksys MX5300
OPENWRT: r27608+169-3f98f68573
IPQ BRANCH: qualcommax-6.x-nss-mx4300-6.11
IPQ COMMIT: 2153dceb34
IPQ DATE: 2024-10-03
NSS FW: NSS.HK.11.4.0.5-6-R
MAC80211: v6.11-0-g98f7e32f20d2
ATH11K FW: WLAN.HK.2.12-01368-QCAHKSWPL_SILICONZ-1
GRO: wan : on
br-lan : on
lan1 : on
lan2 : on
lan3 : on
lan4 : on
phy0-mesh0 : on
phy1-ap0 : on
phy2-ap0 : on
NSS PKGS: kmod-qca-nss-cfi-cryptoapi - 6.6.53.12.5.2022.12.15~5cd07ce-r3
kmod-qca-nss-crypto - 6.6.53.12.5.2022.12.15~3c5a574-r3
kmod-qca-nss-dp - 6.6.53.2024.04.16~5bf8b91e-r1
kmod-qca-nss-drv - 6.6.53.11.4.0.5.2021.09.13~53e5863-r13
kmod-qca-nss-drv-bridge-mgr - 6.6.53.11.4.0.5.2021.08.17~c4049d1-r7
kmod-qca-nss-drv-igs - 6.6.53.11.4.0.5.2021.08.17~c4049d1-r7
kmod-qca-nss-drv-qdisc - 6.6.53.11.4.0.5.2021.08.17~c4049d1-r7
kmod-qca-nss-drv-vlan-mgr - 6.6.53.11.4.0.5.2021.08.17~c4049d1-r7
kmod-qca-nss-drv-wifi-meshmgr - 6.6.53.11.4.0.5.2021.08.17~c4049d1-r7
kmod-qca-nss-ecm - 6.6.53.12.5.5.2024.09.02~bd5057b-r1
nss-eip-firmware - 2.5.7-r3
nss-firmware-default - 2024.08.04~794fe373-r1
nss-firmware-ipq8074 - 2024.08.04~794fe373-r1
```
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Cleans up mesh stats naming to remove 'mesh' from prefix as it's already
prefixed when displaying. Otherwise it shows up as 'mesh_mesh'
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Ensures NSS cores are fully booted to hopefully workaround issues with
wifi stats (rx/tx rates) and inactive time.
Patch-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This bumps NSS 11.4.0.5-5 to 11.4.0.5-6 along with the driver and client
packages.
This is the actual final release of 11.4.0.5 series. It brings in
changes related to mesh dummy paths and wifi.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
The idea that "newer" NSS firmware = "better" is not always true.
Especially given that 11.4 is the only firmware known to work with mesh,
among other issues like WDS/rmnet_nss being broken on 12.5 releases.
Add option to allow building for all known and available NSS firmwares.
The following are now supported NSS firmwares:
1.) 11.4.0.5-5
2.) 12.1
3.) 12.2
4.) 12.5
Users should start with 11.4 as that seems to be the one with the most
enabled features. It is now also the default version.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This script is meant to set various skb_recycler settings. There is a
similar version in QSDK, but it's packaged in the main repo, rather than
an external package like 'qca-nss-drv'. To avoid making too many changes
in the main repo, introduce this script in `qca-nss-drv`.
This script will read the following config:
/etc/config/skb_recycler
```
config skb_recycler 'opt'
option max_skbs '1024'
option max_spare_skbs '256'
option enable '1'
```
Users are encouraged to experiment disabling `skb_recycler` to see if
memory leaks are still occuring, especially on 512M boards. There are issues
currently where skb_recycler corrupts skbs during times of high traffic, but there
wasn't a way to completely disable it.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
* Cleaned up backports patch to only bring in header changes if they are
not tied directly to NSS firmware API. Because the API for NSS
firmware has strict structure and ordering, it ends up messing with
driver calls.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
`0012-Makefile-modularize-driver.patch` mistakenly added 'wifi_mesh_init'
when it was already in 'nss_init.c'.
The patch following `0013-backport-12.4.patch` would then
clean up the "duplicated" entries.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Added a custom function to show NSS firmware version during boot.
```
[Mon Jul 8 07:45:21 2024] qca-nss 39000000.nss: NSS FW Version: NSS.FW.12.1-022-HK.R
```
And
```
[Mon Jul 8 07:21:12 2024] qca-nss 39000000.nss: NSS FW Version: NSS.HK.11.4.0.5-5-R
```
Not sure why Qualcomm never included this ability in their drivers, since
it's clearly there in every firmware.
Signed-off-by: Sean Khan <datapronix@protonmail.com>