Commit Graph

54 Commits

Author SHA1 Message Date
breeze303
2b94eaf3ba Merge remote-tracking branch 'qos/NSS-12.5-K6.x' into NSS-12.5-K6.x 2024-09-27 21:10:50 +08: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
breeze303
ea2caa71e2 Merge remote-tracking branch 'qos/NSS-12.5-K6.x' into NSS-12.5-K6.x 2024-09-21 10:41:36 +08:00
tiffany-929
721413093f add ipq50xx 2024-09-02 16:39:25 +08: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
Sean Khan
cc45b20f63 treewide: remove excutable bit and apply on install
Files should really not stored as executable.

Only make them excutable on package installation.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-08 11:06:17 -04:00
Sean Khan
b290b88fc0 nss-drv: clean up hotplug script
Cleaned up formatting and changed the way console messages are printed.

The message will now properly show up in dmesg output with color, and
date formatting rather than a non descriptive message like the following:

Before:
```
/lib/firmware/qca-nss0-retail.bin 33
/lib/firmware/qca-nss1-retail.bin 33
```

After:
```
[Mon Jul  8 07:21:12 2024] hotplug: symlinking /lib/firmware/qca-nss0.bin to /lib/firmware/qca-nss0-retail.bin
[Mon Jul  8 07:21:12 2024] hotplug: symlinking /lib/firmware/qca-nss1.bin to /lib/firmware/qca-nss1-retail.bin
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-08 10:52:53 -04:00
Sean Khan
bacbac33cb nss-drv: 11.4 split out formatting from 12.4 backbort
This is mostly a cosmetic change and meant to make it easier to see
the to see history of commits.

The currently published NSS FW on QUIC's repo is:

NSS.HK.11.4.0.5-5-R which is on branch caf_migration/NHSS.QSDK.11.4.0.5

However, it's not the latest of the `11.4.0.5` release which is

NSS.HK.11.4.0.5-6-R which is on branch `origin/NSS_11.4.0.5`

Although the versions look to be minor releases. NSS driver shows
significant changes in the headers files concerning `wifi` and `wifi
mesh`.

When doing a diff between the 2 releases, it was hard to tell exactly
what changed because most of it seemed to be non-functional changes,
formatting, etc. This patch is only meant to make the files visually
similiar between the two releases, to better show functional changes.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-08 10:16:00 -04:00
Sean Khan
19f6ecc012 qca-nss-drv: refactor __nss_hal_request_irq
refactored the logic in `__nss_hal_request_irq` to use case statements,
with a single call to `netif_napi_add_weight` and `request_irq`.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 21:06:57 -04:00
Sean Khan
cefc1a062d qca-nss-drv: Use devinfo for cleaner kernel logs
Use kernel built-in `devinfo` to show cleaner kernel logs. This allows
showing the module and specific NSS device the message is meant for.

```
[Tue Jul  2 04:27:45 2024] qca-nss 39000000.nss: fw of size 833304 bytes copied to addr: 40000000, nss_id: 0
[Tue Jul  2 04:27:45 2024] qca-nss 39000000.nss: NSS core 0 booted successfully
[Tue Jul  2 04:27:45 2024] qca-nss 39400000.nss: fw of size 292296 bytes copied to addr: 40800000, nss_id: 1
[Tue Jul  2 04:27:45 2024] qca-nss 39400000.nss: NSS core 1 booted successfully
[Tue Jul  2 04:28:03 2024] qca-nss 39000000.nss: Configuring additional NSS pbufs
[Tue Jul  2 04:28:03 2024] qca-nss 39000000.nss: Additional pbufs of size 10002432 got added to NSS
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 21:02:06 -04:00
Sean Khan
07cee3d981 qca-nss-drv: Rework smp_affinity logic
Reworked flawed smp_affinity logic. It was assumed that all 'nss_*' IRQs
needed to be equally balanced across all CPUs. However, what ends up
happening most of the time is messing with scheduling, thrashing, missed
cache and high context switching.

