ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: Baochen Qiang <quic_bqiang@quicinc.com>,
	 <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] wifi: ath11k: enable 36 bit mask for stream DMA
Date: Thu, 25 Jan 2024 18:37:45 +0200	[thread overview]
Message-ID: <878r4d1i92.fsf@kernel.org> (raw)
In-Reply-To: <73e9ddd2-7c0c-4a96-a120-7480ebffc4f0@quicinc.com> (Jeff Johnson's message of "Tue, 23 Jan 2024 18:35:47 -0800")

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 1/22/2024 5:52 PM, Baochen Qiang wrote:
>
>> Currently 32 bit DMA mask is used, telling kernel to get us an DMA
>> address under 4GB when mapping a buffer. This results in a very high
>> CPU overhead in the case where IOMMU is disabled and more than 4GB
>> system memory is installed. The reason is, with more than 4GB memory
>> installed, kernel is likely to allocate a buffer whose physical
>> address is above 4GB. While with IOMMU disabled, kernel has to involve
>> SWIOTLB to map/unmap that buffer, which consumes lots of CPU cycles.
>> 
>> We did hit an issue caused by the reason mentioned above: in a system
>> that disables IOMMU and gets 8GB memory installed, a total of 40.5%
>> CPU usage is observed in throughput test. CPU profiling shows nearly
>> 60% of CPU cycles are consumed by SWIOTLB.
>> 
>> By enabling 36 bit DMA mask, we can bypass SWIOTLB for any buffer
>> whose physical address is below 64GB. There are two types of DMA mask
>> within struct device, named dma_mask and coherent_dma_mask. Here we
>> only enable 36 bit for dma_mask, because firmware crashes if
>> coherent_dma_mask is also enabled, due to some unknown hardware
>> limitations. This is acceptable because coherent_dma_mask is used for
>> mapping a consistent DMA buffer, which generally does not happen in
>> a hot path.
>> 
>> With this change, the total CPU usage mentioned in above issue drops
>> to 18.9%.
>> 
>> Tested-on: WCN6855 hw2.1 PCI
>> WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
>> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
>> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
>> 
>> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
>> ---
>>  drivers/net/wireless/ath/ath11k/mhi.c |  2 +-
>>  drivers/net/wireless/ath/ath11k/pci.c | 16 +++++++++++++---
>>  drivers/net/wireless/ath/ath11k/pci.h |  1 +
>>  3 files changed, 15 insertions(+), 4 deletions(-)

> My Qualcomm Innovation Center copyright checker reports:
>
> drivers/net/wireless/ath/ath11k/mhi.c copyright missing 2024
> drivers/net/wireless/ath/ath11k/pci.c copyright missing 2024
> drivers/net/wireless/ath/ath11k/pci.h copyright missing 2024
>
> Kalle can fix this in the pending tree

Yup, added those.

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

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


  reply	other threads:[~2024-01-25 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  1:52 [PATCH] wifi: ath11k: enable 36 bit mask for stream DMA Baochen Qiang
2024-01-24  2:35 ` Jeff Johnson
2024-01-25 16:37   ` Kalle Valo [this message]
2024-01-25 16:38 ` Kalle Valo

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=878r4d1i92.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_bqiang@quicinc.com \
    --cc=quic_jjohnson@quicinc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox