All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shunsuke Mie <mie@igel.co.jp>
To: "Christian König" <christian.koenig@amd.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>, Zhu Yanjun <zyjzyj2000@gmail.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Doug Ledford <dledford@redhat.com>,
	Jianxin Xiong <jianxin.xiong@intel.com>,
	Leon Romanovsky <leon@kernel.org>,
	Maor Gottlieb <maorg@nvidia.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
	linux-media@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-rdma <linux-rdma@vger.kernel.org>,
	Damian Hobson-Garcia <dhobsong@igel.co.jp>,
	Takanari Hayama <taki@igel.co.jp>,
	Tomohito Esaki <etom@igel.co.jp>
Subject: Re: [RFC PATCH v4 0/2] RDMA/rxe: Add dma-buf support
Date: Mon, 13 Dec 2021 20:18:57 +0900	[thread overview]
Message-ID: <CANXvt5rzmEnF3Gph4U6NT-XzJhV6zqyay1g7dHkTgH=Aqc6Geg@mail.gmail.com> (raw)
In-Reply-To: <d25b2895-63b6-158d-ff73-f05e437e0f91@amd.com>

2021年12月10日(金) 22:29 Christian König <christian.koenig@amd.com>:
>
> Am 10.12.21 um 14:26 schrieb Jason Gunthorpe:
> > On Fri, Dec 10, 2021 at 01:47:37PM +0100, Christian König wrote:
> >> Am 10.12.21 um 13:42 schrieb Jason Gunthorpe:
> >>> On Fri, Dec 10, 2021 at 08:29:24PM +0900, Shunsuke Mie wrote:
> >>>> Hi Jason,
> >>>> Thank you for replying.
> >>>>
> >>>> 2021年12月8日(水) 2:14 Jason Gunthorpe <jgg@ziepe.ca>:
> >>>>> On Fri, Dec 03, 2021 at 12:51:44PM +0900, Shunsuke Mie wrote:
> >>>>>> Hi maintainers,
> >>>>>>
> >>>>>> Could you please review this patch series?
> >>>>> Why is it RFC?
> >>>>>
> >>>>> I'm confused why this is useful?
> >>>>>
> >>>>> This can't do copy from MMIO memory, so it shouldn't be compatible
> >>>>> with things like Gaudi - does something prevent this?
> >>>> I think if an export of the dma-buf supports vmap, CPU is able to access the
> >>>> mmio memory.
> >>>>
> >>>> Is it wrong? If this is wrong, there is no advantages this changes..
> >>> I don't know what the dmabuf folks did, but yes, it is wrong.
> >>>
> >>> IOMEM must be touched using only special accessors, some platforms
> >>> crash if you don't do this. Even x86 will crash if you touch it with
> >>> something like an XMM optimized memcpy.
> >>>
> >>> Christian? If the vmap succeeds what rules must the caller use to
> >>> access the memory?
> >> See dma-buf-map.h and especially struct dma_buf_map.
> >>
> >> MMIO memory is perfectly supported here and actually the most common case.
> > Okay that looks sane, but this rxe RFC seems to ignore this
> > completely. It stuffs the vaddr directly into a umem which goes to all
> > manner of places in the driver.
> >
> > ??
>
> Well, yes that can go boom pretty quickly.
Sorry, I was wrong. The dma_buf_map treats both iomem and vaddr region, but
this RFC only supports vaddr. Advantage of the partial support is we can use the
vaddr dma-buf in RXE without changing a rxe data copy implementation.

An example of a dma-buf pointing to a vaddr is some gpu drivers use RAM for
VRAM and we can get dma-buf for the region that indicates vaddr regions.
Specifically, the gpu driver using gpu/drm/drm_gem_cma_helper.c is one such
example.

> Not sure what they want to use this for.
I'd like to use RDMA with RXE for that memory region.

Best,
Shunsuke
> Christian.
>
> >
> > Jason
>

WARNING: multiple messages have this Message-ID (diff)
From: Shunsuke Mie <mie@igel.co.jp>
To: "Christian König" <christian.koenig@amd.com>
Cc: Damian Hobson-Garcia <dhobsong@igel.co.jp>,
	Takanari Hayama <taki@igel.co.jp>,
	Leon Romanovsky <leon@kernel.org>,
	linux-rdma <linux-rdma@vger.kernel.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel@lists.freedesktop.org, Tomohito Esaki <etom@igel.co.jp>,
	linaro-mm-sig@lists.linaro.org, Jason Gunthorpe <jgg@ziepe.ca>,
	Doug Ledford <dledford@redhat.com>,
	Zhu Yanjun <zyjzyj2000@gmail.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Maor Gottlieb <maorg@nvidia.com>,
	Jianxin Xiong <jianxin.xiong@intel.com>,
	linux-media@vger.kernel.org
Subject: Re: [RFC PATCH v4 0/2] RDMA/rxe: Add dma-buf support
Date: Mon, 13 Dec 2021 20:18:57 +0900	[thread overview]
Message-ID: <CANXvt5rzmEnF3Gph4U6NT-XzJhV6zqyay1g7dHkTgH=Aqc6Geg@mail.gmail.com> (raw)
In-Reply-To: <d25b2895-63b6-158d-ff73-f05e437e0f91@amd.com>

