2020-09-05 09:26:57

by Lorenzo Bianconi

[permalink] [raw]
Subject: [PATCH 1/7] mt76: mt7663s: do not use altx for ctl/mgmt traffic

Since the sdio engine does not report quota for altx queue, move
ctl/mgmt traffic to standard data queues

Tested-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7615/sdio.c | 2 +-
.../net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 12 +++---------
2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
index e0603e82e33d..8621c6f579aa 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio.c
@@ -323,7 +323,7 @@ static int mt7663s_probe(struct sdio_func *func,
{
static const struct mt76_driver_ops drv_ops = {
.txwi_size = MT_USB_TXD_SIZE,
- .drv_flags = MT_DRV_RX_DMA_HDR | MT_DRV_HW_MGMT_TXQ,
+ .drv_flags = MT_DRV_RX_DMA_HDR,
.tx_prepare_skb = mt7663_usb_sdio_tx_prepare_skb,
.tx_complete_skb = mt7663_usb_sdio_tx_complete_skb,
.tx_status_data = mt7663_usb_sdio_tx_status_data,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
index 3557df52846f..b2b528cba7f1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
@@ -124,16 +124,14 @@ static int mt7663s_tx_update_sched(struct mt76_dev *dev,
bool mcu)
{
struct mt76_sdio *sdio = &dev->sdio;
- struct mt76_phy *mphy = &dev->phy;
- struct ieee80211_hdr *hdr;
int size, ret = -EBUSY;

+ if (!test_bit(MT76_STATE_MCU_RUNNING, &dev->phy.state))
+ return 0;
+
size = DIV_ROUND_UP(e->buf_sz + sdio->sched.deficit, MT_PSE_PAGE_SZ);

if (mcu) {
- if (!test_bit(MT76_STATE_MCU_RUNNING, &mphy->state))
- return 0;
-
mutex_lock(&sdio->sched.lock);
if (sdio->sched.pse_mcu_quota > size) {
sdio->sched.pse_mcu_quota -= size;
@@ -144,10 +142,6 @@ static int mt7663s_tx_update_sched(struct mt76_dev *dev,
return ret;
}

- hdr = (struct ieee80211_hdr *)(e->skb->data + MT_USB_TXD_SIZE);
- if (ieee80211_is_ctl(hdr->frame_control))
- return 0;
-
mutex_lock(&sdio->sched.lock);
if (sdio->sched.pse_data_quota > size &&
sdio->sched.ple_data_quota > 0) {
--
2.26.2


2020-09-05 11:33:42

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH 1/7] mt76: mt7663s: do not use altx for ctl/mgmt traffic

On 2020-09-05 11:26, Lorenzo Bianconi wrote:
> Since the sdio engine does not report quota for altx queue, move
> ctl/mgmt traffic to standard data queues
>
> Tested-by: Sean Wang <[email protected]>
> Signed-off-by: Lorenzo Bianconi <[email protected]>
Wouldn't this add powersave buffering to non-bufferable mgmt frames in
AP mode?

- Felix

2020-09-05 11:52:10

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCH 1/7] mt76: mt7663s: do not use altx for ctl/mgmt traffic

On Sep 05, Felix Fietkau wrote:
> On 2020-09-05 11:26, Lorenzo Bianconi wrote:
> > Since the sdio engine does not report quota for altx queue, move
> > ctl/mgmt traffic to standard data queues
> >
> > Tested-by: Sean Wang <[email protected]>
> > Signed-off-by: Lorenzo Bianconi <[email protected]>
> Wouldn't this add powersave buffering to non-bufferable mgmt frames in
> AP mode?

Right, but sdio devices do not have a hw dma scheduler like pcie or usb
ones and just report the availale quota for new trasmission for data queues only
AFAIU. Moreover AP support is not tested yet.

Regards,
Lorenzo

>
> - Felix


Attachments:
(No filename) (640.00 B)
signature.asc (235.00 B)
Download all attachments