Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp859881rdb; Tue, 23 Jan 2024 18:35:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IGk8sp6oMc5yH42+kYN74z/ieG1cfPweUlOs58hAbQXoHF5CjcW+jqSN0S1vd+02NzNI+Gh X-Received: by 2002:a05:651c:211:b0:2cf:12af:dc09 with SMTP id y17-20020a05651c021100b002cf12afdc09mr324757ljn.43.1706063757266; Tue, 23 Jan 2024 18:35:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706063757; cv=pass; d=google.com; s=arc-20160816; b=0l5a8+ejOM75LUdpj/8FxTKcPMCkyqF0/aorISc0SCe8Mc5ha/oJCqd+9kUxjA/2Yx ay1UqbfADqwgiG2UcsPNOLtGohbODayjdMYTmETzsQvGZihw9z4fv4pxU6xYqwUUA+qX /AewABCzER04i+3f9Fl0nO3qm8UVMFc5ZX+BDfGdLdyuuxA3fGgKOBPW/620SCoqf8eT osd3kE7kKB6YCWAKFOSp93diWQfBDXkEAGMzJm83vmCaMgnguaC3a+1Yf1SOjLYoTH+Z FB1WX7+vu1H6rKXWgkD4/yJ8nglKPIvDNocToDK2JzOqlK2IuCxf3JkC5j1/uCwa5Bd1 SM9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ry6TUcO/tVaxpVzOT+I1siLRRNkF5Nd5FE83y4j4sJU=; fh=lP+FyPnTPmJOMA/wP4iC1fr6HzuBVIppIk9dmo9v2y0=; b=FZ12IY8/kGSoJ89ylTAKKNJLlExrIZ2VAC6cp8BQkgfIaEKhLk0diKp8cwvFryAGkh sqi1YaMjMuhGVCAI6bSVYw6VZgmgrvj5qRbksKgU08v42IaXKR1u/ZF1o7wKhNOOf3mf s9RqlxcbX2IPaxjroiFZ7FGLPDqfkug/Pw6rzuy+f7S2rN9VJknh6tGMLkovfA0wP9pz k74Os94+SnYOPsI0s5vrs0GYpa3Pj2NCM22DEpS3JOmyztMXLoeYqTa4UDU7Dba9aRvd CDKCkkzZ1hCu80NtUhm2KMrtVTmLWA4FB+yXqHWbaaOxUy5sDXLbAgwYL16RIYUPzZ3l nV1g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZNFxpPNK; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y9-20020a056402440900b0055c22552bd5si3363689eda.262.2024.01.23.18.35.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 18:35:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZNFxpPNK; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 017151F27A06 for ; Wed, 24 Jan 2024 02:35:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 958DC1396; Wed, 24 Jan 2024 02:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ZNFxpPNK" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 28E3A4402 for ; Wed, 24 Jan 2024 02:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706063753; cv=none; b=sBWW4Fjv/32QwD/e2S1Sg36MdPqVt6zfpHNsZ7c54uby20YJsDk39fbGJrHpMgCGl02yleM5lC6ST6mlQqGe5S/I8RnKA14Ob9jOjcmswOGRC6FcnD7m0dFIY0tVonlJ6m2BgweCqu8e0Plwgw9U9CoFwNqMLjl3O2wofQNRtSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706063753; c=relaxed/simple; bh=V2JkuXA8837nNqsegGaG8tSgfcWnNh/97F7SHcfJtK8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=A4ru0LTtouTdbDOaVaa2vE1oYyXuG3Wpq47ElnIcL5WS/A7reFLfOqLWQnuA1O7jQ/tg5cjZqNyA/hICyj8i0dJzaKUFIImxCrZtlxuQivVZ14t9Y2r+X/ZMNgWKqGO7QehTaLw1BFF98p7AV6TtDsc4PQZS34KkWCud0PZl8xk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=ZNFxpPNK; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40O1MLnP027786; Wed, 24 Jan 2024 02:35:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=ry6TUcO/tVaxpVzOT+I1siLRRNkF5Nd5FE83y4j4sJU=; b=ZN FxpPNK15YyHwLdBcYyWh8L57Ud8dQNWpKozngB2PP+5nUi4TNaLcldXe1b+RV+X+ 0ASb+I5SlszpYqxnB9rlcnUBbwXYbukwd56WwpNWKh2uv7Qk9GRKLA6ODc3/bUcu cOuZmrlc88KGJRDEmd+bYXjSRMPlTilRL0e8RDp1zbrWxBj/Ir7EcDwiNfER0FDE nB+ZX4ylNWg4jwUJGCxJQglCcx6tYh3H/zhDgD5QKq58KvM6lfIF723Y4k01JuyT SvZAC7WW7aHKv7/YZOARUQuVGSVRd8cCYH1wYFkqjCf+7U4bM/CMuSA3z3uRVdW/ 5WEcqErhKD/dv+z2plTw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vtmmegj6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 02:35:49 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40O2Zm3Z019378 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Jan 2024 02:35:48 GMT Received: from [10.110.18.75] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 23 Jan 2024 18:35:47 -0800 Message-ID: <73e9ddd2-7c0c-4a96-a120-7480ebffc4f0@quicinc.com> Date: Tue, 23 Jan 2024 18:35:47 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath11k: enable 36 bit mask for stream DMA Content-Language: en-US To: Baochen Qiang , CC: References: <20240123015201.28939-1-quic_bqiang@quicinc.com> From: Jeff Johnson In-Reply-To: <20240123015201.28939-1-quic_bqiang@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: yyhLIKeTVocZkE2UvWO9haVYNpg7V10P X-Proofpoint-ORIG-GUID: yyhLIKeTVocZkE2UvWO9haVYNpg7V10P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-23_15,2024-01-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 adultscore=0 clxscore=1015 priorityscore=1501 spamscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401240018 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, actual code LGTM Acked-by: Jeff Johnson