Commit Graph

64 Commits

Author SHA1 Message Date
Sean Khan
e5831d6123 nss-ecm: add wildcard opt to del denied ports
Added ability to delete denied ports using wildcard option.

```
echo del * > /proc/sys/net/ecm/udp_denied_ports
echo del * > /proc/sys/net/ecm/tcp_denied_ports
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-07-10 22:18:46 -04:00
Sean Khan
0ba24f4c33 nss-ecm: Ensure NSS_IPV4_RULE_CREATE_RAWIP_VALID is only checked for NSS 12.5+
It was unconditionally setting `rule_invalid = true` for FW less than 12.5.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-06-03 04:15:14 -04:00
Sean Khan
c0bbc6f168 treewide: Remove dependency on br_netfilter
Upstream OpenWrt 24.10 and later uses nftables by default.
Bridge filtering is not really needed anymore.

This should also prevent unnecessary chain dependencies getting built
like like `kmod-ipt-ipopt`.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-05-30 18:43:45 -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
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
709ddc324a nss-ecm: fix compilation undefined dev when tunipip6 is enabled
Resolves the following error

```
'dev' undeclared (first use in this function)
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2025-04-25 16:20:19 -04:00
Evgeniy Nikulov
6895d8bb10 nss-ecm: add ppp_generic dependencies (#44)
can`t compile qca-nss-ecm packages in case 'l2tp' I got issue that there is no ppp_generic package.

So, this change will fix building for l2tp case and will not broke pppoe case

EDIT: Fix whitespace
2025-04-25 16:18:53 -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
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
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
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
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
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
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
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
6f2520cf6f nss-ecm: Fix syntax error in firewall rule
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-10 15:27:35 -04:00
Sean Khan
4a9f247f40 nss-ecm: remove NSS_IPV4_RULE_CREATE_RAWIP_VALID
`NSS_IPV4_RULE_CREATE_RAWIP_VALID` is only available in NSS FW
version 12.5, which is not publically availiable.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-10 15:05:06 -04:00
Sean Khan
4b1cb1d940 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>
2024-07-10 14:34:13 -04:00
Sean Khan
baed4d5a9e nss-ecm: fix logic in rule addition
When using `nft insert rule` the rule is inserted on top of the
`forward_wan` chain, which bypasses any filtering in place. Instead,
append the rule to the end of the chain.

Other changes include renaming chain `RATE-LIMIT` to `ECM-RATE-LIMIT`
for better rule classification, and `shellformat` formatting.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-08 11:12:44 -04:00
Sean Khan
4c8e0ae9f2 nss-ecm: Skip bonding_masters interfaces
`lo` and `bonding_masters` interfaces are not managed by ethtool, so
should be skipped when disabling any interface features.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-07-08 11:09:04 -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
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
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
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
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
Qosmio
2075ebd759 nss-packages: update hashes for 'zst'
Signed-off-by: Qosmio <datapronix@protonmail.com>
2024-04-09 00:25:58 -04: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
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
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
1625586a6c qca-nss-ecm: remove ovs dependency 2024-03-19 12:03:52 -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