Linux IOMMU Development
 help / color / mirror / Atom feed
From: William Davis <wdavis-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Konrad Wilk <konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: "corbet-T1hC0tSOHrs@public.gmane.org"
	<corbet-T1hC0tSOHrs@public.gmane.org>,
	John Hubbard <jhubbard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
	"linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org"
	<bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Terence Ripperda
	<TRipperda-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
	<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Subject: RE: [PATCH v5 04/13] DMA-API: Introduce dma_(un)map_peer_resource
Date: Wed, 19 Aug 2015 14:32:28 +0000	[thread overview]
Message-ID: <6dc99896b40345cfbc35b4da9b370bbd@HQMAIL106.nvidia.com> (raw)
In-Reply-To: <2dd0ce48-fb6e-4003-90ee-33827ebfc7c1@default>

> > +#ifdef CONFIG_HAS_DMA_P2P
> > +static inline dma_peer_addr_t dma_map_peer_resource_attrs(struct
> > device *dev,
> > +							  struct device *peer,
> > +							  struct resource *res,
> > +							  size_t offset,
> > +							  size_t size,
> > +							  enum dma_data_direction dir,
> > +							  struct dma_attrs *attrs)
> > +{
> > +	struct dma_map_ops *ops = get_dma_ops(dev);
> > +	dma_peer_addr_t addr;
> > +
> > +	BUG_ON(!valid_dma_direction(dir));
> > +	BUG_ON(ops->map_peer_resource == NULL);
> > +	addr = ops->map_peer_resource(dev, peer, res, offset, size, dir,
> > +				      attrs);
> > +	debug_dma_map_peer_resource(dev, peer, res, offset, size, dir,
> > addr);
> > +
> > +	return addr;
> > +
> 
> With those 'BUG_ON' you need to make sure that every dma_map_ops has
> this implemented. That means the calgary_dma_ops, gart_dma_ops, swiotlb_dma_ops,
> and xen_swiotlb_dma_ops MUST have something implemented.
> 
> Please keep in mind that on one can do 'iommu=soft swiotbl=force' on the
> command line which will force the IOMMUs to be ignored and only the
> SWIOTLB code will be used.

Thanks for the feedback, Konrad. I will add implementations for those
dma_map_ops in v6.

Will

--
nvpublic

  reply	other threads:[~2015-08-19 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 23:26 [PATCH v5 04/13] DMA-API: Introduce dma_(un)map_peer_resource Konrad Wilk
2015-08-19 14:32 ` William Davis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-08-18 19:03 [PATCH v5 00/13] DMA-API/PCI map_peer_resource support for peer-to-peer Will Davis
2015-08-18 19:04 ` [PATCH v5 04/13] DMA-API: Introduce dma_(un)map_peer_resource Will Davis

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=6dc99896b40345cfbc35b4da9b370bbd@HQMAIL106.nvidia.com \
    --to=wdavis-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=TRipperda-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=corbet-T1hC0tSOHrs@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=jglisse-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jhubbard-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=konrad.wilk-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@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