Commit Graph

62308 Commits

Author SHA1 Message Date
Sean Khan
e18383e9de Revert "ath11k_nss: Add mac80211 based AQL support"
This reverts commit b1b446335beee744c7a74770d7383618d9cc3202.
2024-10-11 19:19:11 -04:00
Sean Khan
65b6b1ca65 hostapd: handle updated MU-EDCA params from driver
This patch handles the updating of MU-EDCA parameters indicated by
driver. Driver requests to update the parameters and Parameter Set
Update Count in beacon frames. This patch addresses only AP mode.

Three actions are taken to successfully update MU-EDCA parameters
in beacon:
	(1) Update MU-EDCA parameters stored in hostapd
	    The following Access Categories (AC) are updated:
	      VO: Voice
	      VI: Video
	      BE: Best Effort
	      BK: Background

	(2) Increment Parameter Set Update Count
	(3) Update beacon with new parameters

There aren't any options to configure, hostapd simply updates MU-EDCA
published by ath11k driver.

To verify params are getting updated, set log_level to '1' and check
logger

i.e. `uci set wireless.radio0.log_level=1`

```
Sat Jul  6 15:36:10 2024 daemon.debug hostapd: phy0-ap0: IEEE 802.11 MU-EDCA: Updated MU-EDCA parameters for AC 0: BE: 3, BK: 7, VI: 2, VO: 2
Sat Jul  6 15:36:10 2024 daemon.debug hostapd: phy0-ap0: IEEE 802.11 MU-EDCA: Updated MU-EDCA parameters for AC 1: BE: 164, BK: 164, VI: 67, VO: 50
Sat Jul  6 15:36:10 2024 daemon.debug hostapd: phy0-ap0: IEEE 802.11 MU-EDCA: Updated MU-EDCA parameters for AC 2: BE: 255, BK: 2, VI: 255, VO: 255
```

Requires the following patches applied to 'ath11k/subsys'

commit ce7f1ad354869d85abdf8e8ed8d36599e057ba5d
Author:     Sean Khan <datapronix@protonmail.com>
AuthorDate: Tue Feb 27 00:45:32 2024 -0500
Commit:     Sean Khan <datapronix@protonmail.com>
CommitDate: Sat Jul 6 15:19:26 2024 -0400

    ath11k_nss: FW Initiated Dynamic MU-EDCA

    package/kernel/mac80211/patches/nss/ath11k/203-mac80211-ath11k-fw-dynamic-muedca.patch
    package/kernel/mac80211/patches/nss/subsys/203-mac80211-ath11k-fw-dynamic-muedca.patch

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:11 -04:00
Sean Khan
2aaf7db5d9 ath11k_nss: fix monitor mode
commit 072327212c033baf96365a5045673c5981eb0bdf (HEAD -> next, origin/next)
Author:     John Crispin <john@phrozen.org>
AuthorDate: Fri Jul 5 15:42:24 2024 +0200
Commit:     John Crispin <john@phrozen.org>
CommitDate: Fri Jul 5 15:42:40 2024 +0200

    ath11k: fix monitor mode

    Enabling CPTCFG_ATH11K_MEM_PROFILE_512M will change the layout of
    struct hal_rx_desc_ipq8074. This broke monitor mode. Fix it by not modifying
    the struct even if the 512MB profile is enabled.

    Fixes: WIFI-12102
    Signed-off-by: John Crispin <john@phrozen.org>

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:10 -04:00
Sean Khan
ef28c51b9c wifi_nss: Revert using napi threaded helper function
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:10 -04:00
Sean Khan
531755b24d Revert "qualcommax: NSS: introduce helper functions for NAPI threading"
This reverts commit 5cf32cfe3edca047b7347236496c275bc23ae7fb.
2024-10-11 19:19:10 -04:00
Sean Khan
1725d090d9 ath11k_nss: add tracing for update_muedca_params_event
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:10 -04:00
Sean Khan
d083973b9c ath10k-ct: Use NAPI threaded helper functions
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:10 -04:00
Sean Khan
4580fb6743 ath10k-ct: Bump patch for 6.4 to 6.7
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:10 -04:00
Sean Khan
7f25553e0d qualcommax: NSS: Add default packages drv, ecm, bridge-mgr
These packages are required for basic NSS offloading. So ensure they're
selected for all qualcommax targets.

  * kmod-qca-nss-ecm (Enhanced Connection Manager)
  * kmod-qca-nss-drv (NSS Driver)
  * kmod-qca-nss-drv-bridge-mgr (NSS Manager for Bridges)

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
b9b8072d71 ath11k_nss: fix incorrectly applied ath11k_pci threaded napi patch
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
50768a29ad wifi_nss: Use NAPI threaded helper functions
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
55ede04914 qualcommax: NSS: introduce helper functions for NAPI threading
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
0996df5b06 qualcommax: clean up kernel config, align with QSDK
Cleaned up erronous settings for disabled features. The syntax should be
"# CONFIG_SOME_OPTION is not set", rather than simply commenting it out.

