[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1484692382.2729.23.camel@sandisk.com>
Date: Tue, 17 Jan 2017 22:33:16 +0000
From: Bart Van Assche <Bart.VanAssche@...disk.com>
To: "jgunthorpe@...idianresearch.com" <jgunthorpe@...idianresearch.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"alex.estrin@...el.com" <alex.estrin@...el.com>,
"dledford@...hat.com" <dledford@...hat.com>
Subject: Re: [PATCH v2 00/26] IB: Optimize DMA mapping
On Tue, 2017-01-17 at 15:27 -0700, Jason Gunthorpe wrote:
> On Tue, Jan 17, 2017 at 10:00:00PM +0000, Bart Van Assche wrote:
> > + /*
> > + * qib and hfi1 use two sets of DMA operations:
> > + * - The DMA operations of the PCIe device for SDMA.
> > + * - dma_virt_ops for users of the qib and hfi1 drivers.
> > + * The only purpose of @dma_device is to provide a struct device that
> > + * provides dma_virt_ops.
> > + */
> > + struct device dma_device;
>
> Creating a struct device, not calling device_initialize() and then
> passing it around it other places is pretty ugly and potentially
> dangerous.
>
> Is there some other way?
>
> Can you setup ibdev to be the 'dma device' for the user side?
Hello Jason,
The only member of this struct device that is used is dma_ops so this approach
should be fine as an interim solution. My plan is, if this patch is sufficient
to unbreak the hfi1 driver, to remove the struct device cited in your e-mail
again and also the dma_device pointer from struct ib_device. Since the
dev.dma_ops pointer in struct ib_device is not yet used dev.dma_ops can be used
instead of the dma_device pointer.
Bart.
Powered by blists - more mailing lists