Commit Graph

23 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
088f830466 qca-nss-ecm: refactor disable offload scripts 2024-03-15 19:34:39 -04:00
zxlhhyccc
399136a5ee
qca-nss-ecm:Fixed the problem that the route does not respond after startup. 2024-03-13 22:50:51 +08:00
Qosmio
8d54d726c2 Move non-upstream NSS packages back into repo
To keep fork as closely synced with upstream, move NSS packages back
into repository. Not sure why they were moved out from my original fork.
* nss-firmware
* qca-nss-crypto
* qca-nss-cfi

Removed the following:
* mhz (already available in packages repo)
* qrtr (unecessary, and has been broken for years)

Also moved packages out of `qca` and back into root directory.
2024-02-19 01:35:04 -05:00