For each core:
  1. nss_empty_buf_sos
  2. nss_empty_buf_queue
  3. nss_queue0

The IRQs should be kept on the same CPU. Doing so allows NSS cores to
properly feed and empty the queues.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 20:44:35 -04:00
Sean Khan
16716f0305 qca-nss-drv: better align 12.4 backport layout
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 20:42:02 -04:00
Sean Khan
4e841d15bb qca-nss-drv: add missing gmac patch
Add in missing gmac. Meant for IPQ806X

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 20:38:38 -04:00
Sean Khan
4b43beae97 qca-nss: switch to checking value vs. ifdef
This allows specifiying `CONFIG_NSS_FIRMWARE_VERSION_.*` on
the command line without having to set in .config. This is helpful if
needing to build/test both version quickly.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 20:31:01 -04:00
Sean Khan
1ae543092a treewide: Refactor for APK based builds
Update to comply with APK's `pkgver` format.

Rather than stick with the same convention as upstream `qca-ssdk` and
`qca-nss-dp` which uses:

```
$(PKG_NAME)-$(PKG_SOURCE_DATE)~$(PKG_SOURCE_VERSION)
```

i.e. `qca-ssdk-2024.06.13~c451136b.tar.zst`

Add in the QSDK version as part of the release since we
have options to build for both 11.4 and 12.5. This makes it easier to
debug build related issues, by knowing exactly which QSDK version is
being built against.

