All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: "Michael S. Tsirkin" <mst@dev.mellanox.co.il>
Cc: Lukas Hejtmanek <xhejtman@ics.muni.cz>,
	xen-devel@lists.xensource.com, Keir Fraser <keir@xensource.com>,
	general@lists.openfabrics.org
Subject: [ofa-general] Re: mthca use of dma_sync_single is bogus
Date: Mon, 09 Jul 2007 23:48:06 -0700	[thread overview]
Message-ID: <adamyy4vjo9.fsf@cisco.com> (raw)
In-Reply-To: <20070709213913.GB20052@mellanox.co.il> (Michael S. Tsirkin's message of "Tue, 10 Jul 2007 00:39:13 +0300")

 > >     void
 > >     dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
 > >     		      unsigned long offset, size_t size,
 > >     		      enum dma_data_direction direction)

 > This is under Part II - Advanced dma_ usage - I don't think it's dealing with
 > non-consistent memory only (e.g. dma_declare_coherent_memory is there), and this
 > looks like a good fit.  Most functions here work for both consistent and
 > non-consistent memory...  What makes you suspicious?

I was suspicious because it is described between the main noncoherent
API stuff and dma_cache_sync().  But I think it is probably OK.

Unfortunately it is not that good a fit for our current code, since we
use pci_map_sg() to do the DMA mapping on the MTT memory instead of
dma_map_single().

 > I'm concerned that MTTs need a fair amount of memory,
 > while the amount of coherent memory might be limited.
 > Not that non-coherent memory systems are widespread ...

Yes, for example on ppc 4xx the amount of coherent memory is quite
small by default (address space for non-cached mappings is actually
what is limited, but it amounts to the same thing).

Maybe the least bad solution is to change to using dma_map_single()
instead of pci_map_sg() in mthca_memfree.c.

 - R.

  reply	other threads:[~2007-07-10  6:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 21:16 [ofa-general] mthca use of dma_sync_single is bogus Roland Dreier
2007-07-09 21:29 ` Roland Dreier
2007-07-09 21:36   ` Keir Fraser
2007-07-09 21:31 ` [ofa-general] " Keir Fraser
2007-07-09 21:31   ` Roland Dreier
2007-07-09 21:39 ` Michael S. Tsirkin
2007-07-10  6:48   ` Roland Dreier [this message]
2007-07-10  7:15     ` Michael S. Tsirkin
2007-07-10 15:33       ` Roland Dreier
2007-07-10 17:11         ` Michael S. Tsirkin
2007-07-10 18:09           ` Roland Dreier
2007-07-10 18:30             ` Michael S. Tsirkin
2007-07-10 19:25               ` Roland Dreier
2007-07-18 13:36                 ` Michael S. Tsirkin
2007-07-18 15:12                   ` Roland Dreier
2007-07-10 14:14     ` Lukas Hejtmanek
2007-07-10 18:06       ` Roland Dreier
2007-07-10 19:00         ` Lukas Hejtmanek
2007-07-10 19:08           ` Roland Dreier
2007-07-10 19:16             ` Lukas Hejtmanek
2007-07-10 19:24               ` Roland Dreier
2007-07-10 19:36                 ` Lukas Hejtmanek

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=adamyy4vjo9.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=general@lists.openfabrics.org \
    --cc=keir@xensource.com \
    --cc=mst@dev.mellanox.co.il \
    --cc=xen-devel@lists.xensource.com \
    --cc=xhejtman@ics.muni.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.