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 03BC0259496; Thu, 12 Dec 2024 08:42:18 +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=1733992942; cv=none; b=WzEfqDL+jqOJ0c4DCYRzxLxizux8yD3KvubU5/EUOMxigE0vKXNMhulPab9oLdRSChWqERGNswFuf30KCapvUf6n6irxeKXPJSqENhMnhb6IOsxQYdTjFZDm1pOz2DyepV3ca8xbSCpBfY1HnKIeadXxyaOxcldgM07CVGDsqrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733992942; c=relaxed/simple; bh=qgD99XvHAf4K0f9XtMZ9UgqBA9Ac49qZgXfEM0h8An0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ENG/fo3lNc3I79MiugQ0YMadoSHBgcpCZM4cvrC3aN3kNYZY/F9RXDcSkc52kRbJZ8/okGVuaP+vw4H0c1rd9y5BtGyCg8qQ56iMfVgeJiO5pxLEjWV2013BK3gTUXNk+we5I/D+xNFhd+hM/jgJr7HPqvT73aS/QHCmpzCiIck= 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 B516068D1C; Thu, 12 Dec 2024 09:42:07 +0100 (CET) Date: Thu, 12 Dec 2024 09:42:06 +0100 From: Christoph Hellwig To: Leon Romanovsky Cc: Jens Axboe , Jason Gunthorpe , Robin Murphy , Joerg Roedel , Will Deacon , Christoph Hellwig , Sagi Grimberg , Leon Romanovsky , Keith Busch , Bjorn Helgaas , Logan Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Alex Williamson , Marek Szyprowski , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrew Morton , Jonathan Corbet , 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, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, Randy Dunlap Subject: Re: [PATCH v4 06/18] dma: Provide an interface to allow allocate IOVA Message-ID: <20241212084206.GC9376@lst.de> References: Precedence: bulk X-Mailing-List: linux-block@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: User-Agent: Mutt/1.5.17 (2007-11-01) s/dma/dma-mapping/ in the subject. > function call per API call used in datapath as well as a lot of boilerplate Please trim commit messages to 73 characters so that they still look good in git show output. > +bool dma_iova_try_alloc(struct device *dev, struct dma_iova_state *state, > + phys_addr_t phys, size_t size) > +{ > + memset(state, 0, sizeof(*state)); > + if (!use_dma_iommu(dev)) > + return false; > + if (static_branch_unlikely(&iommu_deferred_attach_enabled) && > + iommu_deferred_attach(dev, iommu_get_domain_for_dev(dev))) > + return false; > + return iommu_dma_iova_alloc(dev, state, phys, size); > +} Now that dma_iova_try_alloc is the only caller of iommu_dma_iova_alloc, maybe merge the two? Otherwise looks good: Reviewed-by: Christoph Hellwig