[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200226171905.GS26318@mellanox.com>
Date: Wed, 26 Feb 2020 13:19:05 -0400
From: Jason Gunthorpe <jgg@...lanox.com>
To: Jason Wang <jasowang@...hat.com>
Cc: "mst@...hat.com" <mst@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"tiwei.bie@...el.com" <tiwei.bie@...el.com>,
"maxime.coquelin@...hat.com" <maxime.coquelin@...hat.com>,
"cunming.liang@...el.com" <cunming.liang@...el.com>,
"zhihong.wang@...el.com" <zhihong.wang@...el.com>,
"rob.miller@...adcom.com" <rob.miller@...adcom.com>,
"xiao.w.wang@...el.com" <xiao.w.wang@...el.com>,
"haotian.wang@...ive.com" <haotian.wang@...ive.com>,
"lingshan.zhu@...el.com" <lingshan.zhu@...el.com>,
"eperezma@...hat.com" <eperezma@...hat.com>,
"lulu@...hat.com" <lulu@...hat.com>,
Parav Pandit <parav@...lanox.com>,
"kevin.tian@...el.com" <kevin.tian@...el.com>,
"stefanha@...hat.com" <stefanha@...hat.com>,
"rdunlap@...radead.org" <rdunlap@...radead.org>,
"hch@...radead.org" <hch@...radead.org>,
"aadam@...hat.com" <aadam@...hat.com>,
Jiri Pirko <jiri@...lanox.com>,
Shahaf Shuler <shahafs@...lanox.com>,
"hanand@...inx.com" <hanand@...inx.com>,
"mhabets@...arflare.com" <mhabets@...arflare.com>
Subject: Re: [PATCH V4 5/5] vdpasim: vDPA device simulator
On Wed, Feb 26, 2020 at 02:12:26PM +0800, Jason Wang wrote:
> > > It is a bit weird to be creating this dummy parent, couldn't this be
> > > done by just passing a NULL parent to vdpa_alloc_device, doing
> > > set_dma_ops() on the vdpasim->vdpa->dev and setting dma_device to
> > > vdpasim->vdpa->dev ?
> >
> >
> > I think it works.
>
>
> Rethink about this, since most hardware vDPA driver will have a parent and
> will use it to find the parent structure e.g
>
> dev_get_drvdata(vdpa->dev->parent)
Oh that seems like a sketchy pattern
> So I keep this dummy parent in V5.
The dummy parent is visible in sysfs, I think you should remove it so
the syfs for this virtual device makes sense.
Jason
Powered by blists - more mailing lists