public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Parav Pandit <parav@nvidia.com>,
	Doug Ledford <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH rdma-next] IB/mlx5: Use ib_dma APIs instead of open access to parent device
Date: Tue, 24 Nov 2020 08:58:22 -0400	[thread overview]
Message-ID: <20201124125822.GA4800@nvidia.com> (raw)
In-Reply-To: <20201124052032.GE3159@unreal>

On Tue, Nov 24, 2020 at 07:20:32AM +0200, Leon Romanovsky wrote:
> On Tue, Nov 24, 2020 at 03:34:56AM +0000, Parav Pandit wrote:
> >
> >
> > > From: Jason Gunthorpe <jgg@nvidia.com>
> > > Sent: Monday, November 23, 2020 7:30 PM
> > >
> > > On Mon, Nov 23, 2020 at 10:24:00AM +0200, Leon Romanovsky wrote:
> > > > From: Parav Pandit <parav@nvidia.com>
> > > >
> > > > DMA operation of the IB device is done using ib_device->dma_device.
> > > > This is well abstracted using ib_dma APIs.
> > > >
> > > > Hence, instead of doing open access to parent device, use IB core
> > > > provided dma mapping APIs.
> > >
> > > Why?
> > >
> > > The ib DMA APIs are for people using verbs, they are only needed to pack things
> > > into the ib_sge
> > >
> > > If you are inside a driver, not using the verbs API, or not using ib_sge, then you
> > > should not be using the ib_dma API
> > >
> > Thanks for clarifying this. Using ib_dma apis make the code clear for dma device access clear and explicit.
> >
> > > It is an abberation, we should minimize its use.
> > Alright. In that case will use the pci_dev as mlx5 driver internally has the knowledge of it and avoid using ib_dma APIs.
> 
> Yeah, let's do v2, although I don't understand the purpose of ib_dma
> helpers if ib drivers can't use it.

They are for ULPs, not drivers. Drivers are supposed to know how they
are doing dma mapping already

Jason

  reply	other threads:[~2020-11-24 12:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23  8:24 [PATCH rdma-next] IB/mlx5: Use ib_dma APIs instead of open access to parent device Leon Romanovsky
2020-11-23 13:59 ` Jason Gunthorpe
2020-11-24  3:34   ` Parav Pandit
2020-11-24  5:20     ` Leon Romanovsky
2020-11-24 12:58       ` Jason Gunthorpe [this message]
2020-11-24  9:31 ` Christoph Hellwig
2020-11-24  9:46   ` Leon Romanovsky
2020-11-24  9:49     ` 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=20201124125822.GA4800@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=parav@nvidia.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