Example:
```
qca-nss-drv-11.4.0.5.2021.06.24~dc14ca2.tar.zst
qca-nss-drv-12.5.2024.04.06~53a0dc1.tar.zst
qca-nss-clients-11.4.0.5.2021.08.17~153998d.tar.zst
qca-nss-clients-12.5.2024.03.05~9a53b18.tar.zst
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-24 20:33:28 -04:00
Sean Khan
5c4eb1c3b7 qca-nss-drv: Improve nss_stats script
allow users to specify specific metric to view, rather than
everything

Available stats objects:
      cpu
      crypto_cmn
      dma
      drv
      dynamic_if
      edma
      eth_rx
      ipv4
      ipv6
      n2h
      unaligned
      virt_if
      wifi_ext_vdev
      wifi
      mesh

Usage: nss_stats obj1 obj2 ...

Default with no parameters shows all

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-23 17:12:55 -04:00
Sean Khan
b00980f17b treewide: Bump to consolidated release QSDK-12.5
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-23 16:39:16 -04:00
Sean Khan
5fa030cfed Revert "qca-nss-drv: add NAPI threading"
This reverts commit 5700922738.

Causes panic on IPQ807x platforms after sometime. Drop NAPI patch

[180247.904310] Call trace:
[180247.908300]  dump_backtrace+0xb0/0x10c
[180247.910992]  show_stack+0x18/0x24
[180247.914550]  dump_stack_lvl+0x48/0x60
[180247.918023]  dump_stack+0x18/0x24
[180247.921756]  __schedule_bug+0x54/0x6c
[180247.925141]  __schedule+0x4f0/0x5e8
[180247.928873]  schedule+0x5c/0xc4
[180247.932605]  napi_threaded_poll+0x60/0x1f8
[180247.935819]  kthread+0x10c/0x110
[180247.939724]  ret_from_fork+0x10/0x20
[180609.113998] BUG: scheduling while atomic: napi/nss-9/1264/0x00000201

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-05 19:47:31 -04:00
Sean Khan
a4d36065f6 qca-nss-drv: allow mac80211 to disable signal redirection
Added from brainslayer's patch here:

https://svn.dd-wrt.com/changeset/56322

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-02 19:38:54 -04:00
Sean Khan
5700922738 qca-nss-drv: add NAPI threading
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-02 19:35:52 -04:00
Sean Khan
9308d452f6 nss-packages: Bump to QSDK 12.5 for kernel 6.6
note: qca-nss-crypto, and qca-nss-cfi are non-code change releases, but
align with naming scheme upstream anyways.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-05-05 02:49:54 -04:00
Qosmio
2075ebd759 nss-packages: update hashes for 'zst'
Signed-off-by: Qosmio <datapronix@protonmail.com>
2024-04-09 00:25:58 -04:00
Qosmio
f47aab0ae0 qca-nss-drv: better logging + handle more IRQs + sane defaults
1.) Rather than modify upstream `smp_affinity` script, move changes into
    this init script.

    Primarily: "xhci-hcd:usb1", "ppdu-end-interrupts-mac1", "ppdu-end-interrupts-mac2"

2.) Move logging into separate function, and better account for NSS core
    specific output.

3.) Set the defaults for `enable_rps` and `enable_log` to true ('1').

4.) Change startup to sequence to `94` [after `smp_affinity` (93)]

Signed-off-by: Qosmio <datapronix@protonmail.com>
2024-04-08 18:36:03 -04:00
Qosmio
2670f4c75a qca-nss-drv: Fix missing /usr/bin for nss_stats 2024-04-07 00:01:31 -04:00
Qosmio
41f1217c5e qca-nss-drv: Rework smp_affinity + Add nss_stats
1.) Moved `set_affinity` function outside of `enable_rps`
2.) Added 2 new functions `bitmask_to_cpus` and `cpus_to_bitmask`
    a.) bitmask_to_cpus - Takes a bitmask of CPUs and returns a
        list of CPU numbers. (i.e. `bitmask_to_cpus "f"` -> 0,1,2,3)
    b.) cpus_to_bitmask - Takes a comma/space or range list of CPUs and returns
        a bitmask. (i.e. `cpus_to_bitmask "2,3"` -> c)
3.) Changed logic of `set_affinity` to now use physical CPUs rather than
    knowing the bitmask. This should make it more straight forward when
    testing changes
4.) Added an UCI option `enable_log` to enable/disable logging output to
   `logger`. Default is `1` (on)
5.) Removed unused UCI options `nss_firmware *`
6.) Changed the way UCI options are retrieved to account for missing
    options.
7.) Moved '/lib/debug/qca-nss-drv' to '/usr/bin/nss_stats' so it's in
    $PATH and has a more intuitive name
2024-04-06 19:59:50 -04:00
anonymous-one
29f9ba9648
Better handling of nss_queue + etc affinity
Using the previous version, not all nss related interrupts were being balanced across the available CPU cores.

This makes sure they are as well as moving a bit more off cpu0.
2024-04-06 10:32:14 +02:00
Qosmio
a681594860 nss-packages: add backwards compatible TARGET option ipq807x 2024-03-26 12:26:14 -04:00
Qosmio
952e573a71 nss-packages: convert modules to use wifili vs wifi 2024-03-17 02:18:20 -04:00
Qosmio
ebd3cebaec nss-packages: Initial support for kernel 6.6 on NSS 11.4 2024-03-15 23:24:02 -04:00
Qosmio
2692698a8a nss-packages: add QSDK release in naming scheme
Easier to understand which QSDK you're developing with vs. date and git
hash
2024-03-15 23:22:46 -04:00
Qosmio
911ca7392c qca-nss-drv: show cpu_load_ubi in output 2024-03-15 19:43:57 -04:00
Qosmio
327b97d4a0 qca-nss-drv: Move Profiler code to ipq806x
Useless to build on IPQ807x/60xx
2024-03-12 17:22:54 -04:00
Qosmio
8795d29dfb nss-packages: Initial support for kernel 6.6
WIP
2024-03-12 12:00:52 -04:00
Qosmio
c7c8de990f nss-packages: refresh patches 2024-03-11 15:53:55 -04:00
Qosmio
7329a4f74d nss: Properly build drv/client based on FW
There are significant changes between NSS version 11.4.0.5 and 12.1 (12.0.5),
that it doesn't really make sense to use it with older firmware (i.e. using mesh releated
features).

This change will explicitly link building the proper driver and client
packages when FW 12.1 or 11.4 is selected, while also backporting
patches from 12.4.
2024-03-09 12:25:24 -05:00