Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1172886lqs; Wed, 6 Mar 2024 08:15:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXSxFawgFlCqVHfey4WbErs1WnKAXndb+QMssAgep0FmC9l8dMgdRTuKybV3gFzROiJ9rYAr65Tl1TeLJBXNC3MQOUVNQNz/gK22CgBNg== X-Google-Smtp-Source: AGHT+IFRjbbN+1DUdQ/l2m3pSYzI1K//jRMEyQVeqKuHyoUcOGgLY810vpIOnMxQSGmbZM2Fs1Ja X-Received: by 2002:ac2:5481:0:b0:512:d8fb:e45e with SMTP id t1-20020ac25481000000b00512d8fbe45emr3228931lfk.45.1709741701120; Wed, 06 Mar 2024 08:15:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709741701; cv=pass; d=google.com; s=arc-20160816; b=U64oDWWWlpr6zQHVVMECSMFmSh0l6pVNtyDjGgrRwM88ls9dJzKH6JlSfPPMAnZx33 6NpUKR9nD+5delyiY/obRwIOkLReaw4kv0iqQWsVkr5Vl9QgFhmoVMiiY3RfJ6Evd2I5 FXmHnlU2JWDwpXDpkYD0ZaMfORwqn0Sw8nbD+Rcjuhkw/kcbod4NeQaEnsjxj79Vd8h0 /uUeivBuwV11mYISdhXUj78VYspxifW0W2/BW6StjuLpUhKLhhF9Cwia4Mp6Qek2iMEu siLy+55Z/YPExkvDtbNwm9Mey/OdBAbbKERKD/Sr4FjoeFRppzyd2PSZsma5Ycp3pOT1 U2Mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=OzO/9AzUna+R5zeXsIy0wzPXoaVBkJN8YgW56YBfzG4=; fh=TFGp2O0CukLMhAVQPqIXJS6UKVONFCTFTz0+OSJyfrs=; b=Yi/36y1bUNXXcDIy/yj6RHO6rg60tzZKaMfT+ndXYlJmp3h45/JSol9PrdkNU/wxL3 ZwVKUImRRAqVmsC1/h6o1fH8YcwwkieLC+HAPnJDqvnXvFacHSrSe4ruN8c9jEzhE6BX +e+cQt126xXk5KzW36hoWVs/nmGi2vHn49gT2ILYUgS1sF5FbFUNmrooIL7qtB71GTkW 1ugxAqrr+c5UQDH8CL3i2DfHu65oY8TmnwE/za5UCSVoe9tkyf+I6oF8pcBhR/fzWGTY BVkQTq0N5issTn9qx8a2L0/8p5ymjuAAZjnKQSy9wKsKUrFa3iBAXymUwr7AXY48diRR fpZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-94236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94236-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k6-20020a170906578600b00a4597044ac9si1929042ejq.985.2024.03.06.08.15.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 08:15:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-94236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94236-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D12401F26FEB for ; Wed, 6 Mar 2024 16:15:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99AE1137768; Wed, 6 Mar 2024 16:14:48 +0000 (UTC) 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 39A37134733; Wed, 6 Mar 2024 16:14:46 +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=1709741688; cv=none; b=L7TJNPk3lEIESSUKTD6LPna9mehxaQxAm2Mkt1oMhTdfS20ojxx3t4EfYuLzUzIk3lBz2W3Zp5NtDhhLUMEa+ONyTnwJxFBx2YZw27WZuWEdV+E/A4xDj7cK2f3iK0OPP2Bye/gpHx3pOIkV5lWpf0y0evkFhqjnrRXEu4cftqM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709741688; c=relaxed/simple; bh=ph4wOA/W80emziteg+Lwe4Qh5uu+xg9ATnw4VSdVs0s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cKgaNcSvYN4Sks/GOTe7Vrb+MaJub+wA+xUk8qxDetNO5/H688N8Bqf8noezxhPSl63a5ved1axvwJPDxO6vcXalf/5inTckEZ8yRNkkQw1bHdj9/J8/JIpPQBuZFt8mqL25ZarhZLI/SgZqq6YOBrQyq2DxG4PFsN6d9uk0Ktw= 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 339E968C4E; Wed, 6 Mar 2024 17:14:39 +0100 (CET) Date: Wed, 6 Mar 2024 17:14:38 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , Keith Busch , Leon Romanovsky , Robin Murphy , Marek Szyprowski , Joerg Roedel , Will Deacon , Chaitanya Kulkarni , Chaitanya Kulkarni , Jonathan Corbet , Jens Axboe , Sagi Grimberg , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, linux-nvme@lists.infradead.org, kvm@vger.kernel.org, linux-mm@kvack.org, Bart Van Assche , Damien Le Moal , Amir Goldstein , "josef@toxicpanda.com" , "Martin K. Petersen" , "daniel@iogearbox.net" , Dan Williams , "jack@suse.com" , Leon Romanovsky , Zhu Yanjun Subject: Re: [RFC RESEND 16/16] nvme-pci: use blk_rq_dma_map() for NVMe SGL Message-ID: <20240306161438.GA28427@lst.de> References: <016fc02cbfa9be3c156a6f74df38def1e09c08f1.1709635535.git.leon@kernel.org> <20240306143321.GA19711@lst.de> <20240306150518.GL9225@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240306150518.GL9225@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) On Wed, Mar 06, 2024 at 11:05:18AM -0400, Jason Gunthorpe wrote: > > Yes. And this whole proposal also seems clearly confused (not just > > because of the gazillion reposts) but because it mixes up the case > > where we can coalesce CPU regions into a single dma_addr_t range > > (iommu and maybe in the future swiotlb) and one where we need a > > I had the broad expectation that the DMA API user would already be > providing a place to store the dma_addr_t as it has to feed that into > the HW. That memory should simply last up until we do dma unmap and > the cases that need dma_addr_t during unmap can go get it from there. Well. The dma_addr_t needs to be fed into the hardware somehow obviously. But for a the coalesced case we only need one such field, not Nranges. > We can't do much on the map side as single range doesn't imply > contiguous range, P2P and alignment create discontinuities in the > dma_addr_t that still have to be delt with. For alignment the right answer is almost always to require the upper layers to align to the iommu granularity. We've been a bit lax about that due to the way scatterlists are designed, but requiring the proper alignment actually benefits everyone.