Commit Graph

382 Commits

Author SHA1 Message Date
Sean Khan
0eb92d185e nss-clients: treewide fixup compiler errors
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-17 22:42:16 -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
51300e4df4 nss-cfi: fix issue with kernel reporting duplicate driver
Kernel 6.1+ expects the driver to be registered with a unique name.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-17 00:46:12 -04:00
Sean Khan
c5fd1f6430 nss-clients: use patches vs. compiler overrides to fix warnings
Remove '-Wno-enum-conversion -Wno-unused-variable -Wno-int-conversion' from CFLAGS
and instead patch the code to fix the warnings.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-15 12:04:45 -04:00
Sean Khan
cd4db9aa4e nss-clients: [12.5] sync release from latest QSDK 12.5
This commit updates 12.5 version of the nss-drv from:

1bcef16 -> 51be82d (2024-07-08)

Bringing in the following changes:

```
2024-07-08 - 26ed7e6 - [qca-nss-clients] Added a flag to check if HW UDP checksum is supported
2024-06-16 - 5514683 - [nss-qdisc] Replace add_timer() to mod_timer()
2024-06-11 - 3a567e0 - [qca-nss-clients] udp_st: Add a new mode to handle unsynchronized time
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-15 12:04:45 -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
8660c6d6e5 nss-ecm: fix read/write UDP/TCP denied ports
In Linux kernel 6.6, the sysctl infrastructure changed
how it handles user/kernel memory boundaries.

The sysctl handlers now take a regular void *buffer instead
of void __user *buffer because the sysctl core now handles
the user-to-kernel copy/validation automatically.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-15 12:04:35 -04:00
Sean Khan
991bc745ac nss-ecm: remove compiler warning overrides
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-09 14:16:15 -04:00
Sean Khan
022a11234e nss-ecm: dynamically set frontend based on selection
Only build frontend based on selected acceleration engine.

ECM can build frontends for NSS/SFE/PPE, but for now only include option
for NSS.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-09 14:15:10 -04:00
Sean Khan
a8d4f99c91 nss-ecm: bump 12.5 release and refresh patches
Brings in the following commits from 12.5 branch:

2024-11-06 - 30fbfa4 - Fix for null dev entries in emesh-sawf.
2024-08-28 - 0718f48 - Add interface num to identify vlan device

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-09 13:56:37 -04:00
Sean Khan
1bed8dab31 nss-ecm: Improve ECM module configuration handling
This commit fixes two issues with how ECM module options are configured:

1. `/etc/modules.conf` was modified on every ECM start/restart,
   even when no changes were needed.

2. If any other ECM parameters were set in `/etc/modules.conf` it would
   overwrite them as the entire line was replaced.

The solution extracts configuration logic into a dedicated function that
only modifies what's necessary, properly handling all cases (updating existing
parameters, appending to existing options, or creating new options).

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-08 12:53:42 -04:00
Sean Khan
e4bfbb7986 qca-mcs: Flush the mdb tables in the event of NETDEV_DOWN
Bump to latest 12.5 branch to bring in the following:

* Flush the mdb tables in the event of NETDEV_DOWN

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-08 12:39:49 -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
Sean Khan
760e07e740 nss-ecm: only set reload trigger to disable packet steering
Previous change was reloading ECM on client DHCP requests causing
temporary packet loss. Change reload trigger to instead just disable
packet steering (the original intent of this feature).

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-03-02 15:10:31 -05:00
Sean Khan
967fb02dfb nss-ecm: cutdown on log spam
Don't log if interface feature is already disabled.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-03-02 03:50:45 -05:00
Sean Khan
e4489bb269 nss-ecm: ensure packet steering is always disabled
Converted ecm init to PROCD service and added a function ensure packet steering
is always disabled when loading.

Added additional firewall/network/packet_steering triggers in case user
changes to packet steering are made in the web interface.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-02-28 18:32:22 -05:00
Sean Khan
bbaa20f43c Merge branch 'NSS-12.5-K6.x' of https://github.com/qosmio/nss-packages into NSS-12.5-K6.x 2025-01-15 02:18:05 -05: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
86b8cc3675 Merge branch 'NSS-12.5-K6.x' of https://github.com/qosmio/nss-packages into NSS-12.5-K6.x 2024-11-12 11:15:00 -05:00
leideno
cfb2f96387
Some fixes to quectel.sh (#39)
Revert the changes I made in a previous commit as it broke Virtual Interface creation for modems using RMNET/QMAP aggregation that have the parent wwan0 device split into wwan0_1, wwan0_2, etc the script should now correctly set up the Virtual Interface for both aggregated and non aggregated.

QMAP aggregation can be set up by:

rmmod qmi_wwan_q
insmod qmi_wwan_q qmap_mode=N

N being the number of sub devices created from the parent wwan0 device. I tried it out with my Quectel EG12-EA modem and had constant resets/crashes with the router often locking up.
2024-11-11 11:02:33 -05:00
Sean Khan
d9261775cf nss-ecm: only run hotplug for physical interfaces
Also moved script to disable tx checksum for ath11k
mesh interfaces into `mac80211`.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-20 05:03:41 -04:00
Sean Khan
589b316c88 nss-ecm: Bump version 12.5 to 09-12-2024
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-16 18:06:14 -04:00
Sean Khan
80a6c3f593 nss-ecm: remove redundant check ACTION check
The script already exits if $ACTION != "add", no need to double check.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-14 16:44:02 -04:00
Sean Khan
ffa658dc50 wwan: bump quectel-cm release 2 to 3 2024-10-08 19:30:43 -04:00
leideno
0c05fe64ff
Update quectel.sh (#36)
The virtual device is created targeting a non existent parent device. Changed virtual device creation "json_add_string device $ifname6" and "$ifname4" to "json_add_string ifname @$interface" to create the virtual dhcp/dhcpv6 interface as an alias of the parent quectel interface.
2024-10-08 13:23:40 -04:00
Sean Khan
f70c9d6b28 nss-ecm: disable tx-checksumming on mesh interfaces
`tx-checksumming` breaks multicast traffic over mesh interfaces.

Add a check in hotplug script to see if interface is mesh interface
and automatically disable `tx-checksumming`.
2024-10-05 20:27:30 -04: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
c746083504 nss-ecm: Disable rx-gro-list by default
New option added to ecm config: `disable_gro_list`

This config option defaults to '1' (AKA disable rx-gro-list)
`rx-gro-list` is enabled by default in mainline OpenWrt, however it
is very bug prone, and causes various issues related to
UDP traffic (i.e DHCP, WireGuard, DNS, etc.)

This option is not explicitly required. If a user sets this to '0', a
warning will be shown in the logs everytime ECM is started.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-05 00:08:10 -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
XT-Martinez
27c9b64b6a Add config for 4G cell ID locking 2024-09-26 10:54:28 -04:00
XT-Martinez
9d1be874b7 Fix indentions 2024-09-26 10:54:28 -04:00
XT-Martinez
6ac90d59c9 Make IP Multiplexing optional 2024-09-26 10:54:28 -04:00
XT-Martinez
28cc54ff77 Add config for PDN index, cleanup modem boot delay 2024-09-26 10:54:22 -04:00
XT-Martinez
01fe8de919 Add enough delay to wait for modem to boot 2024-09-26 10:49:38 -04:00
XT-Martinez
fc5b59c83a Added separate APN config for IPv6
- Added separate APN config for IPv6
- Added validation to ensure a different APN is used
2024-09-26 10:49:38 -04:00
XT-Martinez
1a6ba49959 Update quectel proto script to support dual-stack IP via QMAP multiplexing
Update quectel proto script to support dual-stack IP via QMAP multiplexing
2024-09-26 10:49:38 -04:00
Hikari
681d706908 Initial RMNET fixes (#31)
* wwan: Initial attempt at NSS offload

Initial attempt at getting NSS offload working with 4g/5g based
IPQ807x/50xx platforms.

I don't have a unit to test this on but everything seems to compile
after applying a few patches.

Ensure you are using the "NSS-12.5-K6.x-wwan" branch in your `feeds.conf`

```
src-git nss_packages https://github.com/qosmio/nss-packages.git;NSS-12.5-K6.x-wwan
```

Then install all packages
```
./scripts/feeds install -p nss_packages -a
```

Ensure you select the modules:
```
kmod-pcie_mhi
kmod-qmi_wwan_q
```

Work was derived from `https://github.com/coolsnowwolf/lede` and
`https://git.codelinaro.org/clo/qsdk/platform/vendor/qcom/opensource/qsdk/datarmnet`

