Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp75483rdb; Thu, 25 Jan 2024 08:39:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTgbsH2zLrOsDlk01BZi+kQz/zmkHvckNDopT7IgubHivJ1rRK5QwDusI2d4tiZERzXPMM X-Received: by 2002:a17:902:f7cb:b0:1d7:8767:2b0f with SMTP id h11-20020a170902f7cb00b001d787672b0fmr912558plw.112.1706200744284; Thu, 25 Jan 2024 08:39:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706200744; cv=pass; d=google.com; s=arc-20160816; b=MT4EmBtnJbB3/HYlwW+RqUkFmxvTvqQY5Fx8TXc2pHxrGAiAdSU0QPHFWzuiuaJWIz LZiluH8CdwfxTNan11zGw1KLYjhDBE44czXWb0JWPQBX0ZfjoZkt1FDCmlAMkyv2Z9i8 ObyuXi8OFQzIDKPfjWKSpcftyiTnNLSZY5c8Tl7Z2S5qQpgnuoxfhUW4qMG63bnUi5sJ v3IzrZfHSaYdwLhc62kFvvCRMze2P4iBKmcI5bM8kCqIhrX3tjupN0MD338lM64gzkor p9XHIiIlvTLss/+yWsQws/LRW3BvW7/0vPvtdceX/CmMKSVlDLFoZJFdtvkObWjEkl00 B5xA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=M1F4mrmiC01J5V7YRQdBfdqTZ8iyhfPBw81+LlMJyIg=; fh=tPHBA95q4A2JsKJMw3mMqQ5Xsp/Qmg3wcY5CiIlDe3k=; b=IlB2MZIOaIiBNZzm43hOMcuMBS1zTEtGiROBGfJZiAm67Vvdcro+w529EUIduSA5yO SY3YGLXJ/+vGRnv9VxR8AE8sarTJvAILMCJ9aKMl1DbkPAN9m+uuo3EiL+wNrKRP7b9g ZR63NnQrYQ82vqXf+wVrgFhEe8tf54VSyYlp3AsC7ON9w3VSIUTYVtv/C/nRnp2ZMsd5 5yVkwy5v4Vwv4K1aMyWhcrEqkt7CWB9y3hNijwn5OYQLhKVRZn02XmHDjaLO//CNWEP5 d8hm5B73IFVEj3gRa8J2RqkXPXmrzFoe8TAhysPWXdLwXNk/ivK92XmEIAu1TWpRbE7/ uVdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qKeRe6Lt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2495-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 w5-20020a170902d3c500b001d781dc0f85si3340318plb.352.2024.01.25.08.39.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 08:39:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2495-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=qKeRe6Lt; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2495-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2495-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 AE38C2937F9 for ; Thu, 25 Jan 2024 16:38:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCEB512FF8C; Thu, 25 Jan 2024 16:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qKeRe6Lt" 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 B815812FF8A for ; Thu, 25 Jan 2024 16:38:12 +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=1706200692; cv=none; b=qapUft7F3ySNcz9uFILelY2OSgq+XexSyrOHIrtaRjmu+xpbwcJKDdpnFYY+zQzDYCElUyN0q4YAD0A8EW8JDkeBv1xJp5gdXBn8JuPyUGW6CKiP4M+zwOA4j88QmWjb0uWasgde4ju8PTrFJwF0KyvYniz2hnDwdCepd84vSDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706200692; c=relaxed/simple; bh=1k/fOt1ptdKUqxoEp0Ten5ndypjM0YAoefKa2pgGH3w=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=RhVnibn0xxw3Nc1MByGDKX6p439arpPrjdO8BJ7esZWbEabGHXdM+9tBPcXqtrd7lHQgHwZygG4JYnBp5mcuyRkkbuwPF8VwLRQ6PKtJRzwSGUiXTUfLl5q4DcuE8L+3sXJ/06ceTIMEs0ZQeulVugLijsl6o9/fvT4KnLSi/Js= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qKeRe6Lt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41482C43390; Thu, 25 Jan 2024 16:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706200692; bh=1k/fOt1ptdKUqxoEp0Ten5ndypjM0YAoefKa2pgGH3w=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=qKeRe6LtfgZJvDxbAqW8UF+UB/zyDAW2TlnRuF6N0oHJSEez8m0DeJsRCkBO9dunV mAZjUiZbDz3nbMWAzceSffz6zlf63vMwKEMZhmmM/B7lKky3ILlDLkc/C3IMnS2fiQ G/4+j/nSGAnH/Jm9FX6tkBNBh7i9R53vcNsxQYnpmd6W7r+mxGiwnodG0shB0+Jdnd 2qe0qslG7ksAjw2fA9xuK6MZRlDO14LaLtPSzO2XOVW6iPo+5kAd035GkJcnq3Pqlj 0cwaqtY/FMy4BeaCC51Rdv9pzC3ffTMCeDmCvQE0KbpfJty4cp/HT5Pwmpx7IVLUYM wV4zuk3t3DB3Q== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: ath11k: enable 36 bit mask for stream DMA From: Kalle Valo In-Reply-To: <20240123015201.28939-1-quic_bqiang@quicinc.com> References: <20240123015201.28939-1-quic_bqiang@quicinc.com> To: Baochen Qiang Cc: , , User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170620068905.500647.8187957964143425904.kvalo@kernel.org> Date: Thu, 25 Jan 2024 16:38:11 +0000 (UTC) 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 > Acked-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. dbd73acb22d8 wifi: ath11k: enable 36 bit mask for stream DMA -- https://patchwork.kernel.org/project/linux-wireless/patch/20240123015201.28939-1-quic_bqiang@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches