R7500v2 (ath10k 9980) netperf observations, firmware/board-2.bin files, and other wifi issues

thing is that the fact that iw doesn't report atf is still a problem and should be checked... if also other user have this on 9980 than i would create an issue on ath10k-ct anyway...

Should it? Perhaps ath10k-ct for qca9984 should not report ATF since apparently it really does not have much to do with it. Which reminds me, i wonder if ATF implementation differs for qca9984 between the ct and non ct versions?

well an explanation wouldn't hurt. Could really be that the option was wrongly never enabled for 9980

1 Like

The other reason I don't want to do it yet is that the discussion is going faster than my ability to evaluate the recent change of getting "ATF" to show up from iw list. My comment to you about adding AFT configs to hostapd came from an netperf observation which indicates things might be different now.

Is my speculation that ATF does not have much to do with the ath10k-ct driver (as opposed to the firmware) really true? I need to do my home work.

I am grateful that greearb took a few seconds to comment here and I don't want to abuse that attention with bug reports of little value - besides, he seen it.

could someone with a qca9984 device running ath10k-ct post the output from:

cat /sys/kernel/debug/ieee80211/phy0/ath10k/wmi_services | grep -E '(AIRTIME|PEER_STATS)'

Obviously mine are not enabled:

r7500v2 # cat /sys/kernel/debug/ieee80211/phy0/ath10k/wmi_services | grep -E '(AIRTIME|PEER_STATS)'
WMI_SERVICE_PEER_STATS                   -
WMI_SERVICE_REPORT_AIRTIME               -

and before i do something rash like forcing ath10k_peer_stats_enabled(ar) to always return true, I like to know what your WMI_SERVICE_REPORT_AIRTIME state is.

EDIT: also it looks like /sys/kernel/debug/ieee80211/phy0/ath10k/fw_stats might be returning peer stats for one less than the number of connected peers for me. I don't think this is related but it did get me thinking how i would know if the tx_rate and other stats data used by ATF is correctly reported from the driver.
Thank you.

This is ath10k, not ath10k-ct:

root@nbg6817:~# cat /sys/kernel/debug/ieee80211/phy0/ath10k/wmi_services | grep -E '(AIRTIME|PEER_STATS)'
WMI_SERVICE_PEER_STATS                   enabled
WMI_SERVICE_REPORT_AIRTIME               enabled
1 Like

I submitted a bug report here.

I'll follow this one through, but I think I'm almost done.

Openwrt is a fun project and I've enjoyed spending time on it but using a device with a small user base and that is essentially unsupported is difficult. Certainly, I don't see many other users that would be willing to spend the effort described in this thread trying to figure out why their wifi sucks.

The r7500v2 is still a good switch and it is fortunate there is wireless support via ath10k-ct.

However, I think the developers such as yourself and @greearb are probably better served by simply stating this device is unsupported and spending time on devices with a larger user base. While existing r7500v2 users might complain, in the end they will also be better off not ending up here.

This is r7800 with ath10k-ct and ct-firmware, master build as of 3 days ago.

WMI_SERVICE_PEER_STATS                   enabled
WMI_SERVICE_REPORT_AIRTIME               -

But reading the bug report on github doesn't seem like it will be added back in.

1 Like

I know and thankyou. After a small patch to ath10k-ct mac.c, I can now get iw list to show ATF and i can change ATF weights; however changing ATF weights does not seem to change my netperf observations - at least like I expect it should.

EDIT I closed the bug report as, IMHO, this bug should be fixed in openwrt and not by @greearb. It seems to me that openwrt is "repurposing" the meaning of "NL80211_EXT_FEATURE_AIRTIME_FAIRNESS" in a way that is potentially confusing for ath10k-ct users outside of the openwrt project. The ath10k-ct 9980 firmware does not support ATF. Openwrt does support ATF (outside of the ath10k-ct driver/firmware) and the ath10k-ct driver facilitates ATF.

Are some peers still missing for you in /sys/kernel/debug/ieee80211/phy0/ath10k/fw_stats ?
They are all there for me...

yes, but I think this is a trivial bug.

