From: Kalle Valo <kvalo@codeaurora.org>
To: Wen Gong <wgong@codeaurora.org>
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH v5 2/8] ath10k: enable RX bundle receive for sdio
Date: Sat, 21 Sep 2019 15:15:58 +0300 [thread overview]
Message-ID: <87r249alq9.fsf@codeaurora.org> (raw)
In-Reply-To: <1567679893-14029-3-git-send-email-wgong@codeaurora.org> (Wen Gong's message of "Thu, 5 Sep 2019 18:38:07 +0800")
Wen Gong <wgong@codeaurora.org> writes:
> From: Alagu Sankar <alagusankar@silex-india.com>
>
> The existing implementation of initiating multiple sdio transfers for
> receive bundling is slowing down the receive speed. Combining the
> transfers using a bundle method would be ideal.
>
> The transmission utilization ratio for sdio bus for small packet is
> slow, because the space and time cost for sdio bus is same for large
> length packet and small length packet. So the speed of data for large
> length packet is higher than small length.
>
> Test result of different length of data:
> data packet(byte) cost time(us) calculated rate(Mbps)
> 256 28 73
> 512 33 124
> 1024 35 234
> 1792 45 318
> 14336 168 682
> 28672 333 688
> 57344 660 695
>
> Tested with QCA6174 SDIO with firmware
> WLAN.RMH.4.4.1-00007-QCARMSWP-1.
>
> Signed-off-by: Alagu Sankar <alagusankar@silex-india.com>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
[...]
> --- a/drivers/net/wireless/ath/ath10k/sdio.c
> +++ b/drivers/net/wireless/ath/ath10k/sdio.c
> @@ -24,6 +24,9 @@
> #include "trace.h"
> #include "sdio.h"
>
> +#define ATH10K_SDIO_DMA_BUF_SIZE (32 * 1024)
> +#define ATH10K_SDIO_VSG_BUF_SIZE (32 * 1024)
Why two defines? Seems error prone to me and using the latter should be
enough.
> @@ -529,6 +532,7 @@ static int ath10k_sdio_mbox_rx_alloc(struct ath10k *ar,
> size_t full_len, act_len;
> bool last_in_bundle;
> int ret, i;
> + int pkt_cnt = 0;
>
> if (n_lookaheads > ATH10K_SDIO_MAX_RX_MSGS) {
> ath10k_warn(ar,
> @@ -572,20 +576,22 @@ static int ath10k_sdio_mbox_rx_alloc(struct ath10k *ar,
> */
> size_t bndl_cnt;
>
> - ret = ath10k_sdio_mbox_alloc_pkt_bundle(ar,
> - &ar_sdio->rx_pkts[i],
> - htc_hdr,
> - full_len,
> - act_len,
> - &bndl_cnt);
> + struct ath10k_sdio_rx_data *rx_pkts =
> + &ar_sdio->rx_pkts[pkt_cnt];
You need to declare rx_pkts in the beginning of the block, not mixed
within the code.
> @@ -606,9 +612,10 @@ static int ath10k_sdio_mbox_rx_alloc(struct ath10k *ar,
> ath10k_warn(ar, "alloc_rx_pkt error %d\n", ret);
> goto err;
> }
> + pkt_cnt++;
Empty line before 'pkt_cnt++'.
> -static int ath10k_sdio_mbox_rx_fetch(struct ath10k *ar)
> +static int ath10k_sdio_mbox_rx_fetch_bundle(struct ath10k *ar)
> {
> struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
> + struct ath10k_sdio_rx_data *pkt;
> + struct ath10k_htc_hdr *htc_hdr;
> int ret, i;
> + u32 pkt_offset, virt_pkt_len;
>
> + virt_pkt_len = 0;
> for (i = 0; i < ar_sdio->n_rx_pkts; i++) {
> - ret = ath10k_sdio_mbox_rx_packet(ar,
> - &ar_sdio->rx_pkts[i]);
> + virt_pkt_len += ar_sdio->rx_pkts[i].alloc_len;
> + }
> +
> + if (virt_pkt_len < ATH10K_SDIO_DMA_BUF_SIZE) {
> + ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr,
> + ar_sdio->vsg_buffer, virt_pkt_len);
> if (ret)
> goto err;
> + } else {
> + ath10k_err(ar, "size exceeding limit %d\n", virt_pkt_len);
> + ret = -ENOMEM;
> + goto err;
> + }
Use common error handling style, ath10k_warn() and -E2BIG:
if (virt_pkt_len >= ATH10K_SDIO_DMA_BUF_SIZE) {
ath10k_err(ar, "size exceeding limit %d\n", virt_pkt_len);
ret = -E2BIG;
goto err;
}
ret = ath10k_sdio_readsb(ar, ar_sdio->mbox_info.htc_addr,
ar_sdio->vsg_buffer, virt_pkt_len);
if (ret) {
ath10k_warn("failed to do foo: %d", ret)
goto err;
}
> @@ -1123,7 +1151,7 @@ static int ath10k_sdio_bmi_get_rx_lookahead(struct ath10k *ar)
> MBOX_HOST_INT_STATUS_ADDRESS,
> &rx_word);
> if (ret) {
> - ath10k_warn(ar, "unable to read RX_LOOKAHEAD_VALID: %d\n", ret);
> + ath10k_warn(ar, "unable to read rx_lookahd: %d\n", ret);
Looks like an unnecessary change?
> @@ -196,6 +196,9 @@ struct ath10k_sdio {
> struct ath10k *ar;
> struct ath10k_sdio_irq_data irq_data;
>
> + /* temporary buffer for sdio read */
> + u8 *vsg_buffer;
So how is vsg_buffer protected? You should document that here.
--
Kalle Valo
next prev parent reply other threads:[~2019-09-21 12:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 10:38 [PATCH v5 0/8] ath10k: improve throughout of tcp/udp TX/RX of sdio Wen Gong
2019-09-05 10:38 ` [PATCH v5 1/8] ath10k: adjust skb length in ath10k_sdio_mbox_rx_packet Wen Gong
2019-09-12 13:46 ` Kalle Valo
2019-09-12 14:02 ` Nicolas Boichat
2019-09-12 14:54 ` Kalle Valo
2019-09-05 10:38 ` [PATCH v5 2/8] ath10k: enable RX bundle receive for sdio Wen Gong
2019-09-21 12:15 ` Kalle Valo [this message]
2019-09-05 10:38 ` [PATCH v5 3/8] ath10k: change max RX bundle size from 8 to 32 " Wen Gong
2019-09-23 9:05 ` Kalle Valo
2019-09-24 9:32 ` Wen Gong
2019-09-05 10:38 ` [PATCH v5 4/8] ath10k: add workqueue for RX path of sdio Wen Gong
2019-09-23 9:49 ` Kalle Valo
2019-09-05 10:38 ` [PATCH v5 5/8] ath10k: disable TX complete indication of htt for sdio Wen Gong
2019-09-21 12:02 ` Kalle Valo
2019-09-05 10:38 ` [PATCH v5 6/8] ath10k: add htt TX bundle " Wen Gong
2019-09-05 10:38 ` [PATCH v5 7/8] ath10k: enable alt data of TX path " Wen Gong
2019-09-05 10:38 ` [PATCH v5 8/8] ath10k: enable napi on RX " Wen Gong
2019-09-23 9:22 ` Kalle Valo
2019-09-12 15:39 ` [PATCH v5 0/8] ath10k: improve throughout of tcp/udp TX/RX of sdio Kalle Valo
2019-09-12 17:51 ` Kalle Valo
2019-09-13 3:54 ` Wen Gong
2019-09-20 12:44 ` Kalle Valo
2019-09-23 9:29 ` Kalle Valo
2019-09-24 12:32 ` Wen Gong
2019-09-26 2:33 ` Wen Gong
2019-10-14 11:53 ` Wen Gong
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=87r249alq9.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=wgong@codeaurora.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).