From: Ping-Ke Shih <pkshih@realtek.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "Lukas F. Hartmann" <lukas@mntre.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"tony0620emma@gmail.com" <tony0620emma@gmail.com>,
"jernej.skrabec@gmail.com" <jernej.skrabec@gmail.com>
Subject: RE: wifi: rtw88: question about SDIO RX aggregation limiting
Date: Tue, 13 Jun 2023 02:20:13 +0000 [thread overview]
Message-ID: <9ab8cc85d4d440bfa63dcade4e4f9ecf@realtek.com> (raw)
In-Reply-To: <CAFBinCBaXtebixKbjkWKW_WXc5k=NdGNaGUjVE8NCPNxOhsb2g@mail.gmail.com>
> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Sent: Monday, June 12, 2023 4:23 AM
> To: linux-wireless@vger.kernel.org; Ping-Ke Shih <pkshih@realtek.com>
> Cc: Lukas F. Hartmann <lukas@mntre.com>; linux-kernel@vger.kernel.org; tony0620emma@gmail.com;
> jernej.skrabec@gmail.com
> Subject: wifi: rtw88: question about SDIO RX aggregation limiting
>
> Hello Ping-Ke,
>
> certain Amlogic SDIO host controllers have a limit of
> receiving/transmitting at most 1536 bytes at a time.
> It turns out that rtw_sdio_enable_rx_aggregation() from rtw88/sdio.c
> is not taking this into account currently.
> For any RX buffer that is bigger than 1536 bytes (which can happen due
> to RX aggregation) we're unable to do any processing on the host side
> because all bytes beyond the 1536 bytes mark are lost.
>
> Lukas found that limiting BIT_RXDMA_AGG_PG_TH to 0x6 makes his
> RTL8822CS work on the affected Amlogic SoCs.
>
> My question now is: how can we properly limit BIT_RXDMA_AGG_PG_TH
> without hard-coding a one-fits-all value (which may reduce
> performance)?
>
> Initially I thought that we could just calculate it:
> host_max_pages = mmc_host->max_req_size / rtwdev->chip->page_size
> max_req_size for the affected controller is 1536 and chip->page_size
> is 128, so the result would be 12 (I thought it would be close to this
> number, maybe +/-1).
> Unfortunately this doesn't fix the issue and for his board
> BIT_RXDMA_AGG_PG_TH the limit is 6 or 7.
>
> If you could describe how BIT_RXDMA_AGG_PG_TH generally works I can
> come up with the algorithm to calculate the limit on my own (at least
> I hope so).
> Lukas has been very patient with testing so far and I understood that
> he's willing to test further patches if we think that it fixes the
> rtw88 driver issue he's seeing.
>
The unit of BIT_RXDMA_AGG_PG_TH is 1k bytes, so I think you can
set mmc_host->max_req_size/1024.
I wonder why 0x6 works on Amlogic SoCs. Could you or Lukas compare performance
between the settings of 0x1 and 0x6?
Ping-Ke
next prev parent reply other threads:[~2023-06-13 2:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-11 20:23 wifi: rtw88: question about SDIO RX aggregation limiting Martin Blumenstingl
2023-06-13 2:20 ` Ping-Ke Shih [this message]
2023-06-19 20:38 ` Martin Blumenstingl
2023-06-20 5:26 ` Ping-Ke Shih
2023-07-03 21:25 ` Martin Blumenstingl
2023-07-04 9:20 ` Ping-Ke Shih
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9ab8cc85d4d440bfa63dcade4e4f9ecf@realtek.com \
--to=pkshih@realtek.com \
--cc=jernej.skrabec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lukas@mntre.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=tony0620emma@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.