Removed left over config options from 5.15, and enabled features
recommended by QSDK:

```
CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_MULTI_IRQ_HANDLER=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HZ_FIXED=0
CONFIG_NO_HZ=y
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
777260b609 qualcommax: Fix threaded NAPI scheduling
Revert to using the default kernel timer (CONFIG_HZ_100).

Setting the timer to 1000hz is unecessary and just adds CPU overhead. It
also causes atomic scheduling issues in various threaded tasks,
especially when using threaded NAPI.

When the kernel timer frequency is set to 1000 Hz, it generates interrupts
1000 times per second. This increased frequency can lead to more
frequent context switches and interrupt handling, which can
interfere with other kernel activities.

Since network packet processing is offloaded to the NSS cores, the main CPU
does not need high-resolution timer interrupts to manage network
traffic efficiently. The NSS cores handle this independently.

This is the setting used and recommended by Qualcomm for all their IPQ
platforms.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
976b191d1f ath11k_nss: Add mac80211 based AQL support
Add wake_tx_queue mac op to support AQL and support
txq dequeueing from mac80211. Also implement a
simple scheduler for pulling all skbs from txqs
of all AC's at the end of tx completion NAPI.

Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1

Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:09 -04:00
Sean Khan
0855540311 wifi_nss: Add threaded NAPI for ath10k and ath11k
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:08 -04:00
Sean Khan
8beb7d5d26 ath11k_nss: Drop unnecessary iphone fix patch
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:08 -04:00
Sean Khan
db9ba5cdb1 ath11k_nss: Organize patch order and formatting
NSS patches should always get applied last as to avoid fuzzing issues
with upstream patches.

Also cleanup patches that introduced spaces as indents vs. tabs

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

ath11k_nss: drop upstreamed patch

A variation of this patch 'wifi: mac80211: Use flexible array in struct ieee80211_tim_ie'
was upstreamed in commit 'e6e4d90b69027d74ba7e9a0a586b95a5714e10c0'.
Remove it to avoid compilation issues.

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

ath11k_nss: Fix patch conflict

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:08 -04:00
Sean Khan
4a52aeb0b7 ath11k_nss: modularize nss-pbuf options
The following options can now be specified in `pbuf` uci config.

1.) auto_scale (bool) - enable or disable NSS CPU auto-scaling.
                        default: 'off'.

                        NOTE: Recommended to leave off, as it locks
                        NSS core to it's full 1.7Ghz speed. In the past
                        auto_scaling has been unstable, often causing
                        kernel panics or connection drops. Qualcomm
                        themselves disables scaling in QSDK for
                        ath11k/ath12k/qca-wifi.

                        It is provided to allow users wanting more
                        control over power usage. Setting to 'on' also
                        fixes NSS CPU stats updating properly.

2.) n2h_queue_limit_core0 (int) - set queue limits for CORE 0 and 1.
                                  default: '2048'

                                  For users on low memory systems (<=512M),
                                  that are experiencing issues can try lowering
                                  to the driver default of '256'.
2024-10-11 19:19:08 -04:00
Sean Khan
e018af5fbb qualcommax: add ramoops memory region
This patch adds support for allocating 1MB of reserved memory
for ramoops on IPQ807x and IPQ6018 platforms.

This is required to get PSTORE option working.

Tested with the following options:

```
CONFIG_PACKAGE_kmod-pstore=y
CONFIG_PACKAGE_kmod-ramoops=y
CONFIG_PACKAGE_kmod-reed-solomon=y
```

dmesg output
```
➤ dmesg | grep -Ei "psto|ramo"

