From: "Björn Töpel" <bjorn.topel@intel.com>
To: Robin Murphy <robin.murphy@arm.com>,
Christoph Hellwig <hch@lst.de>,
Daniel Borkmann <daniel@iogearbox.net>
Cc: maximmi@mellanox.com, konrad.wilk@oracle.com,
jonathan.lemon@gmail.com, linux-kernel@vger.kernel.org,
iommu@lists.linux-foundation.org, netdev@vger.kernel.org,
bpf@vger.kernel.org, davem@davemloft.net,
magnus.karlsson@intel.com
Subject: Re: [PATCH net] xsk: remove cheap_dma optimization
Date: Wed, 1 Jul 2020 12:17:50 +0200 [thread overview]
Message-ID: <b8e1ef0d-20ae-0ea1-3c29-fc8db96e2afb@intel.com> (raw)
In-Reply-To: <878626a2-6663-0d75-6339-7b3608aa4e42@arm.com>
On 2020-06-29 17:41, Robin Murphy wrote:
> On 2020-06-28 18:16, Björn Töpel wrote:
[...]>
>> Somewhat related to the DMA API; It would have performance benefits for
>> AF_XDP if the DMA range of the mapped memory was linear, i.e. by IOMMU
>> utilization. I've started hacking a thing a little bit, but it would be
>> nice if such API was part of the mapping core.
>>
>> Input: array of pages Output: array of dma addrs (and obviously dev,
>> flags and such)
>>
>> For non-IOMMU len(array of pages) == len(array of dma addrs)
>> For best-case IOMMU len(array of dma addrs) == 1 (large linear space)
>>
>> But that's for later. :-)
>
> FWIW you will typically get that behaviour from IOMMU-based
> implementations of dma_map_sg() right now, although it's not strictly
> guaranteed. If you can weather some additional setup cost of calling
> sg_alloc_table_from_pages() plus walking the list after mapping to test
> whether you did get a contiguous result, you could start taking
> advantage of it as some of the dma-buf code in DRM and v4l2 does already
> (although those cases actually treat it as a strict dependency rather
> than an optimisation).
>
> I'm inclined to agree that if we're going to see more of these cases, a
> new API call that did formally guarantee a DMA-contiguous mapping
> (either via IOMMU or bounce buffering) or failure might indeed be handy.
>
I forgot to reply to this one! My current hack is using the iommu code
directly, similar to what vfio-pci does (hopefully not gutting the API
this time ;-)).
Your approach sound much nicer, and easier. I'll try that out! Thanks a
lot for the pointers, and I might be back with more questions.
Cheers,
Björn
> Robin.
next prev parent reply other threads:[~2020-07-01 10:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 13:43 [PATCH net] xsk: remove cheap_dma optimization Björn Töpel
2020-06-26 20:44 ` Jonathan Lemon
2020-06-26 23:00 ` Daniel Borkmann
2020-06-27 7:04 ` Christoph Hellwig
2020-06-28 17:16 ` Björn Töpel
2020-06-29 13:52 ` Daniel Borkmann
2020-06-29 15:10 ` Björn Töpel
2020-06-29 15:18 ` Daniel Borkmann
2020-06-29 16:23 ` Björn Töpel
2020-06-30 5:07 ` Christoph Hellwig
2020-06-30 13:47 ` Daniel Borkmann
2020-06-29 15:41 ` Robin Murphy
2020-07-01 10:17 ` Björn Töpel [this message]
2020-07-08 6:50 ` Christoph Hellwig
2020-07-08 7:57 ` Song Bao Hua (Barry Song)
2020-07-08 12:19 ` Christoph Hellwig
2020-07-08 13:18 ` Robin Murphy
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=b8e1ef0d-20ae-0ea1-3c29-fc8db96e2afb@intel.com \
--to=bjorn.topel@intel.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=jonathan.lemon@gmail.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=magnus.karlsson@intel.com \
--cc=maximmi@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=robin.murphy@arm.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).