Re: vDPA bus driver selection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 29, 2021 at 10:31:22AM +0800, Jason Wang wrote:
On Thu, Oct 28, 2021 at 5:47 PM Stefano Garzarella <sgarzare@xxxxxxxxxx> wrote:

On Thu, Oct 28, 2021 at 10:24:47AM +0800, Jason Wang wrote:
>On Thu, Oct 28, 2021 at 4:16 AM Michael S. Tsirkin <mst@xxxxxxxxxx> wrote:
>>
>> On Wed, Oct 27, 2021 at 03:21:15PM +0000, Parav Pandit wrote:
>> > Hi Stefano,
>> >
>> > > From: Stefano Garzarella <sgarzare@xxxxxxxxxx>
>> > > Sent: Wednesday, October 27, 2021 8:04 PM
>> > >
>> > > Hi folks,
>> > > I was trying to understand if we have a way to specify which vDPA bus driver
>> > > (e.g. vhost-vdpa, virtio-vdpa) a device should use.
>> > > IIUC we don't have it, and the first registered driver is used when a new device
>> > > is registered.
>> > >
>> > > I was thinking if it makes sense to extend the management API to specify which
>> > > bus driver to use for a device.
>
>Actually, we want to support this in the first version of vDPA bus.
>But for some reason it was dropped. The idea is to specify the device
>type 'virtio' or 'vhost'. But a concern is that, it may encourage
>vendor to implement e.g virtio specific device (without DMA
>isolation).

Yep, I see the issue about device type, so I think make sense to require
the support of both, how it is now basically.

So instead of defining the type of the device, we could provide the
possibility to choose which bus to connect it to,

I think you meant the "bus driver" here?

Yep, sorry!


in this way we
continue to require that both are supported.

As Michael suggested, instead of specify it at the creation time as was in my original idea, we can provide an API to attach/detach a device to
a specific vDPA bus.

Does such an API exist in driver core?

I need to check better, Parav showed something with sysfs to bind a device to a driver, so maybe yes.

I just tried the following and it worked:

$ vdpa dev add mgmtdev vdpasim_net name vdpa0

$ readlink -f /sys/bus/vdpa/devices/vdpa0/driver
/sys/bus/vdpa/drivers/vhost_vdpa

$ echo vdpa0 > /sys/bus/vdpa/devices/vdpa0/driver/unbind

$ echo vdpa0 > /sys/bus/vdpa/drivers/virtio_vdpa/bind



Of course, providing a default behaviour like now, which connects to the
first registered.

If we want to change this, we can introduce "driver_override".

Yep, I'll take a look.

Thanks,
Stefano

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux