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 929D16FA8; Sun, 5 May 2024 13:23:19 +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=1714915399; cv=none; b=IqkzMk1GcN7CqAFP/yp6062Bfe7z3tEdwxR4Mj8WmQCAYFIoZT0tmkhUCqVI8D/1nKRuqhnJRg8gv30+Pc/qi2ykxBaF+Dh/CyfI3KCCLyuAYIpB3UwDmO4XM/p67AzvAvEwbTvPlF0cRXYTF5/nLji00/5uEfnM/LjMIBfM83g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714915399; c=relaxed/simple; bh=jjLgkhsN4WjaKTyfGnNOYYnBmrIQeAxiqhWYRqvmHnw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mBO0L2ivwmNd/EFb4BmUz4MqAe7MQgGwQXE26if4JxzQrLXsRkUcpHRcSUv2zML6AUvZsBCGb5n0tqKcj8G64ms1nUs7xstn8sxio8+7WrkPRsM4icbwsobX4aISUHFVl/gwdCWeCtXGHAfJDd2uuAZALNtopQq8MEvUk605u54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N5GHCqgu; 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="N5GHCqgu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5357AC113CC; Sun, 5 May 2024 13:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714915399; bh=jjLgkhsN4WjaKTyfGnNOYYnBmrIQeAxiqhWYRqvmHnw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N5GHCqguzvr4zXSvt+GZwExP+D4+ViMFS5ymKVV8WJY+Di3qvsEp58G9bzM0BAvHF stRLiuNs0tAjzhnbTK/8wL+10XQCHTZHBZmaoU+SwNNRsdc3zzqE5WaLVDQBWFhIvC raDXBTYUnDUM4UtQUw45YXqktzY6vnT/akcSLM5mL4wzzUFTgqPDcpICsM95p6XfvX O4u+h30wrlLfM0mEibSSqU02f0NAECeoPPcaFHr27oYznJKIN+ZSxxnHDgLyJZSjxm mLLAI46IamcYUju5EL6BBITjFGKFCEyP7IgsxkDT4H6bFHDEu7oWOLwbNzfk28/Nrq GrAQIMAtf2uAg== Date: Sun, 5 May 2024 16:23:14 +0300 From: Leon Romanovsky To: Zhu Yanjun Cc: Christoph Hellwig , Robin Murphy , Marek Szyprowski , Joerg Roedel , Will Deacon , Jason Gunthorpe , Chaitanya Kulkarni , Chaitanya Kulkarni , Jonathan Corbet , Jens Axboe , Keith Busch , 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" Subject: Re: [RFC RESEND 16/16] nvme-pci: use blk_rq_dma_map() for NVMe SGL Message-ID: <20240505132314.GC68202@unreal> References: <016fc02cbfa9be3c156a6f74df38def1e09c08f1.1709635535.git.leon@kernel.org> 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: On Fri, May 03, 2024 at 04:41:21PM +0200, Zhu Yanjun wrote: > On 05.03.24 12:18, Leon Romanovsky wrote: > > From: Chaitanya Kulkarni <...> > > This is an RFC to demonstrate the newly added DMA APIs can be used to > > map/unmap bvecs without the use of sg list, hence I've modified the pci > > code to only handle SGLs for now. Once we have some agreement on the > > structure of new DMA API I'll add support for PRPs along with all the > > optimization that I've removed from the code for this RFC for NVMe SGLs > > and PRPs. > > <...> > > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > > index e6267a6aa380..140939228409 100644 > > --- a/drivers/nvme/host/pci.c > > +++ b/drivers/nvme/host/pci.c > > @@ -236,7 +236,9 @@ struct nvme_iod { > > unsigned int dma_len; /* length of single DMA segment mapping */ > > dma_addr_t first_dma; > > dma_addr_t meta_dma; > > - struct sg_table sgt; > > + struct dma_iova_attrs iova; > > + dma_addr_t dma_link_address[128]; > > Why the length of this array is 128? Can we increase this length of the > array? It is combination of two things: * Good enough value for this nvme RFC to pass simple test, which Chaitanya did. * Output of various NVME_CTRL_* defines Thanks