Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1226619lqh; Mon, 6 May 2024 00:25:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkOwpti5Rhmxx9aDjIhbqJhwIBCbUh+Xz5+SWjbDXP8bjg5bMK7m9D9jTu2/dIPLRywqyBfY3JdqiVlVC3y2gMMFr595eRNfykQn71qw== X-Google-Smtp-Source: AGHT+IEh2O6ElBq/qZ8JtKzB86dyXztMRFgvluoxMT6xD5mXHxcTAXLra8tYAuwQOWUowCsQ7waU X-Received: by 2002:a05:620a:2846:b0:792:8b34:40af with SMTP id h6-20020a05620a284600b007928b3440afmr7220824qkp.66.1714980325440; Mon, 06 May 2024 00:25:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714980325; cv=pass; d=google.com; s=arc-20160816; b=cG39iVItIiMfU+VsnokKvK2fWRDfey1RG4BrsTyxb4w/m7HIhW8U9ysnCIAXNCJK7S HUrQLLTwWASalw1b2sTkUQ12PNTbG7EGfN5P/esvsUH9+sfD4IbmPdOhp463lg8662EX /2SRM6OSf1anmD9IGHbKh8DM+yUqtZriZtWzqiUbf9PpaJQ0qJ5w2I798ygtlLsoEz4Y EFzP0Q1Bi0w+xfIwEq5gCWXjYo8kz+0AkNz9gwAiPsEQJmu1mlnlx7u6CvGKZPY0HsJo 0tczV5ef+YpJHxeHfBj74EecaWU3EjVtZtuEQwPE51a/rPsZvll8UI5/3NJgvtMqDdW5 +mYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=VNICsQwAZLEIq4FagMWJtT9l3ne94Q3HOggFLnvinbw=; fh=Ky3XtFBmt1pwveGvMTmoYl0llwqpQrKtJP83J77qhqg=; b=cvs1TJZCj48+OJGFxMGJCcGpz9myQ+eI0ftLk4sTqYMg7M84XLkMEBXCNUUyAGIZ7C LkwUNT5CWw9FgwMnMlR3AmX6g196fDPSvIiSntZwGrCZkq+ZOBMx04FaEv8QfzEMQis1 icWW9ARm2V0DsV23aUjg2fJhDb0uppzDe4WnzerxPxWLVt/PfJ+pQ1DQFiTYTgdQXCny oLtEIvIQTiu4akb+xIp7iazs/z1FnnUwdK3WbBOYO/cGWKuJKYvBJgFf4svI0iW1Vj2x aDIg1+oLe8Yu8aB4FpNAn3qAOW2PrX41BYqiOvgrsyYfsdnHjtzlM/39eWm6Bocc1XDO D2/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=nZznPeyz; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-169406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dc36-20020a05620a522400b0078a45519e35si5925219qkb.329.2024.05.06.00.25.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 00:25:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=nZznPeyz; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-169406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1ABA61C210C1 for ; Mon, 6 May 2024 07:25:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C545813FD9E; Mon, 6 May 2024 07:25:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nZznPeyz" Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) (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 55B6274437 for ; Mon, 6 May 2024 07:25:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714980312; cv=none; b=fecHT3ZXRuR6jvZmBmzR8UECB9lw4S1XDe0pnh92Wd8iaIr9r1nyVl9mGKNpvuD+y+75FGDTu1Ndm9se5WyqyQNrUna0tIFa76nDkOhIz6hLBlOkG07OBPz2Qm5YGvdZqeD9x0FGTFpMRowBUPxFBhctWZeh2S3okU5MUtpLKek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714980312; c=relaxed/simple; bh=OVDIWxUDRvlUhkLXJmVPIg7Ss7MCI8rmRJKjNBcIAYc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=n2k/PEmHNZF7+NE5h2oU0KI9cQb87Hk18efP+KOIP87NyXMF/UTHZLUTwhjQidmGz3ScP3RhyFP/9U8wxY+vs1D3pR0oMOPxQCNAV54tALuCm45uFWPBqVuVUmvAaw0NRq+bNoClZIQJACaYKhllRLiAtcKhju064MX4kJx5wPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=nZznPeyz; arc=none smtp.client-ip=95.215.58.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <1615fe92-d4ff-4ef2-9bd0-199aa9e3a426@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714980307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VNICsQwAZLEIq4FagMWJtT9l3ne94Q3HOggFLnvinbw=; b=nZznPeyzXvBnkwuymZAd7H5uP6FsRpvl2JfkIEHhVLGTRXN2z1loonY6p/619WY28zpwEl Bogs2+q+8zcc500vR6DNiQHdd+mPtphq8OjqAyhbN7IEoPG5hcFcOxw9uMk2A927K9UGj9 Kf4xW9Sd1i3DF1NmDYSRbBRBNofkxMI= Date: Mon, 6 May 2024 09:25:01 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC RESEND 16/16] nvme-pci: use blk_rq_dma_map() for NVMe SGL To: Leon Romanovsky 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 , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , 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" References: <016fc02cbfa9be3c156a6f74df38def1e09c08f1.1709635535.git.leon@kernel.org> <20240505132314.GC68202@unreal> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Zhu Yanjun In-Reply-To: <20240505132314.GC68202@unreal> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 05.05.24 15:23, Leon Romanovsky wrote: > 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 a lot. I enlarged this number to 512. It seems that it can work. Hope this will increase the performance. Best Regards, Zhu Yanjun > > Thanks -- Best Regards, Yanjun.Zhu