2021年12月10日(金) 22:29 Christian König <christian.koenig@amd.com>:
>
> Am 10.12.21 um 14:26 schrieb Jason Gunthorpe:
> > On Fri, Dec 10, 2021 at 01:47:37PM +0100, Christian König wrote:
> >> Am 10.12.21 um 13:42 schrieb Jason Gunthorpe:
> >>> On Fri, Dec 10, 2021 at 08:29:24PM +0900, Shunsuke Mie wrote:
> >>>> Hi Jason,
> >>>> Thank you for replying.
> >>>>
> >>>> 2021年12月8日(水) 2:14 Jason Gunthorpe <jgg@ziepe.ca>:
> >>>>> On Fri, Dec 03, 2021 at 12:51:44PM +0900, Shunsuke Mie wrote:
> >>>>>> Hi maintainers,
> >>>>>>
> >>>>>> Could you please review this patch series?
> >>>>> Why is it RFC?
> >>>>>
> >>>>> I'm confused why this is useful?
> >>>>>
> >>>>> This can't do copy from MMIO memory, so it shouldn't be compatible
> >>>>> with things like Gaudi - does something prevent this?
> >>>> I think if an export of the dma-buf supports vmap, CPU is able to access the
> >>>> mmio memory.
> >>>>
> >>>> Is it wrong? If this is wrong, there is no advantages this changes..
> >>> I don't know what the dmabuf folks did, but yes, it is wrong.
> >>>
> >>> IOMEM must be touched using only special accessors, some platforms
> >>> crash if you don't do this. Even x86 will crash if you touch it with
> >>> something like an XMM optimized memcpy.
> >>>
> >>> Christian? If the vmap succeeds what rules must the caller use to
> >>> access the memory?
> >> See dma-buf-map.h and especially struct dma_buf_map.
> >>
> >> MMIO memory is perfectly supported here and actually the most common case.
> > Okay that looks sane, but this rxe RFC seems to ignore this
> > completely. It stuffs the vaddr directly into a umem which goes to all
> > manner of places in the driver.
> >
> > ??
>
> Well, yes that can go boom pretty quickly.
Sorry, I was wrong. The dma_buf_map treats both iomem and vaddr region, but
this RFC only supports vaddr. Advantage of the partial support is we can use the
vaddr dma-buf in RXE without changing a rxe data copy implementation.

An example of a dma-buf pointing to a vaddr is some gpu drivers use RAM for
VRAM and we can get dma-buf for the region that indicates vaddr regions.
Specifically, the gpu driver using gpu/drm/drm_gem_cma_helper.c is one such
example.

> Not sure what they want to use this for.
I'd like to use RDMA with RXE for that memory region.

Best,
Shunsuke
> Christian.
>
> >
> > Jason
>

  reply	other threads:[~2021-12-13 11:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 11:08 [RFC PATCH v4 0/2] RDMA/rxe: Add dma-buf support Shunsuke Mie
2021-11-22 11:08 ` Shunsuke Mie
2021-11-22 11:08 ` [RFC PATCH v4 1/2] RDMA/umem: Change for rdma devices has not dma device Shunsuke Mie
2021-11-22 11:08   ` Shunsuke Mie
2021-11-22 11:08 ` [RFC PATCH v4 2/2] RDMA/rxe: Add dma-buf support Shunsuke Mie
2021-11-22 11:08   ` Shunsuke Mie
2021-12-03  3:51 ` [RFC PATCH v4 0/2] " Shunsuke Mie
2021-12-03  3:51   ` Shunsuke Mie
2021-12-07 17:14   ` Jason Gunthorpe
2021-12-07 17:14     ` Jason Gunthorpe
2021-12-10 11:29     ` Shunsuke Mie
2021-12-10 11:29       ` Shunsuke Mie
2021-12-10 12:42       ` Jason Gunthorpe
2021-12-10 12:42         ` Jason Gunthorpe
2021-12-10 12:47         ` Christian König
2021-12-10 12:47           ` Christian König
2021-12-10 13:26           ` Jason Gunthorpe
2021-12-10 13:26             ` Jason Gunthorpe
2021-12-10 13:28             ` Christian König
2021-12-10 13:28               ` Christian König
2021-12-13 11:18               ` Shunsuke Mie [this message]
2021-12-13 11:18                 ` Shunsuke Mie
2021-12-14  8:53                 ` Christian König
2021-12-14  8:53                   ` Christian König
2021-12-14  9:02                   ` Shunsuke Mie
2021-12-14  9:02                     ` Shunsuke Mie
2021-12-20  9:31             ` Daniel Vetter
2021-12-20  9:31               ` Daniel Vetter

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='CANXvt5rzmEnF3Gph4U6NT-XzJhV6zqyay1g7dHkTgH=Aqc6Geg@mail.gmail.com' \
    --to=mie@igel.co.jp \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dhobsong@igel.co.jp \
    --cc=dledford@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etom@igel.co.jp \
    --cc=jgg@ziepe.ca \
    --cc=jianxin.xiong@intel.com \
    --cc=leon@kernel.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=sean.hefty@intel.com \
    --cc=sumit.semwal@linaro.org \
    --cc=taki@igel.co.jp \
    --cc=zyjzyj2000@gmail.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 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.