Commit Graph

84 Commits

Author SHA1 Message Date
Sean Khan
adbbcb0c41 treewide: Refresh patches
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-07-10 22:12:00 -04:00
Sean Khan
1c24304019 nss-drv: [11.4] Backport priority to multi-queue mapping.
Enable an ingress priority to multi-queue priority mapping table.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-07-10 20:53:30 -04:00
Sean Khan
c885ad0e70 nss-drv: [11.4] backport stats write functionality from 12.5
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>
2025-07-10 20:48:47 -04:00
Sean Khan
b984c52eb8 nss-drv: [11.4] fix greredir stats partial copy issue.
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>
2025-07-10 20:47:51 -04:00
Sean Khan
dca6e6e880 nss-drv: fix write error when creating/destroying PPE VP interfaces
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>
2025-07-10 20:41:20 -04:00
Sean Khan
5cb2492405 nss-drv: fix null ptr deref when logging is enabled
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>
2025-07-10 20:37:06 -04:00
Sean Khan
a6d4d5bfc3 nss-drv: [12.5] fix missing GRE macro
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-07-10 20:34:51 -04:00
Sean Khan
febe0256ca nss-drv: nss_rps: fix buff size when writing
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-07-10 20:19:24 -04:00
Sean Khan
6b2c80e13a nss-drv: Limit RMNET and memory profile (IPQ5018/6018)
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>
2025-06-04 18:26:26 -04:00
Sean Khan
2f4750a191 nss-drv: rework smp affinity hangling
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>
2025-06-01 23:40:20 -04:00
Sean Khan
370137d0bf nss-drv: nss_stats: fix gawk regex compatibility
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>
2025-05-31 03:42:44 -04:00
Sean Khan
03f6cb25eb nss-drv: Limit arch specific NSS features
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>
2025-05-30 14:35:29 -04:00
Sean Khan
6b2d99511c nss-drv: Restore '-Wno-unused-variable' flag
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>
2025-05-30 03:21:05 -04:00
Sean Khan
de828e39b2 treewide: Additional fixes for kernel 6.12 + GCC 14.3+
Fixes for:

  incompatible-pointer-types: (nss gre)
  int-conversion

And ignore warnings for:
  empty-body

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-28 21:06:50 -04:00
Sean Khan
54d105f7ca nss-drv: additional fixes for kernel 6.12
Fixes the following sysctl table check failures:

[Tue May 27 17:37:40 2025] sysctl table check failed: dev/nss/ppe_vp/(null) procname is null
[Tue May 27 17:37:40 2025] sysctl table check failed: dev/nss/ppe_vp/(null) No proc_handler
[Tue May 27 17:37:40 2025] sysctl table check failed: dev/nss/pppoe/(null) procname is null
[Tue May 27 17:37:40 2025] sysctl table check failed: dev/nss/pppoe/(null) No proc_handler

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-27 19:13:10 -04:00
Sean Khan
9762fbaabe nss-drv: Fix GCC empty-body error in GCC 14.3+
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-27 15:47:10 -04:00
Sean Khan
25086fbac3 treewide: Additional fixes for kernel 6.12 + GCC 15.1
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-25 15:36:03 -04:00
Sean Khan
6f823a2b34 treewide: Initial support for kernel 6.12 + GCC 15.1
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-08 23:12:18 -04:00
Sean Khan
aeca10fbca nss-drv: [11.4] Fix empty line always appearing
Fixes the weird empty line that always appears in dmesg when loading

