From mboxrd@z Thu Jan 1 00:00:00 1970 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 C667B20CCF7; Thu, 12 Dec 2024 08:47:26 +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=1733993246; cv=none; b=dWuDIUT0liOHsWSCrZs68V7OjndVE4Sylj8MemmGHddY17LLn3GiE6j0g7w0KCwaJXA/FG56A9jwi6nSOZmnFbY3uoaFqD2IFtVSAuT65SUPDv3s2uD27tpJNTcExA0jKHpN1xWtqOyicRBUN1cnbPQZPOLL5mOXAfuTj0m4TOo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733993246; c=relaxed/simple; bh=ReOcuWziWEQFCCJQAUurQfV5neoF3l/FqcJT0j3aqF4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CXAhVl0zr5rO+EstLnwK/Z0T1S2AytF/XeuXJkYEnu4wJX1u5KxZhQFrZfaj5sBk9u3a2FY/W4XgtcjceFQwULNIz8ETzVlzOs/cgIXaNEkUtzcDOQlZvC8kbjiIHU2Y8wmy3NfOzoUQQHEsOcFi0zhgexKddmXt5WWy5SZQnhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PJsH8iSL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PJsH8iSL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD098C4CECE; Thu, 12 Dec 2024 08:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733993246; bh=ReOcuWziWEQFCCJQAUurQfV5neoF3l/FqcJT0j3aqF4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PJsH8iSLtYHP8paIZEP4nJ8nTDKr+RtFEDNTXjVNpPCq42ZMvoqqJvcpOfszhO4+2 5q+56DuWg4SGme3LxI0sBsdYw0j/x32/u0c/gWkJfPUk3sl4nRpHe1PXPf31cktN6C ycJ7bYP1Dw9zQAeddLZhw7WIZ2LfeuPVgl8LORlnkJaVEgJdPeDEnlle2whXBTTqRq ayDuf0vzWweUJC34kQDFaAIuOSnAN7cRVoxR7StJNTRNATxu9LxOExmd8ebhsHoM6O UISY6so5QpmKtPUDrtYL4yyt3DEQVTWhA3MIrNyFAdOxmdoEnPoky4HtSJHNdc0edv zEy13QGAmAO8w== Date: Thu, 12 Dec 2024 10:47:21 +0200 From: Leon Romanovsky To: Christoph Hellwig Cc: Jens Axboe , Jason Gunthorpe , Robin Murphy , Joerg Roedel , Will Deacon , Sagi Grimberg , 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: <20241212084721.GH1245331@unreal> References: <20241212084206.GC9376@lst.de> Precedence: bulk X-Mailing-List: kvm@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: <20241212084206.GC9376@lst.de> On Thu, Dec 12, 2024 at 09:42:06AM +0100, Christoph Hellwig wrote: > 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? Sure, will do > > Otherwise looks good: > > Reviewed-by: Christoph Hellwig Thanks a lot.