Commit Graph

245 Commits

Author SHA1 Message Date
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
7d0fa17d0e qca-nss-ecm: Add fw4 check for bridge filter
iptables based bridge filtering is incompatible with nftables (fw4), and
causes just causes NAT loopback issues.

This is only required for systems using legacy iptables (fw3) as the
primary firewalling. nftables doesn't need explicit enablement of bridge filtering.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 20:20:10 -04:00
Sean Khan
2dbb426a29 qca-nss-ecm: bump latest 12.5 and fix fortify_memcpy_chk
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-02 20:18:13 -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
174edae00a nss-firmware: fix building for IPQ60XX/IPQ50XX
Remove the $(NSS_ARCHIVE) variable that conflicts with building for
platforms other than IPQ807X. NSS_ARCHIVE is getting evaluated on very first
platform, rather than each platform.

This was primarily meant for externally hosted NSS firmware, but was mostly used internally.
Can be safely removed.

Reported-by: Shi Jiay (shi05275@gmail.com)

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-22 16:10:49 -04:00
Shi JiaYang
1d044076d9 qca-nss-macsec: add ipq6018 support 2024-06-22 16:07:43 -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
f9ca66a002 qca-nss: mark nss-cfi and nss-crypto as broken
Because of the way these modules will hook into the kernel certain
applications that use devcrypto will try to offload to it. This just
kernel panics and user confusion.

These modules are broken on IPQ807x and there has been no work upstream
to fix it in over 3 years. Luckily these modules aren't required to get
offloading for over 95% of use cases (mostly just affects
IPSec/OpenVPN).

Rather than removing, I'm disabling these modules from showing up
in default build options when "@BROKEN" isn't explicitly enabled.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-02 19:42:51 -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
f5844d3706 qca-nss-ecm: Enable bridge vlan filtering
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-06-02 19:32:34 -04:00
Sean Khan
5f6afea20a nss-ecm: add missing uci option
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-05-05 12:47:59 -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
Sean Khan
da8d2acc7a nss-ecm: fix uci config lookup 2024-05-01 14:38:38 -04:00
Sean Khan
d0669b3eb9 qca-mcs: Add support for kernel >= 6.6.29
kernel 6.6.29 added an additional parameter to `br_pass_frame_up` (bool
promisc). Add a check for it and handle accordingly.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-28 13:37:50 -04:00
Sean Khan
1891a290e0 nss-ecm: switch to using named sections in uci
The way ECM uci config is handled is pretty ugly due to it not specifying a
named section for 'general'.

Current:
```
➤ uci show ecm
ecm.global=ecm
ecm.global.acceleration_engine='nss'
ecm.@general[0]=general
ecm.@general[0].enable_bridge_filtering='0'
ecm.@general[0].disable_offloads='0'
ecm.@general[0].disable_flow_control='0'
ecm.@general[0].disable_interrupt_moderation='0'
ecm.@general[0].disable_gro='0'
```

None of the options require the use of unnamed sections
(like /etc/config/dhcp does when defining configs for multiple hosts)

With this change the config would produce:
```
ecm.global=ecm
ecm.global.acceleration_engine='nss'
ecm.general=ecm
ecm.general.enable_bridge_filtering='0'
ecm.general.disable_offloads='0'
ecm.general.disable_flow_control='0'
ecm.general.disable_interrupt_moderation='0'
ecm.general.disable_gro='0'
```

Which is a lot easier to read, and access programmatically.

We can also merge `global` and `general` into a single section as it
doesn't really make sense why we need global/general when it's
technically "ALL" globally applied.

For now, to ease users on the change, let's just stick to 2 sections.

**PLEASE NOTE: For users building their own images, and storing their**
**configs in 'files/etc/config/ecm' you will need to manually update the**
**config before compiling.**

For users using **sysupgrade** or installing without custom config at build
time 'files/etc/config/ecm' should be OK.

The following can be run manually on the config file 'ecm'

