From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 3F489ECF for ; Fri, 5 Jul 2024 05:58:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720159093; cv=none; b=A9xz6K94I9+f+ArQlDlcmujDYLOKBlsvuvoTP2E/fLHM9jjblVw3vKuUeT66QB/T94NhXk/MaDD4jr4Vick9THJ2xbMiR6jONLahV4VH4UymW3tTZ3jOdQ7LHser3eMpqFyOqdipwwMlgcQHH/V272PM/Sk06cTGpuuzVUDNhz8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720159093; c=relaxed/simple; bh=SDR7JIipxE8QBOxM4QjWEIV62+OFxXsZNSo56rAwnQs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Cek+CwCha1FPuOxhQjJYUrN80vTSnPG8+K1zw66c8go72cc/2QOgqodgvTssRTGWj+yyBy3qWBtKyyVpbchqo4O75gkLPCHWKQQBhNZ5nVSD6pQbEEeKftXv2nwncz1t4iYkn/49MhkIuZ5xdtDtv8aRUGzc9B9522oyNbCQr04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id D8AEF68AA6; Fri, 5 Jul 2024 07:58:06 +0200 (CEST) Date: Fri, 5 Jul 2024 07:58:06 +0200 From: Christoph Hellwig To: Leon Romanovsky Cc: Robin Murphy , Jens Axboe , Jason Gunthorpe , Joerg Roedel , Will Deacon , Keith Busch , Christoph Hellwig , "Zeng, Oak" , Chaitanya Kulkarni , Sagi Grimberg , Bjorn Helgaas , Logan Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , Marek Szyprowski , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v1 18/18] nvme-pci: use new dma API Message-ID: <20240705055806.GA11885@lst.de> References: <47eb0510b0a6aa52d9f5665d75fa7093dd6af53f.1719909395.git.leon@kernel.org> <249ec228-4ffd-4121-bd51-f4a19275fee1@arm.com> <20240704171602.GE95824@unreal> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240704171602.GE95824@unreal> User-Agent: Mutt/1.5.17 (2007-11-01) > This is exactly how dma_map_sg() works. Which dma_map_sg? swiotlb handling is implemented in the underlying ops, dma-direct and dma-iommu specifically. dma-direct just iterates over the entries and calls dma_direct_map_page, which does a per-entry decision to bounce based on is_swiotlb_force_bounce, dma_capable and dma_kmalloc_needs_bounce.