On Thu, Feb 13, 2020 at 10:58:44PM +0800, Jason Wang wrote:
On 2020/2/13 äå9:41, Jason Gunthorpe wrote:Here we are talking about the /dev/XX node that provides the
On Thu, Feb 13, 2020 at 11:34:10AM +0800, Jason Wang wrote:
While I suppose there are variations, typically 'class' devices areYou have dev, type orYes, but my understanding is class and bus are mutually exclusive. So we
class to choose from. Type is rarely used and doesn't seem to be used
by vdpa, so class seems the right choice
Jason
can't add a class to a device which is already attached on a bus.
user facing things and 'bus' devices are internal facing (ie like a
PCI device)
Though all vDPA devices have the same programming interface, but the
semantic is different. So it looks to me that use bus complies what
class.rst said:
"
Each device class defines a set of semantics and a programming interface
that devices of that class adhere to. Device drivers are the
implementation of that programming interface for a particular device on
a particular bus.
"
programming interface.
All the vdpa devices have the same basic
chardev interface and discover any semantic variations 'in band'
I don't see how that connects with using a bus.So why is this using a bus? VDPA is a user facing object, so theThis is because we want vDPA to be generic for being used by different
driver should create a class vhost_vdpa device directly, and that
driver should live in the drivers/vhost/ directory.
drivers which is not limited to vhost-vdpa. E.g in this series, it allows
vDPA to be used by kernel virtio drivers. And in the future, we will
probably introduce more drivers in the future.
Every class of virtio traffic is going to need a special HW driver to
enable VDPA, that special driver can create the correct vhost side
class device.
Again, I can't see any reason to inject a 'vdpa virtual bus' onFor the PCI VF case this driver would bind to a PCI device likeAll these driver will still be bound to their own bus (PCI or other). And
everything else
For our future SF/ADI cases the driver would bind to some
SF/ADI/whatever device on a bus.
what the driver needs is to present a vDPA device to virtual vDPA bus on
top.
top. That seems like mis-using the driver core.
Jason