```sh
conf=/etc/config/ecm
uci -q show ecm.general || {
  echo "Converting 'ECM' config to new format."
  sed -i "s/config.*general.*/config ecm 'general'/g" "$conf"
}
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-28 13:10:58 -04:00
Sean Khan
3ffec2d091 nss-ecm: workaround insmod issue
switch to using modprobe vs. insmod as it allows more versatility in
  dependency loading.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-25 05:17:18 -04:00
Sean Khan
7173bd647c ssdk-shell: add qca-ssdk dependency
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-14 05:46:47 -04:00
Sean Khan
387da654c2 ssdk-shell: clean leftovers in Makefile
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-13 16:08:33 -04:00
Sean Khan
de0a338571 ssdk-shell: fix uninitialized tmpbool
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-13 15:59:09 -04:00
Sean Khan
2b4e3b2b37 ssdk-shell: bump 12.0.5 to match ssdk 12.4.r4
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-04-13 15:49:49 -04:00
Qosmio
2151cf9df5 Merge branch 'NSS-12.4-K6.x' of https://github.com/qosmio/nss-packages into NSS-12.4-K6.x 2024-04-09 00:27:29 -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
61ac52c7d0 nss-packages: update hashes for 'zst'
Signed-off-by: Qosmio <datapronix@protonmail.com>
2024-04-08 22:36:19 -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
ac967d3fc0 Merge branch 'NSS-12.4-K6.x' of https://github.com/qosmio/nss-packages into NSS-12.4-K6.x 2024-04-06 20:06:36 -04:00
anonymous-one
28a6d744d4
Better handling of nss_queue + etc affinity (#22)
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 20:03:43 -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
c39093e475 qca-nss-ecm: parse and load mod depends
Since many of ECM's module depends are dynamic and chosen at build time
`kmodloader` seems to have trouble properly loading its dependencies.

Attempt to parse ecm's module depends and load them prior to installing
the module.

This commit also replaces error prone `uci get` command with `config_get`,
in case certain options are missing from `/etc/config/ecm`
2024-04-01 06:35:42 -04:00
Qosmio
c7ed1c790c nss-packages: disable broken and abandoned modules
The following modules have been disabled for either being broken,
incompatible or abandoned by Qualcomm:
  * profile
  * capwapmgr
  * dtlsmgr
  * ipsecmgr
  * tlsmgr
  * mscs
  * nssinfo (netlink + libnl-nss)
2024-03-26 22:41:03 -04:00
Qosmio
e577cbd457 qca-nss-cfi: Fix incorrect package description 2024-03-26 22:37:45 -04:00
Qosmio
486a2c1f34 qca-nss-ecm: use config_get_bool to avoid missing option errors 2024-03-26 12:28:40 -04:00
Qosmio
a681594860 nss-packages: add backwards compatible TARGET option ipq807x 2024-03-26 12:26:14 -04:00
Qosmio
54013375f5 qca-nss-ecm: add ethtool dependency
Enforce dependency as it is used by 'disable_offloads' script
2024-03-26 12:20:18 -04:00
Qosmio
1d68a08b44 nss-clients: netlink compatibility with kernel 6.6 2024-03-25 18:43:20 -04:00
Qosmio
fd81770c4c Merge branch 'NSS-12.4-K6.1' into NSS-12.4-K6.6 2024-03-24 22:07:15 -04:00
Qosmio
15370e5d9d nss-clients: netlink compatibility with kernel 6.6 2024-03-24 22:06:21 -04:00
Qosmio
78aedd1916 qca-nss-ecm: move MLO check internally
`is_mlo_device` is a check for whether a device is multi-link operation
capable, it is also geared towards WiFi 7 which is only supported on
IPQ95xx/53xx platforms with SFE. Since these patches are only focused on NSS,
rather than unecessarily patching the kernel, don't check if device is MLO capable.
2024-03-24 21:59:48 -04:00
Qosmio
7e0e5abd8c qca-nss-ecm: refresh patches 2024-03-24 21:59:08 -04:00
Qosmio
7c69a23a5f nss-firmware: Fix Makefile to be compatible with new APK compatible version schema 2024-03-24 21:56:35 -04:00
Qosmio
8ffa394fb7 nss-udp-st: Remove incompatible UDP speedtest module/tool
It is only compatible with IPQ95XX/53XX. Remove it for now to avoid any
user confusion.
2024-03-24 21:53:59 -04:00
Qosmio
1625586a6c qca-nss-ecm: remove ovs dependency 2024-03-19 12:03:52 -04:00
Qosmio
b2eda32a24 Merge branch 'NSS-12.4-K6.1' into NSS-12.4-K6.6 2024-03-18 06:57:31 -04:00
Qosmio
295aa3cc0b Merge branch 'NSS-12.4-K6.1' of https://github.com/qosmio/nss-packages into NSS-12.4-K6.1 2024-03-18 06:57:01 -04:00
Qosmio
7e02d378bb qca-nss-ecm: bump version 12.4.5.r3 to 12.4.5.r5 2024-03-18 06:54:43 -04:00
Qosmio
952e573a71 nss-packages: convert modules to use wifili vs wifi 2024-03-17 02:18:20 -04:00