mbox series

[0/5] add tx status reporting to mt7921 driver

Message ID cover.1629277624.git.lorenzo@kernel.org
Headers show
Series add tx status reporting to mt7921 driver | expand

Message

Lorenzo Bianconi Aug. 18, 2021, 9:09 a.m. UTC
Report tx rate from tx status packets instead of receiving periodic mcu
event. This improves flexibility, accuracy and AQL performance, and
simplifies code flow for better readability.
Add some code cleanup

Lorenzo Bianconi (5):
  mt76: mt7921: start reworking tx rate reporting
  mt76: mt7921: add support for tx status reporting
  mt76: mt7921: report tx rate directly from tx status
  mt76: mt7921: remove mcu rate reporting code
  mt76: mt7921: remove mt7921_sta_stats

 .../net/wireless/mediatek/mt76/mt7921/init.c  |   1 -
 .../net/wireless/mediatek/mt76/mt7921/mac.c   | 364 ++++++++++++------
 .../net/wireless/mediatek/mt76/mt7921/mac.h   |   9 +
 .../net/wireless/mediatek/mt76/mt7921/main.c  |  28 +-
 .../net/wireless/mediatek/mt76/mt7921/mcu.c   | 133 -------
 .../net/wireless/mediatek/mt76/mt7921/mcu.h   |  47 ---
 .../wireless/mediatek/mt76/mt7921/mt7921.h    |  21 +-
 7 files changed, 278 insertions(+), 325 deletions(-)

Comments

Kalle Valo Aug. 19, 2021, 2:55 p.m. UTC | #1
Lorenzo Bianconi <lorenzo@kernel.org> writes:

> Report tx rate from tx status packets instead of receiving periodic mcu

> event. This improves flexibility, accuracy and AQL performance, and

> simplifies code flow for better readability.

>

> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>


[...]

> +		/* We don't support reading GI info from txs packets.

> +		 * For accurate tx status reporting and AQL improvement,

> +		 * we need to make sure that flags match so polling GI

> +		 * from per-sta counters directly.

> +		 */

> +		rate = &msta->wcid.rate;

> +		addr = MT_WTBL_LMAC_OFFS(idx, 0) + 7 * 4;


Magic values.

> +		val = mt76_rr(dev, addr);

> +

> +		switch (rate->bw) {

> +		case RATE_INFO_BW_160:

> +			bw = IEEE80211_STA_RX_BW_160;

> +			break;

> +		case RATE_INFO_BW_80:

> +			bw = IEEE80211_STA_RX_BW_80;

> +			break;

> +		case RATE_INFO_BW_40:

> +			bw = IEEE80211_STA_RX_BW_40;

> +			break;

> +		default:

> +			bw = IEEE80211_STA_RX_BW_20;

> +			break;

> +		}

> +

> +		if (rate->flags & RATE_INFO_FLAGS_HE_MCS) {

> +			u8 offs = 24 + 2 * bw;

> +

> +			rate->he_gi = (val & (0x3 << offs)) >> offs;


Ditto.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Lorenzo Bianconi Aug. 19, 2021, 3:27 p.m. UTC | #2
On Aug 19, Kalle Valo wrote:
> Lorenzo Bianconi <lorenzo@kernel.org> writes:

> 

> > Report tx rate from tx status packets instead of receiving periodic mcu

> > event. This improves flexibility, accuracy and AQL performance, and

> > simplifies code flow for better readability.

> >

> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

> 

> [...]

> 

> > +		/* We don't support reading GI info from txs packets.

> > +		 * For accurate tx status reporting and AQL improvement,

> > +		 * we need to make sure that flags match so polling GI

> > +		 * from per-sta counters directly.

> > +		 */

> > +		rate = &msta->wcid.rate;

> > +		addr = MT_WTBL_LMAC_OFFS(idx, 0) + 7 * 4;

> 

> Magic values.


ack, I reused what was already in mt7921_mac_sta_poll(), but I can add some
definitions :)

> 

> > +		val = mt76_rr(dev, addr);

> > +

> > +		switch (rate->bw) {

> > +		case RATE_INFO_BW_160:

> > +			bw = IEEE80211_STA_RX_BW_160;

> > +			break;

> > +		case RATE_INFO_BW_80:

> > +			bw = IEEE80211_STA_RX_BW_80;

> > +			break;

> > +		case RATE_INFO_BW_40:

> > +			bw = IEEE80211_STA_RX_BW_40;

> > +			break;

> > +		default:

> > +			bw = IEEE80211_STA_RX_BW_20;

> > +			break;

> > +		}

> > +

> > +		if (rate->flags & RATE_INFO_FLAGS_HE_MCS) {

> > +			u8 offs = 24 + 2 * bw;

> > +

> > +			rate->he_gi = (val & (0x3 << offs)) >> offs;

> 

> Ditto.


same here, I just reused the code from mt7915, I will fix it.

Regards,
Lorenzo

> 

> -- 

> https://patchwork.kernel.org/project/linux-wireless/list/

> 

> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Kalle Valo Aug. 21, 2021, 1:53 p.m. UTC | #3
Lorenzo Bianconi <lorenzo@kernel.org> writes:

> On Aug 19, Kalle Valo wrote:

>> Lorenzo Bianconi <lorenzo@kernel.org> writes:

>> 

>> > Report tx rate from tx status packets instead of receiving periodic mcu

>> > event. This improves flexibility, accuracy and AQL performance, and

>> > simplifies code flow for better readability.

>> >

>> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

>> 

>> [...]

>> 

>> > +		/* We don't support reading GI info from txs packets.

>> > +		 * For accurate tx status reporting and AQL improvement,

>> > +		 * we need to make sure that flags match so polling GI

>> > +		 * from per-sta counters directly.

>> > +		 */

>> > +		rate = &msta->wcid.rate;

>> > +		addr = MT_WTBL_LMAC_OFFS(idx, 0) + 7 * 4;

>> 

>> Magic values.

>

> ack, I reused what was already in mt7921_mac_sta_poll(), but I can add some

> definitions :)


Heh, I guess then I have been doing sloppy review earlier :) But thanks
for fixing these, we should not repeat past mistakes.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches