Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp75465rdb; Thu, 25 Jan 2024 08:39:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYck8CobcNUcV8ZZFOpG7Dt/SniOEEUbGAxdksmcphd5WvJf2jGLZ5ck2bR1P1xpgCRLqx X-Received: by 2002:a05:6a21:6d9d:b0:19b:5c7e:ae41 with SMTP id wl29-20020a056a216d9d00b0019b5c7eae41mr1703267pzb.84.1706200741654; Thu, 25 Jan 2024 08:39:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706200741; cv=pass; d=google.com; s=arc-20160816; b=O+7rRKdX8SQQ8CEZ/lGTlFGAmkrlZ1fM7+GaQj2lr63SQGlUh3HOruQ7GJvSM2JWDX yszkBoCNvWsTHXT4hIWNPgc2oOGmlwUrpTTJvHENoIfOpqp/77JLqU+oeldlOs+C7l+1 He+2rVVzUsVbs2hERBgAk+T+zAHWMzxHKUCKansSOOa+5ltgF795rtAbxtinIeyX3+2f pDFwfSaWi7M+ZmjuEfeNxsbVI1GkFr0W7ShPXg0yGaZ5wGkENGizfRw24gHnvG006u5K epsctHqLPR9WcTHMrcxMSHEXzvrWbs5OdyLbJmyhHmKGQXwR1LQRYnTp56kvoYFU+zqQ e+JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=gnnqOW4WEc5t5NqMuGa7SLqkdW+FmKbgxmje9AU1oeY=; fh=rhriZ4+C8tGlkm662kKItPLTJu2mlWHTe60Qvb5qGy0=; b=GDr5alWQGpnzT9eSnMEEGIj1vhmluBvDUGrTmSXql3ddJBPop3KsDaSovvyG5Qjs6J R+6DVhLqAji+81uM5CjoPxSoAQW+JMl2DxdufQRRAxfIErHE6DCI//MoLogUToQeKXiz o35jb5P/t92vjKJrX9yb7bRNqVQ/C753R4Ci8XEsoVsm82tkx5zG/Sw1tefp/5oIvPke BFyu9dgC70sYPC2JmQe+Y09VySWJOnHXJgLrEDUwZJN4dlVT6SCbJXPNx39VRx8h4VTY TSXl0LgAl9tvC7OY3tEiGj03oIBAAnd3BKFpZM2Rbva9P4q4Ta3fQYOxm58mKFnGxZ0F H+/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/3myDpc"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2494-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k125-20020a632483000000b005d475e33062si329263pgk.172.2024.01.25.08.39.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 08:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2494-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="V/3myDpc"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2494-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1E34628FC5B for ; Thu, 25 Jan 2024 16:37:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC23612FF97; Thu, 25 Jan 2024 16:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V/3myDpc" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8B8C7CF13 for ; Thu, 25 Jan 2024 16:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200668; cv=none; b=W21ybmQudJkL/tjLj5GAe/O+sIa8yjOvjb9TRYkW1J53xNG5zjMviMiEURfN+FdQhLUimWwNTjirCvekF08UwXJdHasQLmhhVWDPWfwfnGr2wBnJsNrZtw6oCWPEaNTidgZvHGYQEPVxo2IknYzRJ59IUhpdEQF5s9nK/+RRs1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200668; c=relaxed/simple; bh=WYw4m0b98hGk2o3P5WPH7ylm5ZY+XZ7CvVVplA0O5gU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=rPlxrISBtlNPnKZzB1mtPJSx+ByNDpA8PgWOzMvXCJY8305u6jGYEJV+KAmlagDXwBrINWNUqWNvXrHUBIksCDI6QwArfxjlvFKESV6a9YElZSEoRbBtCnkH+6+vkeXEDFM5Qi8jq9bSJZV/8CohwIJ74iREGh1O/wSOjgkBSXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V/3myDpc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D641C433C7; Thu, 25 Jan 2024 16:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200668; bh=WYw4m0b98hGk2o3P5WPH7ylm5ZY+XZ7CvVVplA0O5gU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=V/3myDpcdLuUu7jyh3JWj4M3LTcVz9eKetLyfIx7S6w8zw4CojtZSScQntyCZnsmF p4UdtWVl1ACLwJTzBcNC60gGwselRsZBMO5lfhiS/HWWdy9uNA7bQmAjSl4iXzAUw+ xDKPKrtGPpp6cOfKCUF7xxGn4fMw+zzTwAoV5vCpEo0QsKhaKpfzlFckAfvIkGatPo g/VDf7XDSpINPB/iXzUsPvmhMEpwsT0lxpBNgpMLOQdPaPGJBMGktOm8Y7ovIf95+p 7QPH9wyeWU1bYDaEf0uIkZaGvEAwcF+zaYPBR/91h8iB8zE78yqEfzOTej/T/YrmQC JUY3QDdCeVygQ== From: Kalle Valo To: Jeff Johnson Cc: Baochen Qiang , , Subject: Re: [PATCH] wifi: ath11k: enable 36 bit mask for stream DMA References: <20240123015201.28939-1-quic_bqiang@quicinc.com> <73e9ddd2-7c0c-4a96-a120-7480ebffc4f0@quicinc.com> Date: Thu, 25 Jan 2024 18:37:45 +0200 In-Reply-To: <73e9ddd2-7c0c-4a96-a120-7480ebffc4f0@quicinc.com> (Jeff Johnson's message of "Tue, 23 Jan 2024 18:35:47 -0800") Message-ID: <878r4d1i92.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Jeff Johnson 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 >> --- >> 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