linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Christoph Hellwig <hch@infradead.org>
Cc: Sam Bobroff <sbobroff@linux.ibm.com>,
	Alistair Popple <alistair@popple.id.au>,
	Oliver O'Halloran <oohall@gmail.com>,
	linuxppc-dev@lists.ozlabs.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH kernel v4 0/4 repost] powerpc/ioda2: Yet another attempt to allow DMA masks between 32 and 59
Date: Mon, 15 Jul 2019 18:43:12 +1000	[thread overview]
Message-ID: <44fe9d2e-0793-13f9-e0eb-4ff649e229a5@ozlabs.ru> (raw)
In-Reply-To: <20190712152800.GC3061@infradead.org>



On 13/07/2019 01:28, Christoph Hellwig wrote:
> On Fri, Jul 12, 2019 at 07:45:05PM +1000, Alexey Kardashevskiy wrote:
>> This is an attempt to allow DMA masks between 32..59 which are not large
>> enough to use either a PHB3 bypass mode or a sketchy bypass. Depending
>> on the max order, up to 40 is usually available.
> 
> Can you elaborate what you man with supported in detail?  In the end
> a DMA devices DMA capability is only really interesting as a lower
> bound.
> 
> e.g. if you have a DMA that supports 40-bit DMA addressing we could
> always treat it as if supports 32-bit addressing,and I thought the
> powerpc code does that, 

powerpc does that and this is what the patchset is changing as people 
complained that 2GB DMA window has bad effects on AMD GPUs (cannot 
allocate enough buffers) and 40/100Gbit devices (lower performance), I 
do not have the details handy.

> as the DMA API now relies on that.

Relies on what precisely? If a device cannot do full 64bit, then it has 
to be no more than just 32bit?


>  Did I miss
> something and it explicitly rejected that (in which case I didn't spot
> the fix in this series), or is this just an optimization to handle these
> devices more optimally, in which case maybe the changelog could be
> improved a bit.


4/4 did this essentially:

-	const u64 window_size = min((u64)pe->table_group.tce32_size, max_memory);
+	const u64 maxblock = 1UL << (PAGE_SHIFT + MAX_ORDER - 1);
+	const u64 window_size = min((maxblock * 8) << PAGE_SHIFT, max_memory);

where tce32_size==2<<30. The 4/4 commit log has the details, what is 
missing there? Thanks,



-- 
Alexey

  reply	other threads:[~2019-07-15  8:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  9:45 [PATCH kernel v4 0/4 repost] powerpc/ioda2: Yet another attempt to allow DMA masks between 32 and 59 Alexey Kardashevskiy
2019-07-12  9:45 ` [PATCH kernel v4 1/4] powerpc/powernv/ioda: Fix race in TCE level allocation Alexey Kardashevskiy
2019-07-12  9:45 ` [PATCH kernel v4 2/4] powerpc/iommu: Allow bypass-only for DMA Alexey Kardashevskiy
2019-07-12 15:20   ` Christoph Hellwig
2019-07-15  8:33     ` Alexey Kardashevskiy
2019-07-15 12:35       ` Christoph Hellwig
2019-07-12  9:45 ` [PATCH kernel v4 3/4] powerpc/powernv/ioda2: Allocate TCE table levels on demand for default DMA window Alexey Kardashevskiy
2019-07-12  9:45 ` [PATCH kernel v4 4/4] powerpc/powernv/ioda2: Create bigger default window with 64k IOMMU pages Alexey Kardashevskiy
2019-07-12 15:25   ` Christoph Hellwig
2019-07-12 15:28 ` [PATCH kernel v4 0/4 repost] powerpc/ioda2: Yet another attempt to allow DMA masks between 32 and 59 Christoph Hellwig
2019-07-15  8:43   ` Alexey Kardashevskiy [this message]
2019-07-15 12:39     ` Christoph Hellwig

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=44fe9d2e-0793-13f9-e0eb-4ff649e229a5@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=alistair@popple.id.au \
    --cc=david@gibson.dropbear.id.au \
    --cc=hch@infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    --cc=sbobroff@linux.ibm.com \
    /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).