I think it's because the airtime calculation code relies on WMI_SERVICE_PEER_STATS.
It uses the tx rate in peer stats.

But I think we can use the rate from tx_status instead.

1 Like

I'm running this device as an AP only and the qdisc for the wlan's are not set (by openwrt) by default. I've set the qdisc manually to fq_codel now (thanks to @quarky - see here) and there may be an improvement. I will also try changing the ATF weights and see if i can't change the netperf behavior now.

Early on i noticed the lack of qdisc on the wlan if's and tried to set them, but I failed. Can't express how happy I am that @quarky noticed/suggested it along with an example.

Why do you need that?
TXQ already uses fq_codel.

FWIW the openwrt default "AP only" wlan0 (5g) qdisc is

r7500v2 # tc -d -s qdisc show dev wlan0
qdisc noqueue 0: root refcnt 2 
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
 backlog 0b 0p requeues 0

So ATF should work with a "noqueue" qdisc?

I don't know that i need it or not as the whole ATF implementation is complex and I have not found good (user) documentation describing how to use it - I think because

A. I'm playing with it on master in a "development" state and
B. I suspect ATF is not meant to have much "non-expert" user interaction

of course when things don't work as a user expects, it makes it tough for the "non-expert" to identify issues and help troubleshoot. I think this whole thread is a good example of that.

But i digress and I very much appreciate your comments - thank you.

ATF works when the driver uses mac80211's TXQ and can report airtime.

BTW I can try to make a patch to enable ATF if you are willing to test

1 Like

yes please

Try this

--- a/ath10k-5.15/mac.c
+++ b/ath10k-5.15/mac.c
@@ -11302,10 +11302,7 @@ int ath10k_mac_register(struct ath10k *a
 		wiphy_ext_feature_set(ar->hw->wiphy,
 				      NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT);
 
-	if (ath10k_peer_stats_enabled(ar) ||
-	    test_bit(WMI_SERVICE_REPORT_AIRTIME, ar->wmi.svc_map))
-		wiphy_ext_feature_set(ar->hw->wiphy,
-				      NL80211_EXT_FEATURE_AIRTIME_FAIRNESS);
+	wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS);
 
 	if (test_bit(WMI_SERVICE_RTT_RESPONDER_ROLE, ar->wmi.svc_map))
 		wiphy_ext_feature_set(ar->hw->wiphy,
--- a/ath10k-5.15/txrx.c
+++ b/ath10k-5.15/txrx.c
@@ -5,6 +5,8 @@
  * Copyright (c) 2018, The Linux Foundation. All rights reserved.
  */
 
+#include <net/mac80211.h>
+
 #include "core.h"
 #include "txrx.h"
 #include "htt.h"
@@ -168,6 +170,8 @@ int ath10k_txrx_tx_unref(struct ath10k_h
 	struct sk_buff *msdu;
 	u8 flags;
 	bool tx_failed = false;
+	u32 duration = 0;
+	int len = 0;
 
 	ath10k_dbg(ar, ATH10K_DBG_HTT,
 		   "htt tx completion msdu_id %u status %d\n",
@@ -286,6 +290,14 @@ int ath10k_txrx_tx_unref(struct ath10k_h
 		ar->ok_tx_rate_status = true;
 		ath10k_set_tx_rate_status(ar, &info->status.rates[0], tx_done);
 
+		len = msdu->len;
+		duration = ieee80211_calc_tx_airtime(htt->ar->hw, info, len);
+		rcu_read_lock();
+		if (txq && txq->sta && duration)
+			ieee80211_sta_register_airtime(txq->sta, txq->tid,
+						       duration, 0);
+		rcu_read_unlock();
+
 		/* Only in version 14 and higher of CT firmware */
 		if (test_bit(ATH10K_FW_FEATURE_HAS_TXSTATUS_NOACK,
 			     ar->running_fw->fw_file.fw_features)) {
1 Like

FYI it applies and builds np. Just waiting for a chance to test it.

As it only changes ath10k_core.ko, i only moved the new one into /lib/modules/5.10.96/ and will reboot the AP to try it.

oh didn't know you can do that