From mboxrd@z Thu Jan 1 00:00:00 1970 From: Logan Gunthorpe Subject: Re: [RFC 6/8] nvmet: Be careful about using iomem accesses when dealing with p2pmem Date: Tue, 4 Apr 2017 11:21:58 -0600 Message-ID: References: <1490911959-5146-1-git-send-email-logang@deltatee.com> <1490911959-5146-7-git-send-email-logang@deltatee.com> <080b68b4-eba3-861c-4f29-5d829425b5e7@grimberg.me> <20170404154629.GA13552@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170404154629.GA13552-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: Jason Gunthorpe , Sagi Grimberg Cc: Jens Axboe , "James E.J. Bottomley" , linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Martin K. Petersen" , linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Steve Wise , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Keith Busch , linux-nvdimm-y27Ovi1pjclAfugRpC6u6w@public.gmane.org, Max Gurtovoy , Christoph Hellwig List-Id: linux-nvdimm@lists.01.org On 04/04/17 04:59 AM, Sagi Grimberg wrote: > We can never ever get here from an IO command, and that is a good thing > because it would have been broken if we did, regardless of what copy > method we use... Yes, I changed this mostly for admin commands. I did notice connect commands do end up reading from the p2mem and this patchset correctly switches it to iomemcpy. However, based on Cristoph's comment, I hope to make it more general such that iomem is hidden within sgls and any access will either be correct or create a warning. On 04/04/17 09:46 AM, Jason Gunthorpe wrote: > Transactions might not complete at the NVMe device before the CPU > processes the RDMA completion, however due to the PCI-E ordering rules > new TLPs directed to the NVMe will complete after the RMDA TLPs and > thus observe the new data. (eg order preserving) > > It would be very hard to use P2P if fabric ordering is not preserved.. Yes, my understanding is the same, the PCI-E ordering rules save us here. Thanks, Logan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932194AbdDDRWG (ORCPT ); Tue, 4 Apr 2017 13:22:06 -0400 Received: from ale.deltatee.com ([207.54.116.67]:59642 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754853AbdDDRWD (ORCPT ); Tue, 4 Apr 2017 13:22:03 -0400 To: Jason Gunthorpe , Sagi Grimberg References: <1490911959-5146-1-git-send-email-logang@deltatee.com> <1490911959-5146-7-git-send-email-logang@deltatee.com> <080b68b4-eba3-861c-4f29-5d829425b5e7@grimberg.me> <20170404154629.GA13552@obsidianresearch.com> Cc: Christoph Hellwig , "James E.J. Bottomley" , "Martin K. Petersen" , Jens Axboe , Steve Wise , Stephen Bates , Max Gurtovoy , Dan Williams , Keith Busch , linux-pci@vger.kernel.org, linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@ml01.01.org, linux-kernel@vger.kernel.org From: Logan Gunthorpe Message-ID: Date: Tue, 4 Apr 2017 11:21:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170404154629.GA13552@obsidianresearch.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-nvdimm@ml01.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org, keith.busch@intel.com, dan.j.williams@intel.com, maxg@mellanox.com, sbates@raithlin.com, swise@opengridcomputing.com, axboe@kernel.dk, martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, hch@lst.de, sagi@grimberg.me, jgunthorpe@obsidianresearch.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [RFC 6/8] nvmet: Be careful about using iomem accesses when dealing with p2pmem X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04/17 04:59 AM, Sagi Grimberg wrote: > We can never ever get here from an IO command, and that is a good thing > because it would have been broken if we did, regardless of what copy > method we use... Yes, I changed this mostly for admin commands. I did notice connect commands do end up reading from the p2mem and this patchset correctly switches it to iomemcpy. However, based on Cristoph's comment, I hope to make it more general such that iomem is hidden within sgls and any access will either be correct or create a warning. On 04/04/17 09:46 AM, Jason Gunthorpe wrote: > Transactions might not complete at the NVMe device before the CPU > processes the RDMA completion, however due to the PCI-E ordering rules > new TLPs directed to the NVMe will complete after the RMDA TLPs and > thus observe the new data. (eg order preserving) > > It would be very hard to use P2P if fabric ordering is not preserved.. Yes, my understanding is the same, the PCI-E ordering rules save us here. Thanks, Logan From mboxrd@z Thu Jan 1 00:00:00 1970 From: logang@deltatee.com (Logan Gunthorpe) Date: Tue, 4 Apr 2017 11:21:58 -0600 Subject: [RFC 6/8] nvmet: Be careful about using iomem accesses when dealing with p2pmem In-Reply-To: <20170404154629.GA13552@obsidianresearch.com> References: <1490911959-5146-1-git-send-email-logang@deltatee.com> <1490911959-5146-7-git-send-email-logang@deltatee.com> <080b68b4-eba3-861c-4f29-5d829425b5e7@grimberg.me> <20170404154629.GA13552@obsidianresearch.com> Message-ID: On 04/04/17 04:59 AM, Sagi Grimberg wrote: > We can never ever get here from an IO command, and that is a good thing > because it would have been broken if we did, regardless of what copy > method we use... Yes, I changed this mostly for admin commands. I did notice connect commands do end up reading from the p2mem and this patchset correctly switches it to iomemcpy. However, based on Cristoph's comment, I hope to make it more general such that iomem is hidden within sgls and any access will either be correct or create a warning. On 04/04/17 09:46 AM, Jason Gunthorpe wrote: > Transactions might not complete at the NVMe device before the CPU > processes the RDMA completion, however due to the PCI-E ordering rules > new TLPs directed to the NVMe will complete after the RMDA TLPs and > thus observe the new data. (eg order preserving) > > It would be very hard to use P2P if fabric ordering is not preserved.. Yes, my understanding is the same, the PCI-E ordering rules save us here. Thanks, Logan