Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4200135imm; Wed, 5 Sep 2018 12:21:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYOEwVF0UWhlMa3rS98WDQcBn6IKL9QyNycdH+wMKzVklhAuSfmeFnIMBJrCHjeCTcyaoxG X-Received: by 2002:a63:c245:: with SMTP id l5-v6mr38418854pgg.255.1536175277061; Wed, 05 Sep 2018 12:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536175277; cv=none; d=google.com; s=arc-20160816; b=X3EdlhTo+wvm4qOThQQ7N87bs+UyTvT2iW9PeuBzvkYDbUtqU4FUEpHYO+tBCRaMUT ES5y5XpGKYlDBLUrYV1KQXDQhNU1XJ/9TSp03DF6tTaQX3qRT33FAeY0EvRT2tHCYa2H dGVxzrOWKdeIIyKFoeQz49FLV29VbeKa3oJTv/PKJAxYvVb8MxW5XkK8KenGf7bX4PYE b43jmEBcl6S1crSFcck3DnCRLp4WHYkC2sImwkdgS1HuQoJgajDrJKjD428EXG/i/xYO JbnpF1iEjjOWfAMCNsVnhXY9e5fe7rtzK9EvdnCRng1wTSXUPurlRW/98AeWIqoTdFtU A7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=BpSC1fOzNszN+Gq9pKVrqWx76B1wKRgZyTmoOq/8xNo=; b=QGMVgiax75Aqem16Pa6DPS2amUuxsgIj5STVIIOdiQxlB79/LnTkDjJPeYE0qt4AO9 uD/2IGtTeD135mnf3nMjtV+RPtDhbpYVNkCaHP3Cognfmu0zlcrAx0nUx1ilwBQzMdSi GkDqBdi28D8Py4QeJW9fCOL4zao+/Jd+qK9crD1Y0UFa8Bbbst4ZPl8VWA8cTcEd4DRA ncYqA7dPTKNv2GRxjDKG9ClvdBOq0vPPwOhewtVVLO85XiastbYpIYMmMO3HWeQPQzDx AfDt2VhDzscoiXR6+idt9c06p+K8oS5+w331iioprWWsB5gbMh0UuJVHYtiimfKC7duu lJBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v21-v6si2675787plo.397.2018.09.05.12.20.59; Wed, 05 Sep 2018 12:21:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727785AbeIEXus (ORCPT + 99 others); Wed, 5 Sep 2018 19:50:48 -0400 Received: from verein.lst.de ([213.95.11.211]:46885 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726544AbeIEXus (ORCPT ); Wed, 5 Sep 2018 19:50:48 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id CA17368D40; Wed, 5 Sep 2018 21:22:52 +0200 (CEST) Date: Wed, 5 Sep 2018 21:22:52 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Max Gurtovoy , Dan Williams , =?iso-8859-1?B?Suly9G1l?= Glisse , Benjamin Herrenschmidt , Alex Williamson , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH v5 10/13] nvme-pci: Add support for P2P memory in requests Message-ID: <20180905192252.GA888@lst.de> References: <20180830185352.3369-1-logang@deltatee.com> <20180830185352.3369-11-logang@deltatee.com> <20180904151638.GL335@mellanox.com> 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 04, 2018 at 09:47:07AM -0600, Logan Gunthorpe wrote: > > > On 04/09/18 09:16 AM, Jason Gunthorpe wrote: > >> if (iod->nents) { > >> - dma_unmap_sg(dev->dev, iod->sg, iod->nents, dma_dir); > >> + /* P2PDMA requests do not need to be unmapped */ > >> + if (!is_pci_p2pdma_page(sg_page(iod->sg))) > >> + dma_unmap_sg(dev->dev, iod->sg, iod->nents, dma_dir); > > > > This seems like a poor direction, if we add IOMMU hairpin support we > > will need unmapping. > > It can always be added later. In any case, you'll have to convince > Christoph who requested the change; I'm not that invested in this decision. Yes, no point to add dead code here. In the long run we should aim for hiding the p2p address translation behind the normal DMA API anyway, but we're not quite ready for it yet.