Signed-off-by: Sean Khan <datapronix@protonmail.com>

* cleanup, initial commit

* Fix typos, mhi quectel connection mananger

* Fix invalid patch

* fix qmi_wwan_q patch

* fix qmi_wwan_q patch

* remove duplicate patch

---------

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Co-authored-by: Sean Khan <datapronix@protonmail.com>
Co-authored-by: Robin Reyes <hikari@pop-os.corephwebsolutions.com>
2024-09-26 10:36:08 -04:00
leideno
47cc754877
Update quectel.sh (#33) 2024-09-24 00:47:17 -04:00
Sean Khan
1af6cec02b nss-ecm: Refresh patches for 12.5.5
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-09-21 19:51:08 -04:00
Sean Khan
a7c763b2ce nss-crypto: add dependancy on nss-eip-firmware
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-09-21 16:47:33 -04:00
Sean Khan
24ae066757 nss-cfi: Fix crash on IPQ807x when utilizing NSS cores for crypto tasks
This commit addresses a crash that occurs when running crypto tasks on
IPQ807x devices explicitly utilizing the NSS cores. The crash was
reproducible in scenarios involving cryptographic operations offloaded
to the NSS cores (e.g., using cryptodev with OpenSSL or running the
crypto test module).

IMPORTANT: This fix should not be misunderstood as a general-purpose
performance boost for all cryptographic workloads. If your goal is to
accelerate AES encryption across the board (e.g., using OpenSSL for
routine file encryption), this approach is **not** practical.

The primary benefit of leveraging the NSS cores for cryptographic operations
is within VPN-oriented use cases, such as OpenVPN or IPsec, where the
offloading to NSS cores can reduce CPU load and improve throughput.

It’s critical to note that this fix will **not** accelerate encryption
for protocols like Wireguard. Wireguard’s design uses ChaCha20-Poly1305
rather than AES, and it cannot easily be offloaded to hardware.

Additionally, Wireguard uses short-lived cryptographic keys that rotate
frequently. This frequent key rotation makes it difficult to interface
with hardware offloading mechanisms, which are typically optimized for
long-lived sessions like those found in IPsec.

Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-09-21 16:45:58 -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
b8e019c373 nss-ecm: Bump version 12.5 to 12.5.5
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-09-21 16:14:01 -04:00
Sean Khan
aa57d9c482 nss-ecm: compat with NSS FW < 12.5
NSS_IPV4_RULE_CREATE_RAWIP_VALID is only found in NSS FW 12.5 and
higher. Check if enabled before and macros for it.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-09-18 21:38:13 -04:00