Re: [PATCH net 6/6] virtio-net: a tiny comment update

2023-09-21 Thread Jason Wang
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi wrote: > > Update a comment because virtio-net now supports both > VIRTIO_NET_F_NOTF_COAL and VIRTIO_NET_F_VQ_NOTF_COAL. > > Signed-off-by: Heng Qi Acked-by: Jason Wang Thanks > --- > drivers/net/virtio_net.c | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH net 5/6] virtio-net: fix the vq coalescing setting for vq resize

2023-09-21 Thread Jason Wang
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi wrote: > > According to the definition of virtqueue coalescing spec[1]: > > Upon disabling and re-enabling a transmit virtqueue, the device MUST set > the coalescing parameters of the virtqueue to those configured through the > VIRTIO_NET_CTRL_NOTF_COA

Re: [PATCH net 4/6] virtio-net: fix per queue coalescing parameter setting

2023-09-21 Thread Jason Wang
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi wrote: > > When the user sets a non-zero coalescing parameter to 0 for a specific > virtqueue, it does not work as expected, so let's fix this. > > Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce > command") > Reported-by: Xiaoming Zh

Re: [PATCH net 3/6] virtio-net: consistently save parameters for per-queue

2023-09-21 Thread Jason Wang
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi wrote: > > When using .set_coalesce interface to set all queue coalescing > parameters, we need to update both per-queue and global save values. > > Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce > command") > Cc: Gavin Li > Signed-

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Zhu, Lingshan
On 9/22/2023 2:39 AM, Jason Gunthorpe wrote: On Thu, Sep 21, 2023 at 12:53:04PM -0400, Michael S. Tsirkin wrote: vdpa is not vfio, I don't know how you can suggest vdpa is a replacement for a vfio driver. They are completely different things. Each side has its own strengths, and vfio especial

Re: [PATCH net 2/6] virtio-net: fix mismatch of getting tx-frames

2023-09-21 Thread Jason Wang
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi wrote: > > Since virtio-net allows switching napi_tx for per txq, we have to > get the specific txq's result now. > > Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce > command") > Cc: Gavin Li > Signed-off-by: Heng Qi Acked-by: Jas

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Jason Wang
On Fri, Sep 22, 2023 at 3:53 AM Jason Gunthorpe wrote: > > On Thu, Sep 21, 2023 at 03:34:03PM -0400, Michael S. Tsirkin wrote: > > > that's easy/practical. If instead VDPA gives the same speed with just > > shadow vq then keeping this hack in vfio seems like less of a problem. > > Finally if VDPA

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Jason Wang
On Fri, Sep 22, 2023 at 6:55 AM Jason Gunthorpe wrote: > > On Thu, Sep 21, 2023 at 04:45:45PM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 04:49:46PM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 21, 2023 at 03:13:10PM -0400, Michael S. Tsirkin wrote: > > > > On Thu, Sep 21, 2023

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Jason Wang
On Fri, Sep 22, 2023 at 4:16 AM Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 04:53:45PM -0300, Jason Gunthorpe wrote: > > On Thu, Sep 21, 2023 at 03:34:03PM -0400, Michael S. Tsirkin wrote: > > > > > that's easy/practical. If instead VDPA gives the same speed with just > > > shadow vq th

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Jason Wang
On Fri, Sep 22, 2023 at 3:49 AM Jason Gunthorpe wrote: > > On Thu, Sep 21, 2023 at 03:13:10PM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 03:39:26PM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 21, 2023 at 12:53:04PM -0400, Michael S. Tsirkin wrote: > > > > > vdpa is not vfio,

Re: [PATCH v14 30/42] virtio_pci: introduce helper to get/set queue reset

