Re: [PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Use translations added in VhostIOVATree in SVQ. Only introduce usage here, not allocation and deallocation. As with previous patches, we use the dead code paths of shadow_vqs_enabled to avoid commiting too many changes at once. These are impossible to take

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: @@ -272,6 +590,28 @@ void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd) void vhost_svq_stop(VhostShadowVirtqueue *svq) { event_notifier_set_handler(&svq->svq_kick, NULL); +g_autofree VirtQueueElement *next_avail_elem =

Re: [PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: SVQ is able to log the dirty bits by itself, so let's use it to not block migration. Also, ignore set and clear of VHOST_F_LOG_ALL on set_features if SVQ is enabled. Even if the device supports it, the reports would be nonsense because SVQ memory is in the

Re: [PATCH 29/31] vdpa: Make ncs autofree

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Simplifying memory management. Signed-off-by: Eugenio Pérez To reduce the size of this series. This can be sent as an separate patch if I was not wrong. Thanks --- net/vhost-vdpa.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) dif

Re: [PATCH 30/31] vdpa: Move vhost_vdpa_get_iova_range to net/vhost-vdpa.c

2022-01-29 Thread Jason Wang
在 2022/1/22 上午4:27, Eugenio Pérez 写道: Since it's a device property, it can be done in net/. This helps SVQ to allocate the rings in vdpa device initialization, rather than delay that. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 15 --- net/vhost-vdpa.c | 32 +

Re: [PATCH v3 00/17] virtio pci support VIRTIO_F_RING_RESET

2022-02-06 Thread Jason Wang
On Wed, Jan 26, 2022 at 3:35 PM Xuan Zhuo wrote: > > > The virtio spec already supports the virtio queue reset function. This patch > set > is to add this function to the kernel. The relevant virtio spec information

Re: [PATCH v3 01/17] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-02-06 Thread Jason Wang
在 2022/1/26 下午3:35, Xuan Zhuo 写道: Add queue_notify_data in struct virtio_pci_common_cfg, which comes from here https://github.com/oasis-tcs/virtio-spec/issues/89 Since I want to add queue_reset after it, I submitted this patch first. Signed-off-by: Xuan Zhuo --- include/uapi/linux/virtio_pc

Re: [PATCH v3 03/17] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset

2022-02-06 Thread Jason Wang
在 2022/1/26 下午3:35, Xuan Zhuo 写道: Performing reset on a queue is divided into two steps: 1. reset_vq: reset one vq 2. enable_reset_vq: re-enable the reset queue In the first step, these tasks will be completed: 1. notify the hardware queue to reset 2. recycle the buffer from vq

Re: [PATCH v3 13/17] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-06 Thread Jason Wang
在 2022/1/26 下午3:35, Xuan Zhuo 写道: This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into two steps: 1. reset_vq: reset one vq 2. enable_reset_vq: re-enable the reset queue In the first step, these tasks will be completed: 1. notify the hardwa

Re: [PATCH v3 01/17] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-02-07 Thread Jason Wang
On Mon, Feb 7, 2022 at 2:07 PM Xuan Zhuo wrote: > > On Mon, 7 Feb 2022 11:41:06 +0800, Jason Wang wrote: > > > > 在 2022/1/26 下午3:35, Xuan Zhuo 写道: > > > Add queue_notify_data in struct virtio_pci_common_cfg, which comes from > > > here https://github

Re: [PATCH v3 13/17] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-07 Thread Jason Wang
On Mon, Feb 7, 2022 at 4:19 PM Xuan Zhuo wrote: > > On Mon, 7 Feb 2022 14:57:13 +0800, Jason Wang wrote: > > > > 在 2022/1/26 下午3:35, Xuan Zhuo 写道: > > > This patch implements virtio pci support for QUEUE RESET. > > > > > > Performing reset on a q

Re: [PATCH v3 03/17] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset

2022-02-07 Thread Jason Wang
在 2022/2/7 下午3:19, Xuan Zhuo 写道: On Mon, 7 Feb 2022 14:45:02 +0800, Jason Wang wrote: 在 2022/1/26 下午3:35, Xuan Zhuo 写道: Performing reset on a queue is divided into two steps: 1. reset_vq: reset one vq 2. enable_reset_vq: re-enable the reset queue In the first step, these tasks will be

Re: [PATCH v3 00/17] virtio pci support VIRTIO_F_RING_RESET

2022-02-07 Thread Jason Wang
在 2022/2/7 下午2:02, Xuan Zhuo 写道: On Mon, 7 Feb 2022 11:39:36 +0800, Jason Wang wrote: On Wed, Jan 26, 2022 at 3:35 PM Xuan Zhuo wrote: The virtio spec already supports the virtio queue reset function. This

Re: [PATCH v3 01/17] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-02-07 Thread Jason Wang
On Tue, Feb 8, 2022 at 10:17 AM Xuan Zhuo wrote: > > On Mon, 7 Feb 2022 16:06:15 +0800, Jason Wang wrote: > > On Mon, Feb 7, 2022 at 2:07 PM Xuan Zhuo wrote: > > > > > > On Mon, 7 Feb 2022 11:41:06 +0800, Jason Wang wrote: > > > > > > >

Re: [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call

2022-02-07 Thread Jason Wang
在 2022/1/31 下午11:34, Eugenio Perez Martin 写道: On Sat, Jan 29, 2022 at 9:06 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/hw

Re: [PATCH v3 01/17] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-02-07 Thread Jason Wang
On Tue, Feb 8, 2022 at 11:20 AM Xuan Zhuo wrote: > > On Tue, 8 Feb 2022 11:03:17 +0800, Jason Wang wrote: > > On Tue, Feb 8, 2022 at 10:17 AM Xuan Zhuo > > wrote: > > > > > > On Mon, 7 Feb 2022 16:06:15 +0800, Jason Wang wrote: > > > > On Mon,

Re: [PATCH v3 01/17] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-02-07 Thread Jason Wang
On Tue, Feb 8, 2022 at 11:29 AM Xuan Zhuo wrote: > > On Tue, 8 Feb 2022 11:24:13 +0800, Jason Wang wrote: > > On Tue, Feb 8, 2022 at 11:20 AM Xuan Zhuo > > wrote: > > > > > > On Tue, 8 Feb 2022 11:03:17 +0800, Jason Wang wrote: > > > > On Tue, F

Re: [PATCH 11/31] vhost: Add vhost_svq_valid_device_features to shadow vq

2022-02-07 Thread Jason Wang
在 2022/2/1 下午6:57, Eugenio Perez Martin 写道: On Mon, Jan 31, 2022 at 4:49 PM Eugenio Perez Martin wrote: On Sat, Jan 29, 2022 at 9:11 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: This allows SVQ to negotiate features with the device. For the device, SVQ is a driver. While

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-02-07 Thread Jason Wang
在 2022/2/1 上午2:58, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 5:03 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: First half of the buffers forwarding part, preparing vhost-vdpa callbacks to SVQ to offer it. QEMU cannot enable it at this moment, so this is effectively dead

Re: [PATCH 16/31] vhost: pass queue index to vhost_vq_get_addr

2022-02-07 Thread Jason Wang
在 2022/2/1 上午1:44, Eugenio Perez Martin 写道: On Sat, Jan 29, 2022 at 9:20 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: Doing that way allows vhost backend to know what address to return. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost.c | 6 +++--- 1 file changed, 3

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-08 Thread Jason Wang
在 2022/2/2 上午1:08, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 5:43 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: Initial version of shadow virtqueue that actually forward buffers. There is no iommu support at the moment, and that will be addressed in future patches of

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-08 Thread Jason Wang
在 2022/2/1 下午7:25, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 7:47 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: @@ -272,6 +590,28 @@ void vhost_svq_set_svq_kick_fd(VhostShadowVirtqueue *svq, int svq_kick_fd) void vhost_svq_stop(VhostShadowVirtqueue *svq

Re: [PATCH 22/31] vhost: Add VhostIOVATree

2022-02-08 Thread Jason Wang
在 2022/2/2 上午1:27, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 6:21 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: This tree is able to look for a translated address from an IOVA address. At first glance it is similar to util/iova-tree. However, SVQ working on devices with

Re: [PATCH 23/31] vdpa: Add custom IOTLB translations to SVQ

2022-02-08 Thread Jason Wang
在 2022/2/1 上午3:11, Eugenio Perez Martin 写道: +return false; +} + +/* + * Map->iova chunk size is ignored. What to do if descriptor + * (addr, size) does not fit is delegated to the device. + */ I think we need at least check the size and fail i

Re: [PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-02-08 Thread Jason Wang
在 2022/2/1 下午7:45, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 7:50 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: SVQ is able to log the dirty bits by itself, so let's use it to not block migration. Also, ignore set and clear of VHOST_F_LOG_ALL on set_features if S

Re: [PATCH 00/31] vDPA shadow virtqueue

2022-02-08 Thread Jason Wang
在 2022/1/31 下午5:15, Eugenio Perez Martin 写道: On Fri, Jan 28, 2022 at 7:02 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: This series enables shadow virtqueue (SVQ) for vhost-vdpa devices. This is intended as a new method of tracking the memory the devices touch during a

Re: [PATCH 04/31] vdpa: Add vhost_svq_set_svq_kick_fd

2022-02-08 Thread Jason Wang
在 2022/1/31 下午6:18, Eugenio Perez Martin 写道: On Fri, Jan 28, 2022 at 7:29 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: This function allows the vhost-vdpa backend to override kick_fd. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 1 + hw/virtio

Re: [PATCH 06/31] vhost: Route guest->host notification through shadow virtqueue

2022-02-08 Thread Jason Wang
在 2022/1/31 下午7:33, Eugenio Perez Martin 写道: On Fri, Jan 28, 2022 at 7:57 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: At this moment no buffer forwarding will be performed in SVQ mode: Qemu just forward the guest's kicks to the device. This commit also set up SVQs i

Re: one question about your patch "vhost: log dirty page correctly"

2022-02-08 Thread Jason Wang
Adding lists. On Wed, Feb 9, 2022 at 4:58 AM Michael S. Tsirkin wrote: > > On Tue, Feb 08, 2022 at 11:37:00AM -0800, Xingyu Li wrote: > > Hi Jason, > > > > Sorry to disturb you. I have a question about your Linux kernel > > patch-- 1981e4c9a97("vhost: log dirty page correctly"). I noted that the

Re: [RFC PATCH 1/5] uapi/linux/if_tun.h: Added new ioctl for tun/tap.

2022-02-08 Thread Jason Wang
在 2022/1/25 下午4:46, Andrew Melnychenko 写道: Added TUNGETSUPPORTEDOFFLOADS that should allow to get bits of supported offloads. So we don't use dedicated ioctls in the past, instead, we just probing by checking the return value of TUNSETOFFLOADS. E.g qemu has the following codes: int tap_pr

Re: [RFC PATCH 2/5] driver/net/tun: Added features for USO.

2022-02-08 Thread Jason Wang
在 2022/1/25 下午4:46, Andrew Melnychenko 写道: Added support for USO4 and USO6, also added code for new ioctl TUNGETSUPPORTEDOFFLOADS. For now, to "enable" USO, it's required to set both USO4 and USO6 simultaneously. USO enables NETIF_F_GSO_UDP_L4. Signed-off-by: Andrew Melnychenko --- drivers

Re: [RFC PATCH 3/5] uapi/linux/virtio_net.h: Added USO types.

2022-02-08 Thread Jason Wang
在 2022/1/25 下午4:47, Andrew Melnychenko 写道: Added new GSO type for USO: VIRTIO_NET_HDR_GSO_UDP_L4. Feature VIRTIO_NET_F_HOST_USO allows to enable NETIF_F_GSO_UDP_L4. Separated VIRTIO_NET_F_GUEST_USO4 & VIRTIO_NET_F_GUEST_USO6 features required for Windows guests. Signed-off-by: Andrew Melnychenk

Re: [RFC PATCH 4/5] linux/virtio_net.h: Added Support for GSO_UDP_L4 offload.

2022-02-08 Thread Jason Wang
在 2022/1/25 下午4:47, Andrew Melnychenko 写道: Now, it's possible to convert vnet packets from/to skb. I suggest to change the title to "net: support XXX offload in vnet header" Thanks Signed-off-by: Andrew Melnychenko --- include/linux/virtio_net.h | 11 +++ 1 file changed, 11 i

Re: [RFC PATCH 5/5] drivers/net/virtio_net.c: Added USO support.

2022-02-08 Thread Jason Wang
在 2022/1/25 下午4:47, Andrew Melnychenko 写道: Now, it possible to enable GSO_UDP_L4("tx-udp-segmentation") for VirtioNet. Signed-off-by: Andrew Melnychenko --- drivers/net/virtio_net.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/net/virti

Re: [PATCH v3 00/17] virtio pci support VIRTIO_F_RING_RESET

2022-02-08 Thread Jason Wang
On Tue, Feb 8, 2022 at 3:56 PM Xuan Zhuo wrote: > > On Tue, 08 Feb 2022 11:14:45 +0800, Xuan Zhuo > wrote: > > On Tue, 8 Feb 2022 10:59:48 +0800, Jason Wang wrote: > > > > > > 在 2022/2/7 下午2:02, Xuan Zhuo 写道: > > > > On Mon, 7 Feb 2022 11:39:36 +

Re: [RFC PATCH 0/5] TUN/VirtioNet USO features support.

2022-02-08 Thread Jason Wang
在 2022/2/8 下午9:09, Andrew Melnichenko 写道: Hi people, Can you please review this series? Are there any performance number to demonstrate the difference? Thanks On Wed, Jan 26, 2022 at 10:32 AM Yuri Benditovich wrote: On Wed, Jan 26, 2022 at 9:54 AM Xuan Zhuo wrote: On Tue, 25 Jan 2022

Re: [PATCH v3 13/17] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-08 Thread Jason Wang
On Tue, Feb 8, 2022 at 3:44 PM Xuan Zhuo wrote: > > On Tue, 8 Feb 2022 10:55:37 +0800, Jason Wang wrote: > > On Mon, Feb 7, 2022 at 4:19 PM Xuan Zhuo wrote: > > > > > > On Mon, 7 Feb 2022 14:57:13 +0800, Jason Wang wrote: > > > > > > > >

Re: PING: [PATCH 0/3] Introduce akcipher service for virtio-crypto

2022-02-09 Thread Jason Wang
On Thu, Feb 10, 2022 at 2:58 PM zhenwei pi wrote: > > PING! I think it would be helpful to get ack/reviewing from crypto gurus. Maybe Herbert? Thanks > > PS: Please ignore the warning from kernel test robot, I'll fix it in > next version. > > On 1/21/22 10:24 AM, zhenwei pi wrote: > > Introduce

Re: [PATCH v4 00/14] virtio pci support VIRTIO_F_RING_RESET

2022-02-10 Thread Jason Wang
On Wed, Feb 9, 2022 at 8:29 PM Xuan Zhuo wrote: > > The virtio spec already supports the virtio queue reset function. This patch > set > is to add this function to the kernel. The relevant virtio spec information is > here: > > https://github.com/oasis-tcs/virtio-spec/issues/124 > > Also rega

Re: [PATCH v4 09/14] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset

2022-02-10 Thread Jason Wang
在 2022/2/9 下午8:28, Xuan Zhuo 写道: Performing reset on a queue is divided into four steps: 1. reset_vq: reset one vq 2. recycle the buffer from vq by virtqueue_detach_unused_buf() 3. release the ring of the vq by vring_release_virtqueue() 4. enable_reset_vq: re-enable the reset queue So add two

Re: [PATCH v4 14/14] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-10 Thread Jason Wang
在 2022/2/9 下午8:29, Xuan Zhuo 写道: This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. reset_vq: reset one vq 2. recycle the buffer from vq by virtqueue_detach_unused_buf() 3. release the ring of the vq by vring_release_virtqueue(

Re: [PATCH v4 00/14] virtio pci support VIRTIO_F_RING_RESET

2022-02-10 Thread Jason Wang
On Fri, Feb 11, 2022 at 2:34 PM Xuan Zhuo wrote: > > On Fri, 11 Feb 2022 13:40:52 +0800, Jason Wang wrote: > > On Wed, Feb 9, 2022 at 8:29 PM Xuan Zhuo wrote: > > > > > > The virtio spec already supports the virtio queue reset function. This > > > patch s

Re: [PATCH v4 09/14] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset

2022-02-10 Thread Jason Wang
On Fri, Feb 11, 2022 at 3:13 PM Xuan Zhuo wrote: > > On Fri, 11 Feb 2022 14:49:03 +0800, Jason Wang wrote: > > > > 在 2022/2/9 下午8:28, Xuan Zhuo 写道: > > > Performing reset on a queue is divided into four steps: > > > > > > 1. reset_vq: reset

Re: [PATCH v4 14/14] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-10 Thread Jason Wang
On Fri, Feb 11, 2022 at 3:24 PM Xuan Zhuo wrote: > > On Fri, 11 Feb 2022 15:05:40 +0800, Jason Wang wrote: > > > > 在 2022/2/9 下午8:29, Xuan Zhuo 写道: > > > This patch implements virtio pci support for QUEUE RESET. > > > > > > Performing reset on a que

Re: [PATCH V4 1/4] vDPA/ifcvf: implement IO read/write helpers in the header file

2022-02-13 Thread Jason Wang
在 2022/2/3 下午3:27, Zhu Lingshan 写道: re-implement IO read/write helpers in the header file, so that they can be utilized among modules. Signed-off-by: Zhu Lingshan I wonder if we can simply use include/linux/virtio_pci_modern.h. The accessors vp_ioreadX/writeX() there were decoupled from th

Re: [PATCH V4 2/4] vDPA/ifcvf: implement device MSIX vector allocator

2022-02-13 Thread Jason Wang
在 2022/2/3 下午3:27, Zhu Lingshan 写道: This commit implements a MSIX vector allocation helper for vqs and config interrupts. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 35 +++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/dr

Re: [PATCH V4 3/4] vhost_vdpa: don't setup irq offloading when irq_num < 0

2022-02-13 Thread Jason Wang
在 2022/2/3 下午3:27, Zhu Lingshan 写道: When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan --- drivers/vhost/vdpa.c | 4 1 file c

Re: [PATCH V4 4/4] vDPA/ifcvf: implement shared IRQ feature

2022-02-13 Thread Jason Wang
在 2022/2/3 下午3:27, Zhu Lingshan 写道: On some platforms/devices, there may not be enough MSI vector slots allocated for virtqueues and config changes. In such a case, the interrupt sources(virtqueues, config changes) must share an IRQ/vector, to avoid initialization failures, keep the device funct

Re: [PATCH 1/2] vdpa: Add support for querying vendor statistics

2022-02-14 Thread Jason Wang
On Thu, Feb 3, 2022 at 1:56 PM Eli Cohen wrote: > > Allows to read vendor statistics of vdpa device. The specific statistics > data is received by the upstream driver in the form of an attribute > name/attribute value pairs. > > An example of statistics for mlx5_vdpa device are: > > received_desc

Re: [PATCH 2/2] vdpa/mlx5: Add support for reading descriptor statistics

2022-02-14 Thread Jason Wang
On Thu, Feb 3, 2022 at 1:56 PM Eli Cohen wrote: > > Implement the get_vq_stats calback of vdpa_config_ops to return the > statistics for a virtqueue. > > The statistics are provided as vendor specific statistics where the > driver provides a pair of attribute name and attribute value. > > Currentl

Re: [PATCH V4 4/4] vDPA/ifcvf: implement shared IRQ feature

2022-02-14 Thread Jason Wang
On Tue, Feb 15, 2022 at 10:18 AM Zhu, Lingshan wrote: > > > > On 2/14/2022 10:27 PM, Michael S. Tsirkin wrote: > > On Mon, Feb 14, 2022 at 06:01:56PM +0800, Zhu Lingshan wrote: > >> > >> On 2/14/2022 3:19 PM, Jason Wang wrote: > >>> 在 2022/2/3 下

Re: [PATCH V4 4/4] vDPA/ifcvf: implement shared IRQ feature

2022-02-14 Thread Jason Wang
On Mon, Feb 14, 2022 at 10:25 PM Michael S. Tsirkin wrote: > > On Mon, Feb 14, 2022 at 03:19:25PM +0800, Jason Wang wrote: > > > > 在 2022/2/3 下午3:27, Zhu Lingshan 写道: > > > On some platforms/devices, there may not be enough MSI vector > > > slots allocated f

Re: [PATCH V4 4/4] vDPA/ifcvf: implement shared IRQ feature

2022-02-14 Thread Jason Wang
On Tue, Feb 15, 2022 at 11:29 AM Zhu, Lingshan wrote: > > > > On 2/15/2022 11:03 AM, Jason Wang wrote: > > On Tue, Feb 15, 2022 at 10:18 AM Zhu, Lingshan > > wrote: > >> > >> > >> On 2/14/2022 10:27 PM, Michael S. Tsirkin wrote: > >>&g

Re: [PATCH] Add definition of VIRTIO_F_IN_ORDER feature bit

2022-02-14 Thread Jason Wang
eaders.sh > > Signed-off-by: Gautam Dawar Acked-by: Jason Wang > --- > include/uapi/linux/virtio_config.h | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/include/uapi/linux/virtio_config.h > b/include/uapi/linux/virtio_config.h > index b5eda06f0d57.

Re: [PATCH v5 19/22] virtio: add helper virtio_set_max_ring_num()

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:15 PM Xuan Zhuo wrote: > > Added helper virtio_set_max_ring_num() to set the upper limit of ring > num when creating a virtqueue. > > Can be used to limit ring num before find_vqs() call. Or change ring num > when re-enable reset queue. Do we have a chance that RX and TX

Re: [PATCH v5 17/22] virtio_net: support rx/tx queue reset

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: > > This patch implements the reset function of the rx, tx queues. > > Based on this function, it is possible to modify the ring num of the > queue. And quickly recycle the buffer in the queue. > > In the process of the queue disable, in theory, as

Re: [PATCH v5 06/22] virtio_ring: queue_reset: packed: support enable reset queue

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: > > The purpose of this patch is to make vring packed support re-enable reset > vq. > > Based on whether the incoming vq passed by vring_setup_virtqueue() is > NULL or not, distinguish whether it is a normal create virtqueue or > re-enable a reset q

Re: [PATCH v5 14/22] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: > > This patch implements virtio pci support for QUEUE RESET. > > Performing reset on a queue is divided into these steps: > > 1. reset_vq: reset one vq > 2. recycle the buffer from vq by virtqueue_detach_unused_buf() > 3. release the ring of the vq

Re: [PATCH v5 20/22] virtio_net: set the default max ring num

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: > > Sets the default maximum ring num based on virtio_set_max_ring_num(). > > The default maximum ring num is 1024. Having a default value is pretty useful, I see 32K is used by default for IFCVF. Rethink this, how about having a different default

Re: [PATCH v5 08/22] virtio_ring: queue_reset: add vring_release_virtqueue()

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: > > Added vring_release_virtqueue() to release the ring of the vq. > > In this process, vq is removed from the vdev->vqs queue. And the memory > of the ring is released > > Signed-off-by: Xuan Zhuo > --- > drivers/virtio/virtio_ring.c | 18 +++

Re: [PATCH v5 22/22] virtio_net: support set_ringparam

2022-02-15 Thread Jason Wang
On Mon, Feb 14, 2022 at 4:15 PM Xuan Zhuo wrote: > > Support set_ringparam based on virtio queue reset. > > The rx,tx_pending required to be passed must be power of 2. > > Signed-off-by: Xuan Zhuo > --- > drivers/net/virtio_net.c | 50 > 1 file changed, 5

Re: [PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-02-16 Thread Jason Wang
On Wed, Feb 16, 2022 at 11:54 PM Eugenio Perez Martin wrote: > > On Tue, Feb 8, 2022 at 9:25 AM Jason Wang wrote: > > > > > > 在 2022/2/1 下午7:45, Eugenio Perez Martin 写道: > > > On Sun, Jan 30, 2022 at 7:50 AM Jason Wang wrote: > > >> > > >

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-16 Thread Jason Wang
On Thu, Feb 10, 2022 at 4:51 PM Xuan Zhuo wrote: > > virtqueue_add() only supports virtual addresses, dma is completed in > virtqueue_add(). > > In some scenarios (such as the AF_XDP scenario), DMA is completed in advance, > so > it is necessary for us to support passing the DMA address to virtqu

Re: [PATCH v5 20/22] virtio_net: set the default max ring num

2022-02-16 Thread Jason Wang
On Wed, Feb 16, 2022 at 3:52 PM Xuan Zhuo wrote: > > On Wed, 16 Feb 2022 12:14:31 +0800, Jason Wang wrote: > > On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo > > wrote: > > > > > > Sets the default maximum ring num based on virtio_set_max_ring_num(). > > &g

Re: [PATCH v5 14/22] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-02-16 Thread Jason Wang
On Wed, Feb 16, 2022 at 4:08 PM Xuan Zhuo wrote: > > On Wed, 16 Feb 2022 12:14:25 +0800, Jason Wang wrote: > > On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo > > wrote: > > > > > > This patch implements virtio pci support for QUEUE RESET. > > > >

Re: [syzbot] WARNING in vhost_dev_cleanup (2)

2022-02-16 Thread Jason Wang
On Thu, Feb 17, 2022 at 10:01 AM syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit:c5d9ae265b10 Merge tag 'for-linus' of git://git.kernel.org.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=132e687c70 > kernel config:

Re: [syzbot] WARNING in vhost_dev_cleanup (2)

2022-02-16 Thread Jason Wang
On Thu, Feb 17, 2022 at 3:36 PM Michael S. Tsirkin wrote: > > On Thu, Feb 17, 2022 at 03:34:13PM +0800, Jason Wang wrote: > > On Thu, Feb 17, 2022 at 10:01 AM syzbot > > wrote: > > > > > > Hello, > > > > > > syzbot found the following issue

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-20 Thread Jason Wang
On Fri, Feb 18, 2022 at 5:25 PM Michael S. Tsirkin wrote: > > On Fri, Feb 18, 2022 at 04:55:23PM +0800, Xuan Zhuo wrote: > > On Thu, 17 Feb 2022 15:19:44 +0800, Jason Wang wrote: > > > On Thu, Feb 10, 2022 at 4:51 PM Xuan Zhuo > > > wrote: > > > > >

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-20 Thread Jason Wang
On Fri, Feb 18, 2022 at 5:00 PM Xuan Zhuo wrote: > > On Thu, 17 Feb 2022 15:19:44 +0800, Jason Wang wrote: > > On Thu, Feb 10, 2022 at 4:51 PM Xuan Zhuo > > wrote: > > > > > > virtqueue_add() only supports virtual addresses, dma is completed in > &

Re: [PATCH v5 20/22] virtio_net: set the default max ring num

2022-02-20 Thread Jason Wang
在 2022/2/17 下午5:30, Xuan Zhuo 写道: On Thu, 17 Feb 2022 15:21:26 +0800, Jason Wang wrote: On Wed, Feb 16, 2022 at 3:52 PM Xuan Zhuo wrote: On Wed, 16 Feb 2022 12:14:31 +0800, Jason Wang wrote: On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: Sets the default maximum ring num based on

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-20 Thread Jason Wang
On Mon, Feb 21, 2022 at 11:46 AM Xuan Zhuo wrote: > > On Mon, 21 Feb 2022 11:32:52 +0800, Jason Wang wrote: > > On Fri, Feb 18, 2022 at 5:00 PM Xuan Zhuo > > wrote: > > > > > > On Thu, 17 Feb 2022 15:19:44 +0800, Jason Wang > > > wrote: >

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-20 Thread Jason Wang
On Mon, Feb 21, 2022 at 2:20 PM Xuan Zhuo wrote: > > On Mon, 21 Feb 2022 13:59:06 +0800, Xuan Zhuo > wrote: > > On Mon, 21 Feb 2022 11:53:33 +0800, Jason Wang wrote: > > > On Mon, Feb 21, 2022 at 11:46 AM Xuan Zhuo > > > wrote: > > > > > >

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-20 Thread Jason Wang
On Mon, Feb 21, 2022 at 2:45 PM Xuan Zhuo wrote: > > On Mon, 21 Feb 2022 14:37:49 +0800, Jason Wang wrote: > > On Mon, Feb 21, 2022 at 2:20 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 21 Feb 2022 13:59:06 +0800, Xuan Zhuo > > > wrote: > >

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-20 Thread Jason Wang
On Mon, Feb 21, 2022 at 2:48 PM Xuan Zhuo wrote: > > On Mon, 21 Feb 2022 14:37:49 +0800, Jason Wang wrote: > > On Mon, Feb 21, 2022 at 2:20 PM Xuan Zhuo > > wrote: > > > > > > On Mon, 21 Feb 2022 13:59:06 +0800, Xuan Zhuo > > > wrote: > >

Re: [PATCH v5 20/22] virtio_net: set the default max ring num

2022-02-20 Thread Jason Wang
在 2022/2/21 上午11:40, Jason Wang 写道: 在 2022/2/17 下午5:30, Xuan Zhuo 写道: On Thu, 17 Feb 2022 15:21:26 +0800, Jason Wang wrote: On Wed, Feb 16, 2022 at 3:52 PM Xuan Zhuo wrote: On Wed, 16 Feb 2022 12:14:31 +0800, Jason Wang wrote: On Mon, Feb 14, 2022 at 4:14 PM Xuan Zhuo wrote: Sets the

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-02-20 Thread Jason Wang
在 2022/2/18 上午1:13, Eugenio Perez Martin 写道: On Tue, Feb 8, 2022 at 4:58 AM Jason Wang wrote: 在 2022/2/1 上午2:58, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 5:03 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: First half of the buffers forwarding part, preparing vhost

Re: [PATCH 01/31] vdpa: Reorder virtio/vhost-vdpa.c functions

2022-02-20 Thread Jason Wang
在 2022/1/28 下午3:57, Eugenio Perez Martin 写道: On Fri, Jan 28, 2022 at 6:59 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: vhost_vdpa_set_features and vhost_vdpa_init need to use vhost_vdpa_get_features in svq mode. vhost_vdpa_dev_start needs to use almost all _set_ functions

Re: [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call

2022-02-20 Thread Jason Wang
在 2022/2/18 下午8:35, Eugenio Perez Martin 写道: On Tue, Feb 8, 2022 at 4:23 AM Jason Wang wrote: 在 2022/1/31 下午11:34, Eugenio Perez Martin 写道: On Sat, Jan 29, 2022 at 9:06 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-20 Thread Jason Wang
在 2022/2/17 下午8:48, Eugenio Perez Martin 写道: On Tue, Feb 8, 2022 at 9:16 AM Jason Wang wrote: 在 2022/2/1 下午7:25, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 7:47 AM Jason Wang wrote: 在 2022/1/22 上午4:27, Eugenio Pérez 写道: @@ -272,6 +590,28 @@ void vhost_svq_set_svq_kick_fd

Re: [PATCH] vhost: handle zero regions in vhost_set_memory

2022-02-20 Thread Jason Wang
On Mon, Feb 21, 2022 at 3:45 PM Anirudh Rayabharam wrote: > > Return early when userspace sends zero regions in the VHOST_SET_MEM_TABLE > ioctl. > > Otherwise, this causes an erroneous entry to be added to the iotlb. This > entry has a range size of 0 (due to u64 overflow). This then causes > iotl

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-21 Thread Jason Wang
On Tue, Feb 22, 2022 at 3:53 AM Anirudh Rayabharam wrote: > > In vhost_iotlb_add_range_ctx(), validate the range size is non-zero > before proceeding with adding it to the iotlb. > > Range size can overflow to 0 when start is 0 and last is (2^64 - 1). > One instance where it can happen is when use

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-02-21 Thread Jason Wang
On Tue, Feb 22, 2022 at 1:23 AM Eugenio Perez Martin wrote: > > On Mon, Feb 21, 2022 at 8:15 AM Jason Wang wrote: > > > > > > 在 2022/2/18 上午1:13, Eugenio Perez Martin 写道: > > > On Tue, Feb 8, 2022 at 4:58 AM Jason Wang wrote: > > >> > > >&g

Re: [PATCH] vdpa/mlx5: Enlarge queue size to 512 entries

2022-02-21 Thread Jason Wang
On Tue, Feb 22, 2022 at 3:00 AM Eugenio Perez Martin wrote: > > On Mon, Feb 21, 2022 at 2:20 PM Eli Cohen wrote: > > > > Currently we can work with 512 entries with any MTU size. Change > > MLX5_VDPA_MAX_VQ_ENTRIES accordingly. > > > > Signed-off-by: Eli Cohen > > --- > > drivers/vdpa/mlx5/net/

Re: [PATCH] tools/virtio: Test virtual address range detection

2022-02-21 Thread Jason Wang
On Tue, Feb 22, 2022 at 12:17 AM David Woodhouse wrote: > > As things stand, an application which wants to use vhost with a trivial > 1:1 mapping of its virtual address space is forced to jump through hoops > to detect what the address range might be. The VHOST_SET_MEM_TABLE ioctl > helpfully does

Re: [PATCH v1] virtio: Add definition for VIRTIO_F_NOTIFICATION_DATA feature flag

2022-02-21 Thread Jason Wang
On Mon, Feb 21, 2022 at 8:08 PM Eli Cohen wrote: > > This is required by iproute2 to display the capabilities of a vdpa based > virtio device. > > Signed-off-by: Eli Cohen > v0 -> v1: > Avoid modifying mcdi_pcol.h Acked-by: Jason Wang > --- > include/

Re: [PATCH v1 0/6] virtio: support advance DMA

2022-02-21 Thread Jason Wang
在 2022/2/21 下午7:23, Xuan Zhuo 写道: On Mon, 21 Feb 2022 11:32:52 +0800, Jason Wang wrote: On Fri, Feb 18, 2022 at 5:00 PM Xuan Zhuo wrote: On Thu, 17 Feb 2022 15:19:44 +0800, Jason Wang wrote: On Thu, Feb 10, 2022 at 4:51 PM Xuan Zhuo wrote: virtqueue_add() only supports virtual addresses

Re: [PATCH v1] net/mlx5: Add support for configuring max device MTU

2022-02-21 Thread Jason Wang
wed-by: Si-Wei Liu > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > v0 -> v1: > Update changelog > > drivers/vdpa/mlx5/net/mlx5_vnet.c | 32 ++- > 1 file changed, 31 insertions(+), 1 deletion(-) > > diff --git a/drivers/vdpa/mlx5/

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-21 Thread Jason Wang
On Tue, Feb 22, 2022 at 12:57 PM Anirudh Rayabharam wrote: > > On Tue, Feb 22, 2022 at 10:50:20AM +0800, Jason Wang wrote: > > On Tue, Feb 22, 2022 at 3:53 AM Anirudh Rayabharam > > wrote: > > > > > > In vhost_iotlb_add_range_ctx(), validate the range size

Re: [PATCH] vdpa/mlx5: Enlarge queue size to 512 entries

2022-02-21 Thread Jason Wang
On Tue, Feb 22, 2022 at 2:33 PM Eli Cohen wrote: > > On Tue, Feb 22, 2022 at 11:18:14AM +0800, Jason Wang wrote: > > On Tue, Feb 22, 2022 at 3:00 AM Eugenio Perez Martin > > wrote: > > > > > > On Mon, Feb 21, 2022 at 2:20 PM Eli Cohen wrote: > >

Re: [PATCH 09/31] vhost-vdpa: Take into account SVQ in vhost_vdpa_set_vring_call

2022-02-21 Thread Jason Wang
在 2022/2/21 下午4:01, Eugenio Perez Martin 写道: On Mon, Feb 21, 2022 at 8:39 AM Jason Wang wrote: 在 2022/2/18 下午8:35, Eugenio Perez Martin 写道: On Tue, Feb 8, 2022 at 4:23 AM Jason Wang wrote: 在 2022/1/31 下午11:34, Eugenio Perez Martin 写道: On Sat, Jan 29, 2022 at 9:06 AM Jason Wang wrote: 在

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-21 Thread Jason Wang
在 2022/2/21 下午4:15, Eugenio Perez Martin 写道: On Mon, Feb 21, 2022 at 8:44 AM Jason Wang wrote: 在 2022/2/17 下午8:48, Eugenio Perez Martin 写道: On Tue, Feb 8, 2022 at 9:16 AM Jason Wang wrote: 在 2022/2/1 下午7:25, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 7:47 AM Jason Wang wrote: 在

Re: [PATCH 28/31] vdpa: Expose VHOST_F_LOG_ALL on SVQ

2022-02-21 Thread Jason Wang
在 2022/2/17 下午4:22, Eugenio Perez Martin 写道: On Thu, Feb 17, 2022 at 7:02 AM Jason Wang wrote: On Wed, Feb 16, 2022 at 11:54 PM Eugenio Perez Martin wrote: On Tue, Feb 8, 2022 at 9:25 AM Jason Wang wrote: 在 2022/2/1 下午7:45, Eugenio Perez Martin 写道: On Sun, Jan 30, 2022 at 7:50 AM Jason

Re: [PATCH v3 4/4] vdpa: Support reading device features

2022-02-21 Thread Jason Wang
t;HOST_TSO6","STATUS","CTRL_VQ","MQ",\ > "CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ] > } > } > } > > Reviewed-by: Si-Wei Liu > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > vdpa/inc

Re: [PATCH v3 2/4] vdpa: Allow for printing negotiated features of a device

2022-02-21 Thread Jason Wang
t; > 3. Pretty json > $ vdpa -jp dev config show vdpa-a > { > "config": { > "vdpa-a": { > "mac": "00:00:00:00:88:88", > "link ": "up", > "link_announce ": f

Re: [PATCH 17/31] vdpa: adapt vhost_ops callbacks to svq

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 3:43 PM Eugenio Perez Martin wrote: > > On Tue, Feb 22, 2022 at 4:16 AM Jason Wang wrote: > > > > On Tue, Feb 22, 2022 at 1:23 AM Eugenio Perez Martin > > wrote: > > > > > > On Mon, Feb 21, 2022 at 8:15 AM Jason Wang wrote:

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-22 Thread Jason Wang
On Wed, Feb 23, 2022 at 3:01 AM Eugenio Perez Martin wrote: > > On Tue, Feb 8, 2022 at 9:11 AM Jason Wang wrote: > > > > > > 在 2022/2/2 上午1:08, Eugenio Perez Martin 写道: > > > On Sun, Jan 30, 2022 at 5:43 AM Jason Wang wrote: > > >> > > >&

Re: [PATCH] vhost: validate range size before adding to iotlb

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 11:02 PM Michael S. Tsirkin wrote: > > On Tue, Feb 22, 2022 at 03:11:07PM +0800, Jason Wang wrote: > > On Tue, Feb 22, 2022 at 12:57 PM Anirudh Rayabharam > > wrote: > > > > > > On Tue, Feb 22, 2022 at 10:50:20AM +0800, Jason Wang wrot

Re: [PATCH v2] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Jason Wang
.com > Reported-and-tested-by: syzbot+3140b17cb44a7b174...@syzkaller.appspotmail.com > Signed-off-by: Stefano Garzarella Acked-by: Jason Wang > --- > v2: > - initialized `ret` in vhost_vsock_stop [Dan] > - added comment about vhost_vsock_stop() calling in the code and an > e

Re: [PATCH] vhost: use bvec_kmap_local in {get,put}u16_iotlb

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 11:49 PM Christoph Hellwig wrote: > > Using local kmaps slightly reduces the chances to stray writes, and > the bvec interface cleans up the code a little bit. > > Signed-off-by: Christoph Hellwig Acked-by: Jason Wang > --- > driver

Re: [PATCH 18/31] vhost: Shadow virtqueue buffers forwarding

2022-02-22 Thread Jason Wang
On Tue, Feb 22, 2022 at 4:56 PM Eugenio Perez Martin wrote: > > On Tue, Feb 22, 2022 at 8:26 AM Jason Wang wrote: > > > > > > 在 2022/2/21 下午4:15, Eugenio Perez Martin 写道: > > > On Mon, Feb 21, 2022 at 8:44 AM Jason Wang wrote: > > >> >

<    5   6   7   8   9   10   11   12   13   14   >