linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: Logan Gunthorpe <logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: "Jens Axboe" <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
	"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Benjamin Herrenschmidt"
	<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>,
	"Alex Williamson"
	<alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Jérôme Glisse" <jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Jason Gunthorpe" <jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"Bjorn Helgaas"
	<bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	"Max Gurtovoy" <maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"Christoph Hellwig" <hch-jcswGhMUV9g@public.gmane.org>
Subject: Re: [PATCH v7 03/13] PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset
Date: Tue, 25 Sep 2018 10:33:25 -0700	[thread overview]
Message-ID: <1537896805.11137.25.camel@acm.org> (raw)
In-Reply-To: <20180925162231.4354-4-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>

On Tue, 2018-09-25 at 10:22 -0600, Logan Gunthorpe wrote:
> +int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
> +		      enum dma_data_direction dir)
> +{
> +	struct dev_pagemap *pgmap;
> +	struct scatterlist *s;
> +	phys_addr_t paddr;
> +	int i;
> +
> +	/*
> +	 * p2pdma mappings are not compatible with devices that use
> +	 * dma_virt_ops. If the upper layers do the right thing
> +	 * this should never happen because it will be prevented
> +	 * by the check in pci_p2pdma_add_client()
> +	 */
> +	if (WARN_ON_ONCE(IS_ENABLED(CONFIG_DMA_VIRT_OPS) &&
> +			 dev->dma_ops == &dma_virt_ops))
> +		return 0;

Are you assuming that the compiler will optimize out the dev->dma_ops
== &dma_virt_ops test if CONFIG_DMA_VIRT_OPS=n such that no reference to the
dma_virt_ops symbol appears in the object file? Are you sure all compilers
and compiler versions that are used to build the Linux kernel will do that?

Thanks,

Bart.

  parent reply	other threads:[~2018-09-25 17:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 16:22 [PATCH v7 00/13] Copy Offload in NVMe Fabrics with P2P PCI Memory Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 06/13] PCI/P2PDMA: Add P2P DMA driver writer's documentation Logan Gunthorpe
     [not found] ` <20180925162231.4354-1-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 16:22   ` [PATCH v7 01/13] PCI/P2PDMA: Support peer-to-peer memory Logan Gunthorpe
     [not found]     ` <20180925162231.4354-2-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 17:25       ` Bart Van Assche
     [not found]         ` <1537896340.11137.19.camel-HInyCGIudOg@public.gmane.org>
2018-09-25 18:09           ` Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 02/13] PCI/P2PDMA: Add sysfs group to display p2pmem stats Logan Gunthorpe
     [not found]     ` <20180925162231.4354-3-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 17:29       ` Bart Van Assche
     [not found]         ` <1537896555.11137.22.camel-HInyCGIudOg@public.gmane.org>
2018-09-25 18:15           ` Logan Gunthorpe
     [not found]             ` <9241a6af-9826-d1ff-c13b-882cb3b6a34a-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 18:31               ` Bart Van Assche
2018-09-25 18:51                 ` Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 03/13] PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset Logan Gunthorpe
     [not found]     ` <20180925162231.4354-4-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 17:33       ` Bart Van Assche [this message]
     [not found]         ` <1537896805.11137.25.camel-HInyCGIudOg@public.gmane.org>
2018-09-25 18:46           ` Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 04/13] PCI/P2PDMA: Introduce configfs/sysfs enable attribute helpers Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 05/13] docs-rst: Add a new directory for PCI documentation Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 07/13] block: Add PCI P2P flag for request queue and check support for requests Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 08/13] IB/core: Ensure we map P2P memory correctly in rdma_rw_ctx_[init|destroy]() Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 09/13] nvme-pci: Use PCI p2pmem subsystem to manage the CMB Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 10/13] nvme-pci: Add support for P2P memory in requests Logan Gunthorpe
     [not found]     ` <20180925162231.4354-11-logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 17:11       ` Keith Busch
     [not found]         ` <20180925171147.GB11822-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2018-09-25 17:41           ` Logan Gunthorpe
     [not found]             ` <3549a9bb-3604-1739-c008-4e1a95441333-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
2018-09-25 17:48               ` Keith Busch
2018-09-25 16:22   ` [PATCH v7 11/13] nvme-pci: Add a quirk for a pseudo CMB Logan Gunthorpe
2018-09-25 16:22   ` [PATCH v7 12/13] nvmet: Introduce helper functions to allocate and free request SGLs Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 13/13] nvmet: Optionally use PCI P2P memory Logan Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537896805.11137.25.camel@acm.org \
    --to=bvanassche-hinycgiudog@public.gmane.org \
    --cc=alex.williamson-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=jgg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org \
    --cc=maxg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).