[Sun Jun  9 23:22:01 2024] OF: reserved mem: 0x0000000051200000..0x00000000512fffff (1024 KiB) map non-reusable ramoops@51200000
[Sun Jun  9 23:22:05 2024] pstore: Using crash dump compression: deflate
[Sun Jun  9 23:22:05 2024] pstore: Registered ramoops as persistent store backend
[Sun Jun  9 23:22:05 2024] ramoops: using 0x100000@0x51200000, ecc: 0
```

Triggering kernel panic

```
sh -c 'echo 10 > /proc/sys/kernel/panic; echo c > /proc/sysrq-trigger'
```

After rebooting

```
mkdir -p /tmp/ramoops
mount -t pstore pstore /tmp/ramoops
```

```
➤ l /tmp/ramoops
drwxr-x---    2 root     root           0 Jun  9 23:02 .
drwxr-xr-x    8 root     root        4.0K Jun  9 23:23 ..
-r--r--r--    1 root     root        6.6K Jun  9 23:21 dmesg-ramoops-0
```

Truncated output
```
Panic#1 Part1
<6>[   21.656119] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
<14>[   21.657910] kmodloader: done loading kernel modules from /etc/modules.d/*
<6>[   21.710545] ath11k c000000.wifi: chip_id 0x0 chip_family 0x0 board_id 0xff soc_id 0xffffffff
<6>[   21.710594] ath11k c000000.wifi: fw_version 0x270204a5 fw_build_timestamp 2022-08-04 13:05 fw_build_id WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
<6>[   91.416867] br-lan: topology change detected, sending tcn bpdu
<6>[ 1256.023874] sysrq: Trigger a crash
<0>[ 1256.023911] Kernel panic - not syncing: sysrq triggered crash
<4>[ 1256.026176] CPU: 2 PID: 2842 Comm: sh Tainted: G           O       6.6.32 #0
<4>[ 1256.031993] Hardware name: Linksys MX5300 (DT)
<4>[ 1256.039106] Call trace:
<4>[ 1256.043354]  dump_backtrace+0xb0/0x10c
<4>[ 1256.045701]  show_stack+0x18/0x24
<4>[ 1256.049519]  dump_stack_lvl+0x48/0x60
<4>[ 1256.052906]  dump_stack+0x18/0x24
<4>[ 1256.056550]  panic+0x2d0/0x31c
<4>[ 1256.059848]  sysrq_handle_moom+0x0/0x30
<4>[ 1256.062800]  __handle_sysrq+0xe4/0x1e0
<4>[ 1256.066534]  write_sysrq_trigger+0xbc/0xfc
<4>[ 1256.070354]  proc_reg_write+0xb0/0xf8
<4>[ 1256.074434]  vfs_write+0xa4/0x298
<4>[ 1256.078165]  ksys_write+0x5c/0xe0
<4>[ 1256.081464]  __arm64_sys_write+0x1c/0x28
<4>[ 1256.084763]  invoke_syscall.constprop.0+0x5c/0x100
<4>[ 1256.088758]  do_el0_svc+0x40/0xc8
<4>[ 1256.093355]  el0_svc+0x30/0xb8
<4>[ 1256.096740]  el0t_64_sync_handler+0x120/0x12c
<4>[ 1256.099694]  el0t_64_sync+0x178/0x17c
<2>[ 1256.104122] SMP: stopping secondary CPUs
<0>[ 1256.107773] Kernel Offset: disabled
<0>[ 1256.111759] CPU features: 0x0,00000000,00000000,0000400b
<0>[ 1256.114975] Memory Limit: none
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:08 -04:00
Sean Khan
768866a99f ath11k_nss: Fix IPQ6018 wifi offloading
This patch was mostly cosmetic for ipq8074 to supress warnings about
invalid memory region. In this case the M3 dump region. This isn't
necessary for operation or offloading, and is used for firmware
debugging.

However due to the memory layout of ipq6018 it was causing issues of NSS
offloading properly loading. 'idx' shouldn't be incremented, and instead
should just break.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:08 -04:00
Sean Khan
2b4dc04a0c qualcommax: NSS: ECM: Fixes for Bridge VLAN Filtering
1. Fix function to check for bridge master status while checking
for Bridge VLAN filter feature is enabled on bridge slave ports.
2. Disable default PVID for bridges during device registration in
the system.

Change-Id: Ibea6559c1b0700a2300b60e20d57b7818e23a8a8
Signed-off-by: Vishnu Vardhan Bantanahal <quic_vishvard@quicinc.com>

bridge: Fix Bridge VLAN stats update
This patch fixes Bridge VLAN stats update for both bridge master
and bridge slave.
Change-Id: Ia26f4c71e83e27dd83336815cda5c05c8c3f24ff
Signed-off-by: Vishnu Vardhan Bantanahal <quic_vishvard@quicinc.com>

bridge: Add bridge VLAN filter APIs for offload for 6.1 Kernel

Change-Id: I54e44c26664f86ae024f54605a032713a9a3eee5
Signed-off-by: Vishnu Vardhan Bantanahal <quic_vishvard@quicinc.com>

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:07 -04:00
Sean Khan
06e6cfb672 qualcommax: NSS: Add DTS entries for nss-macsec
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:07 -04:00
Sean Khan
259209ad06 qualcommax: NSS: Add support for sxk80, mx8500
Adding NSS support for:

Linksys MX8500
Netgear SXR80/SXS80 (SXK80 - router and satellite)

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:07 -04:00
Sean Khan
8f2b23c53d ath11k_nss: mac80211 Use C99 flexible arrays instead of zero-length arrays
Fixes compile issues on GCC 13.3+

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:07 -04:00
Sean Khan
b329b9c7e1 ath11k_nss: Add lock when accessing idr_pool of tx_ring
Lock is missed while accessing idr_pool of tx_ring which
causes Use after free crash in dp_free path when unloading
the module.

Fix this by adding tx_idr_lock when accessing idr_pool
of tx_ring.

Signed-off-by: Aishwarya R <quic_aisr@quicinc.com>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:07 -04:00
Sean Khan
031180dd50 ath11k_nss: correctly free skb using ieee80211_free_txskb()
While freeing skb in tx completion path for status reinject, inspect
or vdevid mismatch, dev_kfree_skb_any() is used but when a function
is using functions from mac80211 to free an skb then it should do
it consistently and not switch to the generic dev_kfree_skb_any.
Otherwise, mac80211 will not be aware of the freed skb and thus
not clean up related information in its internal data structures.

Hence fix the issue by properly using ieee80211_free_txskb().

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:07 -04:00
Sean Khan
d3845d033a ath11k_nss: fix incorrect tx/rx stats WDS
Should be 'rx'

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:06 -04:00
Sean Khan
289ed42154 ath11k_nss: change warning levels
This is mostly a cosmetic change for users running NSS firmware 11.4
with mesh setups. Rather than fill up kernel logs with warnings, move log
warnings to debug.

The stats are still captured in '/sys/kernel/debug/qca-nss-drv/stats/*'

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:06 -04:00
Sean Khan
d07d599d18 ath11k_nss: mac80211: remove STA txq pending airtime underflow warning
This warning can trigger if there is a mismatch between frames that were
sent with the sta pointer set vs tx status frames reported for the sta address.

This can happen due to race conditions on re-creating stations, or even
in the case of .sta_add/remove being used instead of .sta_state, which can cause
frames to be sent to a station that has not been uploaded yet.

If there is an actual underflow issue, it should show up in the device airtime
warning below, so it is better to remove this one.

Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:06 -04:00
Sean Khan
ebdd70c9cb ath11k_nss: mac80211 fix pending airtime
On platforms using ath10k with mac80211 'nss_redirect' enabled,
a warning `ieee80211_sta_update_pending_airtime` is observered
whenever traffic load is high (iperf3).

Don't offload if pending queue > 1000

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:06 -04:00
Sean Khan
08362e886f iproute2: Fixup NSS patches for GCC 14.x
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:06 -04:00
Sean Khan
9609bb1e10 qualcommax: NSS: Set required NSS packages and options 2024-10-11 19:19:06 -04:00
Sean Khan
ffdaa5f60f ath11k_nss: revert AMPDU in radiotap header
Causes issues with rate stats on IPQ9074

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:05 -04:00
Sean Khan
0d792ba783 qualcommax: NSS: Add support for all ipq807x targets
NSS offload feature should be available for all IPQ807x/IPQ817x targets.

* Arcadyan AW1000
* CMCC RM2-6
* Linksys MX4200 V1/V2
* Linksys MX5300
* Sagemcom Fast 5285 Spectrum SAXV1V1S
* Yuncore AX880
* ZBT Z800AX
* ZTE MF269

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:05 -04:00
Sean Khan
59bd0865ce ath11k_nss: fix invalid access to memory
In ath11k_dp_rx_msdu_coalesce(), rxcb is fetched from skb and bool
is_continuation is part of rxcb.

Currently, after freeing the skb, the rxcb->is_continuation accessed
again which is wrong since the memory is already freed.

Hence fix the issue by locally defining bool is_continuation from rxcb,
so that after freeing skb also we can use is_continuation.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:05 -04:00
Sean Khan
a300e2e7c8 feeds: nss-packages: switch to branch 12.5-6.x 2024-10-11 19:19:05 -04:00
Sean Khan
ef9b0ed4b5 qualcommax: qca-mcs support for kernel >= 6.6.29
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:05 -04:00
Sean Khan
4b6303ae4b qualcommax: disable swiotlb for 64mb in saving.
Disable software input output translation lookaside buffer (swiotlb) as
it wastes memory on low memory platforms (512m or less)

qualcommax: only disable swiotlb for platforms <= 512M

Disabling swiotlb is only required for platforms with 512M or less to save
64mb.
2024-10-11 19:19:05 -04:00
Qosmio
9714f14008 feeds: NSS: point to 6.x branch
This will now be the default NSS branch, and will cover
both kernel 6.1 and 6.6 related changes going forward.

qualcommax: NSS: fix up 'nss_region'
2024-10-11 19:19:04 -04:00
Qosmio
45ac1ef367 cryptodev-linux: Add hooks for QCA NSS 2024-10-11 19:19:04 -04:00
Qosmio
2bb27f8262 qualcommax: NSS: kernel 6.6 support 2024-10-11 19:19:04 -04:00
Qosmio
69aa26077f qualcommax: Move QCE to user selectable module
The performance of Qualcomm Crypto Engine is 10x slower than kernel
based encryption via ARMv8 crypto extensions. Rather than building it
into the kernel allow users to select it as module which can be tested with
other HW based crypto APIs via cryptodev-linux.
2024-10-11 19:19:04 -04:00
Qosmio
ae87e428e0 qualcommax: remove uneeded btcoex dts
not needed for NSS offload and helps save some memory
2024-10-11 19:19:04 -04:00
Sean Khan
4ba2dbda8d qualcommax: NSS: kernel 6.6 support (squash)
Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:04 -04:00
Qosmio
d0af869c9e ath11k_nss: refresh and fixup patches 2024-10-11 19:19:04 -04:00
Qosmio
0abe35e9ac ath11k_nss: set pbuf to 'auto'
Since SKB recycler was merged into main nss-wifi branch, it is not
necessary to manually tinker with pbuf script. Memory is now properly
managed between NSS driver allocating/deallocating SKBs. For optimal
wifi performance, especially upload, it is advised to leave the script
to 'auto'.

Users who use sysupgrade should manually set the uci config
'/etc/config/pbuf' as it will not overwrite existing configuration.
2024-10-11 19:19:03 -04:00
Sean Khan
f99f8c2609 qualcommax: Introduce skbuff_recycle for performance
QSDK NSS builds utilize skbuff recycling for better handling of memory.

On a Dynalink DL-WRX36 (pbuf script should be set to 'auto') a significant drop in
memory usage was observed as well consistent sustained RX/TX speeds.

BEFORE:
echo 3 >! /proc/sys/vm/drop_caches

free -m
					total        used        free      shared  buff/cache   available
Mem:             867         338         547          90         101         528
Swap:              0           0           0

AFTER:
					total        used        free      shared  buff/cache   available
Mem:             867         242         594           1          81         624
Swap:              0           0           0

NOTE:

For 512MB platforms, users need to test with the following scenarios,
as the patch `999-233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch` is
really only testable on platforms with 512M or less RAM.

1.) Explicitly setting 'ATH11K_MEM_PROFILE_512M' on and see if system
crashes on boot.

2.) Explicitly setting 'ATH11K_MEM_PROFILE_1G'

3.) Remove patches
999-233-ath11k-Disable-rx_header-tlv-for-2K-SKB.patch
999-311-ath11k-configure-nss-thread-priority-during-pdev_ini.patch

And re-test with #1 and #2

It was incorrectly assumed that setting a 512M for 1G platforms would save
memory, instead it needs to be explicitly set to know proper memory
regions, otherwise it would cause fw crash.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
2024-10-11 19:19:03 -04:00
Qosmio
858bb6da15 ath11k_nss: squash and refactor patches
ath11k_nss: fix build for 256/1G mem, and ath10k

ath11k_nss: bump release version '8'

mac80211: refactor NSS patches

Since NSS requires patches to subsys, and ath*k directories. Move
patches into a subset of nss for better tracking against QSDK,
and modularization.

ath11k_nss: rename patches

ath11k_nss: clean up optional patches

To reduce bug tracking headaches, I've remove the following patches, as
they are not required for NSS offload and have been around the last 2-3
years without ever being upstreamed.

nss/ath11k/235-001-ath11k-Add-support-for-beacon-tx-mode.patch
nss/ath11k/237-002-ath11k-Add-provision-to-configure-rx-hashmap.patch
nss/ath11k/902-020-ath11k-add-btcoex-config.patch
nss/ath11k/902-022-ath11k-add-ap-ps-support.patch
nss/ath11k/907-068-ath11k-add-rx-histogram-stats.patch
nss/ath11k/907-108-ath11k-enable-ul-ofdma-ru-allocation-in-peer-stats.patch
nss/ath11k/911-373-ath11k-Add-retry-mechanism-for-update_rx_qu.patch
nss/ath11k/913-353-ath11k-ignore-frags-from-uninitialized-peer-in-dp.patch
nss/ath11k/913-356-ath11k-invalid-desc-sanity-check.patch
nss/ath11k/913-374-ath11k-Check-skb_headroom-before-using-skb_push.patch
nss/ath11k/913-830-ath11k-Avoiding-memset-of-ppdu-info-for-next-skb.patch
nss/subsys/235-002-mac80211-Add-support-for-beacon-tx-mode.patch
nss/subsys/913-726-mac80211-fix-crash-when-accessing-null-pointer.patch

ath11k_nss: Remove superfluous patches

Remove patches unrelated to NSS offloading to minimize bloat and better
track NSS related issues.

ath11k_nss: Refactor patches to use upstream names

Reworked patches to use upstream QSDK names. Allows for better tracking

ath11k_nss: align wifi offload with qca-nss-drv

The option in qca-nss-drv is actually 'NSS_DRV_WIFIOFFLOAD_ENABLE' use
the same syntax.

ath10k-ct: fix compile with NSS wifi

ath11k_nss: Merge every NSS related feature + more

* Added macro to disable NSS mesh offload
* Added menuconfig option "ATH11K_NSS_MESH_SUPPORT" to selectivley build mesh support,
	as well it's depenacndy on nss-drv-wifimeshmgr.
* Added option to disable HTT Stats, and STA stats (stations).
* Reducing footprint by ~210KB. Debugfs minimal is still enabled.
* Reworked a TON of patches, some my own, hopefully there should be a far less amount of WOA2/WPA3 connection issues.
* Updated the /etc/init.d/pbuf script to be more robust. (handles tweaking ath11k and NSS settings better)

NOTES: Although mesh package builds (nss-drv-wifimeshmgr), ath11k doesn't seem to support it yet.
Not sure if NSS requires 3 radios to work, I'm at a dead end currently with that route.

ATTENTION:
the ptch `37-006-ath11k-Allow-fast-rx-by-bypassing-stats-update.patch`
works well on nss with frame_mode=2.
And on `ath11k frame_mode=1 nss_offload=0`

And on `ath11k frame_mode=2 nss_offload=1`

if you set nss_offload=off and frame_mode=2, it will CRASH
if you set nss_offload=on and frame_mode=2, it will  RUN
if you set nss_offload=off and frame_mode=1, it will RUN

ath11k_nss: fix n2h high_water_core0/wifi_pool_buf

These were commented out, but looks like they are needed to prevent lock
ups with heavy usage apps (users report in torrenting)

ath11k_nss: Renumber ath11k patches in the range

commit 3c7cc4b725ea406f19b736427034e3bdb436aedc
Author:     Yuvasree Sivasankaran <quic_ysivasan@quicinc.com>
AuthorDate: Thu Jan 4 11:25:56 2024 +0530
Commit:     Yuvasree Sivasankaran <quic_ysivasan@quicinc.com>
CommitDate: Wed Jan 3 22:53:51 2024 -0800

    wifi: ath11k: Renumber ath11k patches in the range

    In ath11k, patches are not maintained in the range and not sequential.
    Renumber the patches sequential and in the range.

    Change-Id: I77c51c0f5bf9f94863db4ef364b156e14465a60c
    Signed-off-by: Yuvasree Sivasankaran <quic_ysivasan@quicinc.com>

ath11k_nss: Add mac hw flag to avoid tx queue in mac80211

commit 4e9b5f7f0d1ed40dbf3208f7ed4448e49b4a4ac1
Author:     Yuvasree Sivasankaran <quic_ysivasan@quicinc.com>
AuthorDate: Wed Dec 6 12:20:59 2023 +0530
Commit:     Yuvasree Sivasankaran <quic_ysivasan@quicinc.com>
CommitDate: Mon Dec 18 12:52:33 2023 +0530

    wifi: mac80211: Add mac hw flag to avoid tx queue in mac80211

    Queue SKB in mac80211 become mandatory from latest 6.1 kernel. Because of
    this queuing, there will be performance degradation. Add hw flag option
    to enable tx queue in Driver/Hardware.

    Driver/hardware can register for HAS_TX_QUEUE HW flag and avoid tx queuing
    in mac80211.

    Add same HW flag checks to avoid accessing skb queues which will be
    NULL or invalid and also NULL checks for sta txqs for NULL or invalid
    access.

ath11k_nss: add the HTC+ / iPhone fix

commit ccdca73cd65723c3cb63c17edc95c4c43318cb38
Author:     John Crispin <john@phrozen.org>
AuthorDate: Sun Jul 9 17:12:34 2023 +0200
Commit:     John Crispin <john@phrozen.org>
CommitDate: Thu Aug 31 16:08:34 2023 +0200

    mac80211: add the HTC+ / iPhone fix

    Signed-off-by: John Crispin <john@phrozen.org>

ath11k_nss: ath-next fix connection failure due to unexpected peer delete

Currently ath11k_mac_op_unassign_vif_chanctx() deletes peer but
ath11k_mac_op_assign_vif_chanctx() doesn't create it. This results in
connection failure if MAC80211 calls drv_unassign_vif_chanctx() and
drv_assign_vif_chanctx() during AUTH and ASSOC, see below log:

[  102.372431] wlan0: authenticated
[  102.372585] ath11k_pci 0000:01:00.0: wlan0: disabling HT/VHT/HE as WMM/QoS is not supported by the AP
[  102.372593] ath11k_pci 0000:01:00.0: mac chanctx unassign ptr ffff895084638598 vdev_id 0
[  102.372808] ath11k_pci 0000:01:00.0: WMI vdev stop id 0x0
[  102.383114] ath11k_pci 0000:01:00.0: vdev stopped for vdev id 0
[  102.384689] ath11k_pci 0000:01:00.0: WMI peer delete vdev_id 0 peer_addr 20:e5:2a:21:c4:51
[  102.396676] ath11k_pci 0000:01:00.0: htt peer unmap vdev 0 peer 20:e5:2a:21:c4:51 id 3
[  102.396711] ath11k_pci 0000:01:00.0: peer delete resp for vdev id 0 addr 20:e5:2a:21:c4:51
[  102.396722] ath11k_pci 0000:01:00.0: mac removed peer 20:e5:2a:21:c4:51  vdev 0 after vdev stop
[  102.396780] ath11k_pci 0000:01:00.0: mac chanctx assign ptr ffff895084639c18 vdev_id 0
[  102.400628] wlan0: associate with 20:e5:2a:21:c4:51 (try 1/3)
[  102.508864] wlan0: associate with 20:e5:2a:21:c4:51 (try 2/3)
[  102.612815] wlan0: associate with 20:e5:2a:21:c4:51 (try 3/3)
[  102.720846] wlan0: association with 20:e5:2a:21:c4:51 timed out

The peer delete logic in ath11k_mac_op_unassign_vif_chanctx() is
introduced by commit b4a0f54156ac ("ath11k: move peer delete after
vdev stop of station for QCA6390 and WCN6855") to fix firmware
crash issue caused by unexpected vdev stop/peer delete sequence.

Actually for a STA interface peer should be deleted in
ath11k_mac_op_sta_state() when STA's state changes from
IEEE80211_STA_NONE to IEEE80211_STA_NOTEXIST, which also coincides
with current peer creation design that peer is created during
IEEE80211_STA_NOTEXIST -> IEEE80211_STA_NONE transition. So move
peer delete back to ath11k_mac_op_sta_state(), also stop vdev before
deleting peer to fix the firmware crash issue mentioned there. In
this way the connection failure mentioned here is also fixed.

Also do some cleanups in patch "wifi: ath11k: remove invalid peer
create logic", and refactor in patches "wifi: ath11k: rename
ath11k_start_vdev_delay()" and "wifi: ath11k: avoid forward declaration
of ath11k_mac_start_vdev_delay()".

Tested this patch set using QCA6390 and WCN6855 on both STA and SAP
interfaces. Basic connection and ping work well.

Baochen Qiang (4):
  wifi: ath11k: remove invalid peer create logic
  wifi: ath11k: rename ath11k_start_vdev_delay()
  wifi: ath11k: avoid forward declaration of
    ath11k_mac_start_vdev_delay()
  wifi: ath11k: fix connection failure due to unexpected peer delete

 drivers/net/wireless/ath/ath11k/mac.c | 564 +++++++++++++-------------
 1 file changed, 288 insertions(+), 276 deletions(-)

ath11k_nss: Revert support for beacon_tx_mode

ath11k_nss: Update release fix dependancies

ath11k_nss: mgmt and data ack rssi update

Data ACK RSSI :

      Advertise NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT feature support
for accounting and notifying "last ack signal" and "avg ack signal" to
user space through NL interface.

      Enabled data ack rssi support for ethernet mode.

Mgmt ACK RSSI:

      Enabled support for Tx-ACK RSSI in HTT over Management packets.

ath11k_nss: add missing support to enable/disable bss color collision detection

ath11k_nss: FW Initiated Dynamic MU-EDCA

Implementing the updating of firmware initiated dynamic MU-EDCA
parameters in Beacon IE. Firmware routinely checks its clients and
updates its MU-EDCA values every 3 seconds. Firmware is tuning
MU-EDCA parameters to improve performance. As part of this process,
the firmware informs host about new MU-EDCA values utilizing
WMI_MUEDCA_PARAMS_CONFIG_EVENTID. FW expectation is that host will
update MU-EDCA parameters in the Beacon IE.

ath11k_nss: refresh patches + cleanup Makefile

ath11k_nss: Set correct pbufs for 1GB profile

ath11k_nss: Revert setting fw_mem_mode for IPQ807x

Leave it set to '0', as it will kernel panic with 2K skb patch. This
flag was incorrectly assumed to save memory on 1G platforms.

ath11k_nss: remove leftover max_tx_ring

it was not removed when applying patch to replace it with 'max_tx_ring =
DP_TCL_NUM_RING_MAX +1'

ath11k_nss: Import bugfix patches

ath11k_nss: Experimental build for IPQ6018

This will require setting the correct `ATH11K_MEM_PROFILE_XXX` for your
platform. Setting it to value lower/higher than physically available
will cause NULL virtual address kernel panics.

I believe this setting was not originally meant to reduce memory
footprint of 1G+ platforms, but to account for platforms that were
512M or less.

Will require tweaking to allow for the old behvaior on 1G+ IPQ807x,
while still saving memory for platforms <= 512M.

commit d2d5a0d1f9ce668f92a22eb45279c6c4c3bf7a4f
Author:     Qosmio <datapronix@protonmail.com>
AuthorDate: Sat Mar 9 11:59:20 2024 -0500
Commit:     Sean Khan <datapronix@protonmail.com>
CommitDate: Fri Oct 11 11:13:03 2024 -0400

ath11k_nss: fix typo in 512M memory profile

ath11k_nss: remove SFE patch 718-e-mac80211-Deliver-the-frame-to-driver-tx-ops-directly

It is not relevant to NSS builds and only meant for SFE.

ath11k_nss: remove unecessary patches

Color collision should be left on by default, as it's a primary feature
of 802.11AX.

ath11k_nss: fix spacing

ath11k_nss: Remove unnecessary TKIP bloat

Remove TKIP patches that are not being used as 99% of folks are running
modern encryption (AES-CCMP,SAE,etc).

ath11k_nss: parameterize DP_RXDMA_REFILL_RING_SIZE memory profile

ath11k_nss: Remove SFE related code

Cleanup SFE (shortcut fe) related code as we're not using it on NSS

ath11k_nss: idr, ampdu, and skb headroom check optimizations

ath11k_nss: get valid last_rate for rx_bitrate from cpu stats

ath11k_nss: Fix BCCA counter for EMA

Currently BCCA counter is updated to FW via csa counter offs and
beacon with new countdown is updated for every beacon tx completion event.
For EMA, all EMA beacons are updated in one shot, and counter update for
every tx event will mess up the actual sequence of countdown sent over the air.

Allow FW to update the countdown till 1 and finalize the color
change.

ath11k_nss: Fix compile for TRACE feature
2024-10-11 19:19:03 -04:00
Qosmio
0cb558d028 ath11k_nss: set pbuf script off by default
uci option pbuf.opt.memory_profile must be explicity set to auto, 1gb,
512m, 256m to run.
2024-10-11 19:19:03 -04:00