```
[Thu May  1 15:07:40 2025] hotplug: symlinking qca-nss0.bin to /lib/firmware/qca-nss0-retail.bin
[Thu May  1 15:07:40 2025] qca-nss 39000000.nss: NSS FW Version: NSS.HK.11.4.0.5-6-R
[Thu May  1 15:07:40 2025] qca-nss 39000000.nss: fw of size 835960 bytes copied to addr: 40000000, nss_id: 0

[Thu May  1 15:07:40 2025] qca-nss 39000000.nss: NSS core 0 booted successfully
[Thu May  1 15:07:40 2025] hotplug: symlinking qca-nss1.bin to /lib/firmware/qca-nss1-retail.bin
[Thu May  1 15:07:40 2025] qca-nss 39400000.nss: fw of size 292296 bytes copied to addr: 40800000, nss_id: 1

[Thu May  1 15:07:40 2025] qca-nss 39400000.nss: NSS core 1 booted successfully
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-01 19:14:04 -04:00
Sean Khan
7a0c508dec treewide: rework handling platform specific features
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>
2025-04-27 21:52:50 -04:00
Sean Khan
25bb2ac73b treewide: fix SHA hashes in Makefiles
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-27 13:55:38 -04:00
Sean Khan
18a9e76182 nss-drv: backport 12.5 ipq50xx fixes
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>
2025-04-26 03:30:21 -04:00
Sean Khan
8ae73bb2c6 nss-drv: treewide fix compiler warnings
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-17 22:41:30 -04:00
Sean Khan
387698c63b nss-drv: nss_rps/dscp fix read/write procfs files
Another fix for reading procfs files.

This fixes a long time bug where reading/writing to
ipv4_dscp_map, ipv6_dscp_map, pri_map would result in a 'Bad Memory'
error

Should now look like this when reading the following:

```
dev.nss.ipv4cfg.ipv4_dscp_map = priority: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
dev.nss.ipv4cfg.ipv4_dscp_map = action:   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
dev.nss.ipv6cfg.ipv6_dscp_map = priority: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
dev.nss.ipv6cfg.ipv6_dscp_map = action:   0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
dev.nss.rps.pri_map = Cores: -1 -1 -1 -1
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-17 12:01:06 -04:00
Sean Khan
32dd47ec01 nss-firmware: Rework platform dependancy and version string
- 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>
2025-04-17 12:00:18 -04:00
Sean Khan
f3318298a7 nss-drv: [11.4] sync more kernel 6.6 changes from 12.5
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>
2025-04-15 12:04:45 -04:00
Sean Khan
5e977b3eae nss-drv: [11.4] fix undefined GRE stats_ctx for non IPQ807x
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>
2025-04-08 03:10:22 -04:00
Sean Khan
e991bc1429 nss-drv: [12.5] bump to latest and refresh patches
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
```
2025-04-08 03:10:05 -04:00
shi JiaY
ab4635c11a
add ipq5018 support (#41)
* 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
2025-01-14 11:34:11 -05:00
Sean Khan
78defd3749 nss-drv: Move nss_diag to mac80211
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>
2024-10-05 03:02:10 -04:00
Sean Khan
b7cdafdb67 nss-drv: Fix nss_diag formatting
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-05 02:43:53 -04:00
Sean Khan
7dd1aff674 nss-drv: Display GRO Fraglist instead of GRO
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>
2024-10-05 00:16:26 -04:00
Sean Khan
b217c08798 nss-drv: Add diagnostic gathering utility
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>
2024-10-03 06:24:03 -04:00
Sean Khan
46cd9e7707 nss-drv: Fix 'mesh_mesh' naming mesh stats
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>
2024-09-21 16:31:13 -04:00
Sean Khan
2fcfece2b9 nss-drv: Add missing error code for wifili pkg.
Add missing error code between nss fw and nss drv.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-09-21 16:17:56 -04:00
Sean Khan
aba99bef05 nss-drv: let client and ecm choose driver features
Set all features to off, and let client/ecm automatically choose.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-08-09 19:55:44 -04:00
Sean Khan
23d5aaaf3f nss-drv: cleanup and refresh patches
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-08-09 01:42:04 -04:00
Sean Khan
0cf4f442e2 nss-drv: add boot wait
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>
2024-08-09 01:40:40 -04:00
Sean Khan
c5340b8d58 qca-nss: Bump 11.4 FW to 11.4.0.5-6
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>
2024-08-04 01:42:54 -04:00
Sean Khan
7a21a949cf treewide: Option to build for all NSS firmware
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>
2024-07-30 14:33:50 -04:00
Sean Khan
9c1bd07946 treewide: Bump NSS FW 12.1 to 12.5
Switch to personal fork utilizing NSS fw binaries from dd-wrt repo:
`https://github.com/mirror/dd-wrt/tree/master/src/router/qca-nss/firmware`

Also delete patches that limited feature set to NSS firmware 12.1

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-22 16:51:11 -04:00
Sean Khan
0b71120ef6 nss-drv: move nss_empty_buf* to different cores
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-13 19:34:41 -04:00
Sean Khan
ae952634ca nss-drv: fix formatting of hotplug script
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-13 19:31:04 -04:00
Sean Khan
217a4fa43b nss-drv: add skb_recycler init script
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>
2024-07-13 18:43:52 -04:00
Sean Khan
4490b7a4a7 nss-drv: More FW 12.1 fixes
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-10 17:36:42 -04:00
Sean Khan
1af951126c nss-drv: limit headers to fw 12.1
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-10 13:50:58 -04:00
Sean Khan
3af307f2e9 nss-drv: fix exports and split backports patch
* 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>
2024-07-10 13:13:24 -04:00
Sean Khan
78364afce8 nss-drv: Clean-up unecessary patches
`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>
2024-07-10 04:53:52 -04:00
Sean Khan
841d43b00f treewide: various patches for GCC-14 + build fixes
Also disabled pvxlanmgr and clmapmgr from showing up. It's badly broken
and not suported.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-08 21:03:51 -04:00
Sean Khan
76047d6637 nss-drv: extract and display nss firmware version
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>
2024-07-08 11:19:16 -04:00