2023-09-21 Thread Xuan Zhuo
On Thu, 21 Sep 2023 10:02:53 -0400, "Michael S. Tsirkin" wrote: > On Mon, Aug 01, 2022 at 02:38:50PM +0800, Xuan Zhuo wrote: > > Introduce new helpers to implement queue reset and get queue reset > > status. > > > > https://github.com/oasis-tcs/virtio-spec/issues/124 > > https://github.com/oasi

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Alex Williamson
On Thu, 21 Sep 2023 16:20:59 -0400 "Michael S. Tsirkin" wrote: > On Thu, Sep 21, 2023 at 05:01:21PM -0300, Jason Gunthorpe wrote: > > On Thu, Sep 21, 2023 at 01:58:32PM -0600, Alex Williamson wrote: > > > > > > +static const struct pci_device_id virtiovf_pci_table[] = { > > > > + { > >

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 04:51:15PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 03:17:25PM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 03:39:26PM -0300, Jason Gunthorpe wrote: > > > > What is the huge amount of work am I asking to do? > > > > > > You are asking us to in

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 04:49:46PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 03:13:10PM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 03:39:26PM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 21, 2023 at 12:53:04PM -0400, Michael S. Tsirkin wrote: > > > > > vdpa is not

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:40:39PM +0300, Yishai Hadas wrote: > Expose admin commands over the virtio device, to be used by the > vfio-virtio driver in the next patches. > > It includes: list query/use, legacy write/read, read notify_info. > > Signed-off-by: Yishai Hadas > --- > drivers/vfio/pc

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 05:01:21PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 01:58:32PM -0600, Alex Williamson wrote: > > > > +static const struct pci_device_id virtiovf_pci_table[] = { > > > + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_REDHAT_QUMRANET, > > > PCI_ANY_ID) }, > >

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 04:53:45PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 03:34:03PM -0400, Michael S. Tsirkin wrote: > > > that's easy/practical. If instead VDPA gives the same speed with just > > shadow vq then keeping this hack in vfio seems like less of a problem. > > Finally

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Alex Williamson
On Thu, 21 Sep 2023 15:40:40 +0300 Yishai Hadas wrote: > Introduce a vfio driver over virtio devices to support the legacy > interface functionality for VFs. > > Background, from the virtio spec [1]. > > In some systems, there

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:16:37PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 01:55:42PM -0400, Michael S. Tsirkin wrote: > > > That's not what I'm asking about though - not what shadow vq does, > > shadow vq is a vdpa feature. > > That's just VDPA then. We already talked about why V

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:39:26PM -0300, Jason Gunthorpe wrote: > > What is the huge amount of work am I asking to do? > > You are asking us to invest in the complexity of VDPA through out > (keep it working, keep it secure, invest time in deploying and > debugging in the field) I'm asking you t

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:39:26PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 12:53:04PM -0400, Michael S. Tsirkin wrote: > > > vdpa is not vfio, I don't know how you can suggest vdpa is a > > > replacement for a vfio driver. They are completely different > > > things. > > > Each side

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 02:44:50PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 01:21:26PM -0400, Michael S. Tsirkin wrote: > > Yea it's very useful - it's also useful for vdpa whether this patchset > > goes in or not. At some level, if vdpa can't keep up then maybe going > > the vfio r

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 05:09:04PM +, Parav Pandit wrote: > > > > From: Michael S. Tsirkin > > Sent: Thursday, September 21, 2023 10:31 PM > > > Another question I'm interested in is whether there's actually a performance > > benefit to using this as compared to just software vhost. I note

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 02:07:09PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 01:01:12PM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 01:52:24PM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 21, 2023 at 10:43:50AM -0600, Alex Williamson wrote: > > > > > > > > With th

RE: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Thursday, September 21, 2023 10:31 PM > Another question I'm interested in is whether there's actually a performance > benefit to using this as compared to just software vhost. I note there's a VM > exit > on each IO access, so ... perhaps? > Would be nice t

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 01:52:24PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 10:43:50AM -0600, Alex Williamson wrote: > > > > With that code in place a legacy driver in the guest has the look and > > > feel as if having a transitional device with legacy support for both its > > > con

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 01:41:39PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 10:16:04AM -0400, Michael S. Tsirkin wrote: > > On Thu, Sep 21, 2023 at 11:11:25AM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 21, 2023 at 09:16:21AM -0400, Michael S. Tsirkin wrote: > > > > > > > > diff

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Alex Williamson
On Thu, 21 Sep 2023 15:40:40 +0300 Yishai Hadas wrote: > Introduce a vfio driver over virtio devices to support the legacy > interface functionality for VFs. > > Background, from the virtio spec [1]. > > In some systems, there

Re: [PATCH vfio 08/11] vfio/pci: Expose vfio_pci_core_setup_barmap()

2023-09-21 Thread Alex Williamson
On Thu, 21 Sep 2023 15:40:37 +0300 Yishai Hadas wrote: > Expose vfio_pci_core_setup_barmap() to be used by drivers. > > This will let drivers to mmap a BAR and re-use it from both vfio and the > driver when it's applicable. > > This API will be used in the next patches by the vfio/virtio coming

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 11:11:25AM -0300, Jason Gunthorpe wrote: > On Thu, Sep 21, 2023 at 09:16:21AM -0400, Michael S. Tsirkin wrote: > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > index bf0f54c24f81..5098418c8389 100644 > > > --- a/MAINTAINERS > > > +++ b/MAINTAINERS > > > @@ -22624,6 +226

Re: [PATCH v14 30/42] virtio_pci: introduce helper to get/set queue reset

2023-09-21 Thread Michael S. Tsirkin
On Mon, Aug 01, 2022 at 02:38:50PM +0800, Xuan Zhuo wrote: > Introduce new helpers to implement queue reset and get queue reset > status. > > https://github.com/oasis-tcs/virtio-spec/issues/124 > https://github.com/oasis-tcs/virtio-spec/issues/139 > > Signed-off-by: Xuan Zhuo > Acked-by: Jason

Re: [PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:40:32PM +0300, Yishai Hadas wrote: > From: Feng Liu > > Introduce support for the admin virtqueue. By negotiating > VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates one > administration virtqueue. Administration virtqueue implementation in > virtio pci g

Re: [PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:40:30PM +0300, Yishai Hadas wrote: > From: Feng Liu > > Currently VQ deletion callback vp_del_vqs() processes generic > virtio_device level VQ list instead of VQ information available at PCI > layer. > > To adhere to the layering, use the pci device level VQ informatio

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:40:40PM +0300, Yishai Hadas wrote: > +#define VIRTIO_LEGACY_IO_BAR_HEADER_LEN 20 > +#define VIRTIO_LEGACY_IO_BAR_MSIX_HEADER_LEN 4 This is exactly part of VIRTIO_PCI_CONFIG_OFF duplicated. -- MST ___ Virtualization mailing l

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Michael S. Tsirkin
> MAINTAINERS | 6 + > drivers/vfio/pci/Kconfig | 2 + > drivers/vfio/pci/Makefile| 2 + > drivers/vfio/pci/virtio/Kconfig | 15 + > drivers/vfio/pci/virtio/Makefile | 4 + > drivers/vfio/pci/virtio/cmd.c| 4 +- > drivers/vfio/pci/virtio/cmd.h

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-09-21 Thread Michael S. Tsirkin
On Thu, Sep 21, 2023 at 03:40:39PM +0300, Yishai Hadas wrote: > Expose admin commands over the virtio device, to be used by the > vfio-virtio driver in the next patches. > > It includes: list query/use, legacy write/read, read notify_info. > > Signed-off-by: Yishai Hadas I don't get the motiva

[PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Yishai Hadas via Virtualization
Introduce a vfio driver over virtio devices to support the legacy interface functionality for VFs. Background, from the virtio spec [1]. In some systems, there is a need to support a virtio legacy driver with a device that does n

[PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-09-21 Thread Yishai Hadas via Virtualization
Expose admin commands over the virtio device, to be used by the vfio-virtio driver in the next patches. It includes: list query/use, legacy write/read, read notify_info. Signed-off-by: Yishai Hadas --- drivers/vfio/pci/virtio/cmd.c | 146 ++ drivers/vfio/pci/virt

[PATCH vfio 08/11] vfio/pci: Expose vfio_pci_core_setup_barmap()

2023-09-21 Thread Yishai Hadas via Virtualization
Expose vfio_pci_core_setup_barmap() to be used by drivers. This will let drivers to mmap a BAR and re-use it from both vfio and the driver when it's applicable. This API will be used in the next patches by the vfio/virtio coming driver. Signed-off-by: Yishai Hadas --- drivers/vfio/pci/vfio_pci

[PATCH vfio 07/11] virtio-pci: Introduce admin commands

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduces admin commands, as follow: The "list query" command can be used by the driver to query the set of admin commands supported by the virtio device. The "list use" command is used to inform the virtio device which admin commands the driver will use. The "legacy common cfg r

[PATCH vfio 09/11] vfio/pci: Expose vfio_pci_iowrite/read##size()

2023-09-21 Thread Yishai Hadas via Virtualization
Expose vfio_pci_iowrite/read##size() to let it be used by drivers. This functionality is needed to enable direct access to some physical BAR of the device with the proper locks/checks in place. The next patches from this series will use this functionality on a data path flow when a direct access

[PATCH vfio 06/11] virtio-pci: Introduce API to get PF virtio device from VF PCI device

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce API to get PF virtio device from the given VF PCI device so that other modules such as vfio in subsequent patch can use it. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- drivers/virtio/virtio_pci_common.c |

[PATCH vfio 05/11] virtio-pci: Introduce admin command sending function

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Add support for sending admin command through admin virtqueue interface, and expose generic API to execute virtio admin command. Reuse the send synchronous command helper function at virtio transport layer. In addition, add new result state of admin command and admin commands range

[PATCH vfio 04/11] virtio: Expose the synchronous command helper function

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Synchronous command helper function is exposed at virtio layer, so that ctrl virtqueue and admin virtqueues can reuse this helper function to send synchronous commands. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- d

[PATCH vfio 02/11] virtio: Define feature bit for administration virtqueue

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce VIRTIO_F_ADMIN_VQ which is used for administration virtqueue support. Signed-off-by: Feng Liu Reviewed-by: Parav Pandit Reviewed-by: Jiri Pirko Signed-off-by: Yishai Hadas --- include/uapi/linux/virtio_config.h | 8 +++- 1 file changed, 7 insertions(+), 1 deleti

[PATCH vfio 03/11] virtio-pci: Introduce admin virtqueue

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Introduce support for the admin virtqueue. By negotiating VIRTIO_F_ADMIN_VQ feature, driver detects capability and creates one administration virtqueue. Administration virtqueue implementation in virtio pci generic layer, enables multiple types of upper layer drivers such as vfio,

[PATCH vfio 01/11] virtio-pci: Use virtio pci device layer vq info instead of generic one

2023-09-21 Thread Yishai Hadas via Virtualization
From: Feng Liu Currently VQ deletion callback vp_del_vqs() processes generic virtio_device level VQ list instead of VQ information available at PCI layer. To adhere to the layering, use the pci device level VQ information stored in the virtqueues or vqs. This also prepares the code to handle PC

[PATCH vfio 00/11] Introduce a vfio driver over virtio devices

2023-09-21 Thread Yishai Hadas via Virtualization
This series introduce a vfio driver over virtio devices to support the legacy interface functionality for VFs. Background, from the virtio spec [1]. In some systems, there is a need to support a virtio legacy driver with a device

Re: [PATCH net 1/6] virtio-net: initially change the value of tx-frames

2023-09-21 Thread Jason Wang
On Tue, Sep 19, 2023 at 3:49 PM Heng Qi wrote: > > Background: > 1. Commit 0c465be183c7 ("virtio_net: ethtool tx napi configuration") uses >tx-frames to toggle napi_tx (0 off and 1 on) if notification coalescing >is not supported. > 2. Commit 31c03aef9bc2 ("virtio_net: enable napi_tx by de