From: Greg KH <gregkh@linuxfoundation.org>
To: Parav Pandit <parav@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"michal.lkml@markovi.net" <michal.lkml@markovi.net>,
"davem@davemloft.net" <davem@davemloft.net>,
Jiri Pirko <jiri@mellanox.com>
Subject: Re: [RFC net-next 1/8] subdev: Introducing subdev bus
Date: Fri, 1 Mar 2019 18:00:02 +0100 [thread overview]
Message-ID: <20190301170002.GB24452@kroah.com> (raw)
In-Reply-To: <AM4PR0501MB22601B097AF53AAFD59CB8B6D1760@AM4PR0501MB2260.eurprd05.prod.outlook.com>
On Fri, Mar 01, 2019 at 04:35:46PM +0000, Parav Pandit wrote:
> Hi Greg,
>
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Friday, March 1, 2019 1:17 AM
> > To: Parav Pandit <parav@mellanox.com>
> > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> > michal.lkml@markovi.net; davem@davemloft.net; Jiri Pirko
> > <jiri@mellanox.com>
> > Subject: Re: [RFC net-next 1/8] subdev: Introducing subdev bus
> >
> > On Thu, Feb 28, 2019 at 11:37:45PM -0600, Parav Pandit wrote:
> > > Introduce a new subdev bus which holds sub devices created from a
> > > primary device. These devices are named as 'subdev'.
> > > A subdev is identified similarly to pci device using 16-bit vendor id
> > > and device id.
> > > Unlike PCI devices, scope of subdev is limited to Linux kernel.
> >
> > But these are limited to only PCI devices, right?
> >
> For Mellanox use case yes, its limited to PCI devices.
>
> > This sounds a lot like that ARM proposal a week or so ago that asked for
> > something like this, are you working with them to make sure your proposal
> > works for them as well? (sorry, can't find where that was announced, it was
> > online somewhere...)
> >
> We were not aware of it, mostly because we are either on net side of mailing lists (netdev, rdma, virt etc).
> ARM proposal likely on linux-kernel, I guess.
> I will lookup that proposal and surely see if both of us can use common infrastructure.
>
> > > A central entry that assigns unique subdev vendor and device id is:
> > > include/linux/subdev_ids.h enums. Enum are chosen over define macro so
> > > that two vendors do not end up with vendor id in kernel development
> > > process.
> >
> > Why not just make it dynamic with on static ids?
> >
> Can you please elaborate?
> Do you mean we should use something similar to pci_add_dynid() with enhancement to catch duplicate id addition?
I have no idea what I wrote here, sorry :)
I was trying to say something like "using an enumerated type going to
rely on a central authority for your "dynamic" bus, why is that needed
at all"?
> > > subdev bus holds subdevices of multiple devices. A typical created
> > > subdev for a PCI device in sysfs tree appears under their parent's
> > > device as using core's default device naming scheme:
> > >
> > > subdev<instance_id>.
> > > i.e.
> > > subdev0
> > > subdev1
> > >
> > > $ ls -l /sys/bus/pci/devices/0000:05:00.0 [..]
> > > drwxr-xr-x 4 root root 0 Feb 13 15:57 subvdev0
> > > drwxr-xr-x 4 root root 0 Feb 13 15:57 subvdev1
> > >
> > > Device model view:
> > > ------------------
> > > +------+ +------+ +------+
> > > |subdev| |subdev| |subdev|
> > > -----| 1 |----| 2 |-------| 3 |----------
> > > | +--|---+ +-|----+ +--|---+ |
> > > --------|----------|---subdev bus--|--------------
> > > | | |
> > > +--+----+-----+ +---+---+
> > > |pcidev | |pcidev |
> > > -----| A |-----------------| B |----------
> > > | +-------+ +-------+ |
> > > -------------------pci bus------------------------
> >
> > To be clear, "subdev bus" is just a logical grouping, there is no physical
> > backing "bus" here at all, right?
> >
> Yep. that's correct.
>
> > What is going to "bind" to subdev devices? PCI drivers? Or new types of
> > drivers?
> >
> Devices are placed on subdev bus using devlink interface. And drivers which registers using subdev_register_driver(), their probe() method will be called.
But it's just a virtual mapping, what "good" does this provide anyone?
You are still sharing the same backing device here, what does this
logical split buy you?
> So yes, those are PCI vendor driver.
> I tried to capture this in cover-letter.
> At present users didn't ask to map this subdev to VM, but there is very high chance that once we have this without PCI SR-IOV, they would like to extend to VMs too.
> So in that case devlink will have option to say, add 'passthrough' device, and in that case instead of vendor's pci driver, some high level vfio type driver will bind to it.
> That is just the anticipation, but we haven't really worked out this fully.
> But this model allows to do so.
I think mfd is what you want to do here, instead of creating your own
bus type.
> > > +int subdev_add_dev(struct subdev *subdev, struct device *parent_dev,
> > > + enum subdev_vendor_id vid, enum subdev_device_id did) {
> > > + u32 id = 0;
> > > + int ret;
> > > +
> > > + if (!parent_dev)
> > > + return -EINVAL;
> >
> > No root devices?
> >
> I didn't get the comment. Intent of this check is subdev must have parent. Parent type doesn't matter.
You do not allow a subdev to sit at the "root" of the device tree.
That's fine, it was just a comment, it's your choice.
thanks,
greg k-h
next prev parent reply other threads:[~2019-03-01 17:00 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 5:37 [RFC net-next 0/8] Introducing subdev bus and devlink extension Parav Pandit
2019-03-01 5:37 ` [RFC net-next 1/8] subdev: Introducing subdev bus Parav Pandit
2019-03-01 7:17 ` Greg KH
2019-03-01 16:35 ` Parav Pandit
2019-03-01 17:00 ` Greg KH [this message]
2019-03-26 11:48 ` Lorenzo Pieralisi
2019-03-01 5:37 ` [RFC net-next 2/8] subdev: Introduce pm callbacks Parav Pandit
2019-03-01 5:37 ` [RFC net-next 3/8] modpost: Add support for subdev device id table Parav Pandit
2019-03-01 5:37 ` [RFC net-next 4/8] devlink: Introduce and use devlink_init/cleanup() in alloc/free Parav Pandit
2019-03-01 5:37 ` [RFC net-next 5/8] devlink: Add variant of devlink_register/unregister Parav Pandit
2019-03-01 5:37 ` [RFC net-next 6/8] devlink: Add support for devlink subdev lifecycle Parav Pandit
2019-03-01 5:37 ` [RFC net-next 7/8] net/mlx5: Add devlink subdev life cycle command support Parav Pandit
2019-03-01 7:18 ` Greg KH
2019-03-01 16:04 ` Parav Pandit
2019-03-01 5:37 ` [RFC net-next 8/8] net/mlx5: Add subdev driver to bind to subdev devices Parav Pandit
2019-03-01 7:21 ` Greg KH
2019-03-01 17:21 ` Parav Pandit
2019-03-05 7:13 ` Greg KH
2019-03-05 17:57 ` Parav Pandit
2019-03-05 19:27 ` Greg KH
2019-03-05 21:37 ` Parav Pandit
2019-03-01 22:12 ` Saeed Mahameed
2019-03-04 16:45 ` Parav Pandit
2019-03-01 20:03 ` [RFC net-next 0/8] Introducing subdev bus and devlink extension Jakub Kicinski
2019-03-04 4:41 ` Parav Pandit
2019-03-05 1:35 ` Jakub Kicinski
2019-03-05 19:46 ` Parav Pandit
2019-03-05 22:39 ` Kirti Wankhede
2019-03-05 23:17 ` Parav Pandit
2019-03-05 23:44 ` Parav Pandit
2019-03-06 0:44 ` Parav Pandit
2019-03-06 3:51 ` Kirti Wankhede
2019-03-06 5:42 ` Parav Pandit
2019-03-07 19:04 ` Kirti Wankhede
2019-03-07 20:27 ` Parav Pandit
2019-03-07 20:53 ` Kirti Wankhede
2019-03-07 21:02 ` Parav Pandit
2019-03-07 21:07 ` Kirti Wankhede
2019-03-07 21:21 ` Parav Pandit
2019-03-07 22:01 ` Kirti Wankhede
2019-03-07 22:31 ` Parav Pandit
2019-03-08 12:19 ` Kirti Wankhede
2019-03-08 17:09 ` Parav Pandit
2019-03-05 1:45 ` Jakub Kicinski
2019-03-05 16:52 ` Parav Pandit
2021-05-31 10:36 ` moyufeng
2021-06-01 5:37 ` Jakub Kicinski
2021-06-01 7:33 ` Yunsheng Lin
2021-06-01 21:34 ` Jakub Kicinski
2021-06-02 2:24 ` Yunsheng Lin
2021-06-02 16:34 ` Jakub Kicinski
2021-06-03 3:46 ` Yunsheng Lin
2021-06-03 17:53 ` Jakub Kicinski
2021-06-04 1:18 ` Yunsheng Lin
2021-06-04 18:41 ` Jakub Kicinski
2021-06-07 1:36 ` Yunsheng Lin
2021-06-07 19:46 ` Jakub Kicinski
2021-06-08 12:10 ` Yunsheng Lin
2021-06-08 17:29 ` Jakub Kicinski
2021-06-09 9:16 ` Yunsheng Lin
2021-06-09 9:38 ` Parav Pandit
2021-06-09 11:05 ` Yunsheng Lin
2021-06-09 11:59 ` Parav Pandit
2021-06-09 12:30 ` Yunsheng Lin
2021-06-09 13:45 ` Parav Pandit
2021-06-10 7:04 ` Yunsheng Lin
2021-06-10 7:17 ` Parav Pandit
2021-06-09 16:40 ` Jakub Kicinski
2021-06-10 6:52 ` Yunsheng Lin
2021-06-09 9:52 ` Parav Pandit
2021-06-09 11:16 ` Yunsheng Lin
2021-06-09 12:00 ` Parav Pandit
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=20190301170002.GB24452@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=jiri@mellanox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=netdev@vger.kernel.org \
--cc=parav@mellanox.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).