Re: [PATCH 2/2] eni_vdpa: Simplify 'eni_vdpa_probe()'

2021-11-08 Thread Jason Wang
'pcim_release()'. > > Signed-off-by: Christophe JAILLET Acked-by: Jason Wang > --- > Leaving the 'pci_free_irq_vectors()' call is harmless. > --- > drivers/vdpa/alibaba/eni_vdpa.c | 12 > 1 file changed, 12 deletions(-) > > diff

Re: [PATCH] vhost-vdpa: clean irqs before reseting vdpa device

2021-11-14 Thread Jason Wang
a43) unregistration fails: -22 > > Signed-off-by: Wu Zongyong Acked-by: Jason Wang > --- > drivers/vhost/vdpa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c > index 01c59ce7e250..29cced1cd277 100644 >

Re: question about vdpa_mgmt_dev

2021-11-14 Thread Jason Wang
On Mon, Nov 15, 2021 at 2:08 PM Liu,Feng(INF) wrote: > > Hi Experts > I have read the upstream code about vdpa, and I notice that there is > a new struct vdpa_mgmt_dev have been added. > Every driver implements dev_add() interface, such as mlx5 use > mlx5_vdpa_dev_add(). This int

Re: [PATCH 6/6] vhost_net: use RCU callbacks instead of synchronize_rcu()

2021-11-15 Thread Jason Wang
On Mon, Nov 15, 2021 at 11:32 PM Andrey Ryabinin wrote: > > Currently vhost_net_release() uses synchronize_rcu() to synchronize > freeing with vhost_zerocopy_callback(). However synchronize_rcu() > is quite costly operation. It take more than 10 seconds > to shutdown qemu launched with couple net

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

2021-11-18 Thread Jason Wang
On Thu, Nov 18, 2021 at 1:58 PM Eli Cohen wrote: > > Add support for querying virtqueue statistics. Supported statistics are: > > Received_desc - number of descriptors received for the virtqueue > completed_desc - number of descriptors completed for the virtqueue > > A new callback was added to vd

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

2021-11-21 Thread Jason Wang
On Fri, Nov 19, 2021 at 11:09 AM Parav Pandit wrote: > > > > > From: Jason Wang > > Sent: Friday, November 19, 2021 8:12 AM > > > > On Thu, Nov 18, 2021 at 1:58 PM Eli Cohen wrote: > > > > > > Add support for querying virtqueue statistics.

Re: [PATCH 6/6] vhost_net: use RCU callbacks instead of synchronize_rcu()

2021-11-21 Thread Jason Wang
On Fri, Nov 19, 2021 at 7:31 PM Andrey Ryabinin wrote: > > > > On 11/16/21 8:00 AM, Jason Wang wrote: > > On Mon, Nov 15, 2021 at 11:32 PM Andrey Ryabinin > > wrote: > >> > >> Currently vhost_net_release() uses synchronize_rcu() to synchronize

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Jason Wang
On Fri, Nov 19, 2021 at 11:10 PM Halil Pasic wrote: > > On Wed, 27 Oct 2021 10:21:04 +0800 > Jason Wang wrote: > > > This patch validate the used buffer length provided by the device > > before trying to use it. This is done by record the in buffer length > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-21 Thread Jason Wang
On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > > On Mon, 22 Nov 2021 06:35:18 +0100 > Halil Pasic wrote: > > > > I think it should be a common issue, looking at > > > vhost_vsock_handle_tx_kick(), it did: > > > > > > len += sizeof(pkt->hdr); > > > vhost_add_used(vq, head, len); > > > > > >

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

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 3:56 PM Eli Cohen wrote: > > On Mon, Nov 22, 2021 at 10:30:12AM +0800, Jason Wang wrote: > > On Fri, Nov 19, 2021 at 11:09 AM Parav Pandit wrote: > > > > > > > > > > > > > From: Jason Wang > > > > Sent: F

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

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 5:08 PM Eli Cohen wrote: > > On Mon, Nov 22, 2021 at 04:07:24PM +0800, Jason Wang wrote: > > On Mon, Nov 22, 2021 at 3:56 PM Eli Cohen wrote: > > > > > > On Mon, Nov 22, 2021 at 10:30:12AM +0800, Jason Wang wrote: > > > > On

Re: [PATCH] vdpa_sim: avoid putting an uninitialized iova_domain

2021-11-22 Thread Jason Wang
initialized before > put it. > > In addition, we may get the following warning in this case: > WARNING: ... drivers/iommu/iova.c:344 iova_cache_put+0x58/0x70 > > So we must make sure the iova_cache_put() is invoked only if the > iova_cache_get() is already invoked. Let

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Jason Wang
On Tue, Nov 23, 2021 at 4:24 AM Halil Pasic wrote: > > On Mon, 22 Nov 2021 14:25:26 +0800 > Jason Wang wrote: > > > I think the fixes are: > > > > 1) fixing the vhost vsock > > 2) use suppress_used_validation=true to let vsock driver to validate > >

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

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 11:56 PM Parav Pandit wrote: > > > > > From: Eli Cohen > > Sent: Monday, November 22, 2021 8:37 PM > > > > On Mon, Nov 22, 2021 at 12:15:36PM +0200, Parav Pandit wrote: > > > > > > > > > > Fr

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-22 Thread Jason Wang
On Mon, Nov 22, 2021 at 9:50 PM Halil Pasic wrote: > > On Mon, 22 Nov 2021 14:25:26 +0800 > Jason Wang wrote: > > > On Mon, Nov 22, 2021 at 1:49 PM Halil Pasic wrote: > > > > > > On Mon, 22 Nov 2021 06:35:18 +0100 > > > Halil Pasic wrote: > &

Re: [PATCH] vdpa_sim: avoid putting an uninitialized iova_domain

2021-11-22 Thread Jason Wang
On Tue, Nov 23, 2021 at 11:12 AM Parav Pandit wrote: > > > > > From: Longpeng(Mike) > > Sent: Monday, November 22, 2021 5:52 PM > > > > From: Longpeng > > > > The system will crash if we put an uninitialized iova_domain, this could > > happen when an error occurs before initializing the iova_dom

Re: Kvm virtual machine uses virtio graphics card, the rotating screen is stuck

2021-11-22 Thread Jason Wang
On Tue, Nov 23, 2021 at 3:00 PM 苟浩 wrote: > > Hello, > > I use `xrandr -o left` to rotate the screen in the kvm virtual machine. > When configured as a Virtio graphics card, the screen will freeze after > rotating the screen, and the keyboard and mouse will not respond. > When configured as a VGA

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

2021-11-23 Thread Jason Wang
On Tue, Nov 23, 2021 at 2:42 PM Eli Cohen wrote: > > On Tue, Nov 23, 2021 at 10:28:04AM +0800, Jason Wang wrote: > > On Mon, Nov 22, 2021 at 11:56 PM Parav Pandit wrote: > > > > > > > > > > > > > From: Eli Cohen > > > > Sent: M

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-23 Thread Jason Wang
On Wed, Nov 24, 2021 at 9:30 AM Michael Ellerman wrote: > > "Michael S. Tsirkin" writes: > > On Tue, Nov 23, 2021 at 10:25:20AM +0800, Jason Wang wrote: > >> On Tue, Nov 23, 2021 at 4:24 AM Halil Pasic wrote: > >> > > >> > On M

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-23 Thread Jason Wang
On Wed, Nov 24, 2021 at 10:26 AM Jason Wang wrote: > > On Wed, Nov 24, 2021 at 9:30 AM Michael Ellerman wrote: > > > > "Michael S. Tsirkin" writes: > > > On Tue, Nov 23, 2021 at 10:25:20AM +0800, Jason Wang wrote: > > >> On Tue, Nov 23, 2021 at

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-23 Thread Jason Wang
On Wed, Nov 24, 2021 at 3:22 PM Michael S. Tsirkin wrote: > > On Wed, Nov 24, 2021 at 10:33:28AM +0800, Jason Wang wrote: > > On Wed, Nov 24, 2021 at 10:26 AM Jason Wang wrote: > > > > > > On Wed, Nov 24, 2021 at 9:30 AM Michael Ellerman > > > wro

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-24 Thread Jason Wang
On Wed, Nov 24, 2021 at 4:24 PM Michael S. Tsirkin wrote: > > On Wed, Nov 24, 2021 at 03:59:12PM +0800, Jason Wang wrote: > > On Wed, Nov 24, 2021 at 3:22 PM Michael S. Tsirkin wrote: > > > > > > On Wed, Nov 24, 2021 at 10:33:28AM +0800, Jason Wang wrote: > >

Re: [PATCH V5 1/4] virtio_ring: validate used buffer length

2021-11-24 Thread Jason Wang
On Wed, Nov 24, 2021 at 7:33 PM Halil Pasic wrote: > > On Wed, 24 Nov 2021 10:33:28 +0800 > Jason Wang wrote: > > > > > > Let's see how far we can get. But yes, maybe we were too aggressive in > > > > > breaking things by default, a warning mig

Re: [PATCH] net/mlx5_vdpa: Offer VIRTIO_NET_F_MTU when setting MTU

2021-11-24 Thread Jason Wang
by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c > b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index 465e832f2ad1..ed7a63e48335 100644 > --- a/drivers/vdpa/ml

Re: [PATCH] net/mlx5_vdpa: Increase the limit on the number of virtuques

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 1:20 AM Eli Cohen wrote: > > Increase the limit on the maximum number of supported virtqueues to 256 > to match hardware capabilities. > > Signed-off-by: Eli Cohen (A typo in the subject) Other than this: Acked-by: Jason Wang > --- >

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

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 12:56 AM Eli Cohen wrote: > > Add support for querying virtqueue statistics. Supported statistics are: > > received_desc - number of descriptors received for the virtqueue > completed_desc - number of descriptors completed for the virtqueue > > A descriptors using indirect

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

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 12:56 AM Eli Cohen wrote: > > Implement the get_vq_stats calback of vdpa_config_ops to return the > statistics for a virtqueue. > > Signed-off-by: Eli Cohen > --- > V0 -> V1: > Use mutex to sync stats query with change of number of queues > [...] > +static int mlx5_get_v

[PATCH net] virtio-net: enable big mode correctly

2021-11-24 Thread Jason Wang
negotiated. We can do optimization on top. Reported-by: Eli Cohen Cc: Eli Cohen Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7c43bfc1ce44..83ae3ef5eb11 100644

[PATCH] virtio-mmio: harden interrupt

2021-11-24 Thread Jason Wang
nabled variable and toggle it during in vm_disable/enable_interrupts(). The MMIO interrupt handler will check intr_soft_enabled before processing the actual interrupt. Signed-off-by: Jason Wang --- drivers/virtio/virtio_mmio.c | 37 1 file changed, 37 insertions

Re: [RFC] hypercall-vsock: add a new vsock transport

2021-11-24 Thread Jason Wang
On Thu, Nov 11, 2021 at 3:59 PM Wang, Wei W wrote: > > On Wednesday, November 10, 2021 6:50 PM, Michael S. Tsirkin wrote: > > On Wed, Nov 10, 2021 at 07:12:36AM +, Wang, Wei W wrote: > > > > hypercalls are fundamentally hypervisor dependent though. > > Yes, each hypervisor needs to support it.

Re: [PATCH net] virtio-net: enable big mode correctly

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 3:00 PM Michael S. Tsirkin wrote: > > On Thu, Nov 25, 2021 at 02:05:47PM +0800, Jason Wang wrote: > > When VIRTIO_NET_F_MTU feature is not negotiated, we assume a very > > large max_mtu. In this case, using small packet mode is not correct > >

Re: [PATCH net] virtio-net: enable big mode correctly

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 3:09 PM Eli Cohen wrote: > > On Thu, Nov 25, 2021 at 02:05:47PM +0800, Jason Wang wrote: > > When VIRTIO_NET_F_MTU feature is not negotiated, we assume a very > > large max_mtu. In this case, using small packet mode is not correct > > since it m

Re: [PATCH net] virtio-net: enable big mode correctly

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 3:15 PM Michael S. Tsirkin wrote: > > On Thu, Nov 25, 2021 at 03:11:58PM +0800, Jason Wang wrote: > > On Thu, Nov 25, 2021 at 3:00 PM Michael S. Tsirkin wrote: > > > > > > On Thu, Nov 25, 2021 at 02:05:47PM +0800, Jason Wang wrote: > >

Re: [PATCH net] virtio-net: enable big mode correctly

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 3:20 PM Eli Cohen wrote: > > On Thu, Nov 25, 2021 at 03:15:33PM +0800, Jason Wang wrote: > > On Thu, Nov 25, 2021 at 3:09 PM Eli Cohen wrote: > > > > > > On Thu, Nov 25, 2021 at 02:05:47PM +0800, Jason Wang wrote: > > > > When

Re: [PATCH net] virtio-net: enable big mode correctly

2021-11-24 Thread Jason Wang
On Thu, Nov 25, 2021 at 3:26 PM Michael S. Tsirkin wrote: > > On Thu, Nov 25, 2021 at 03:20:07PM +0800, Jason Wang wrote: > > On Thu, Nov 25, 2021 at 3:15 PM Michael S. Tsirkin wrote: > > > > > > On Thu, Nov 25, 2021 at 03:11:58PM +0800, Jason Wang wrote: > >

Re: [PATCH] vdpa: Consider device id larger than 31

2021-11-25 Thread Jason Wang
t > Reported-by: Dan Carpenter > Signed-off-by: Parav Pandit Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index 7332a74a4b00..e91c71aeeddf 100644

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

2021-11-25 Thread Jason Wang
On Thu, Nov 25, 2021 at 3:59 PM Eli Cohen wrote: > > On Thu, Nov 25, 2021 at 12:57:53PM +0800, Jason Wang wrote: > > On Thu, Nov 25, 2021 at 12:56 AM Eli Cohen wrote: > > > > > > Implement the get_vq_stats calback of vdpa_config_ops to return the &g

Re: [PATCH] virtio-mmio: harden interrupt

2021-11-25 Thread Jason Wang
e, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] Will fix this in V2. Thanks > > url: > https://github.com/0day-ci/linux/commits/Jason-Wang/virtio-mmio-harden-interrupt/202

[PATCH V2] virtio-mmio: harden interrupt

2021-11-25 Thread Jason Wang
nabled variable and toggle it during in vm_disable/enable_interrupts(). The MMIO interrupt handler will check intr_soft_enabled before processing the actual interrupt. Signed-off-by: Jason Wang --- Changes since V1: - Silent compling warnings drivers/virtio/vir

Re: [PATCH v2 1/2] docs: document sysfs ABI for vDPA bus

2021-11-28 Thread Jason Wang
On Sat, Nov 27, 2021 at 12:48 AM Stefano Garzarella wrote: > > Add missing documentation of sysfs ABI for vDPA bus in > the new Documentation/ABI/testing/sysfs-bus-vdpa file. > > Signed-off-by: Stefano Garzarella Acked-by: Jason Wang > --- > Documentation/ABI/testin

Re: [PATCH] virtio_ring: Fix querying of maximum DMA mapping size for virtio device

2021-12-01 Thread Jason Wang
2 bytes), total > 1024 (slots), used 725 (slots) > > Follow the pattern used elsewhere in the virtio_ring code when calling > into the DMA layer and pass the parent device to dma_max_mapping_size() > instead. > > Cc: Marc Zyngier > Cc: Quentin Perret > Cc: "Micha

Re: [PATCH 1/2] vdpa: Allow to configure max data virtqueues

2021-12-01 Thread Jason Wang
在 2021/12/1 下午6:09, Parav Pandit 写道: From: Eli Cohen Sent: Wednesday, December 1, 2021 3:33 PM On Tue, Nov 30, 2021 at 05:24:03PM -0800, Si-Wei Liu wrote: On 11/30/2021 1:48 AM, Eli Cohen wrote: Allow to configure the max virtqueues for a device. Signed-off-by: Eli Cohen --- drivers/

Re: [PATCH 2/7] vdpa/mlx5: Fix config_attr_mask assignment

2021-12-02 Thread Jason Wang
40c ("vdpa/mlx5: Support configuration of MAC") > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c > b/drivers/vdpa/mlx5/ne

Re: [PATCH 3/7] vdpa/mlx5: Support configuring max data virtqueue pairs

2021-12-02 Thread Jason Wang
On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen wrote: > > Check whether the max number of data virtqueue pairs was provided when a > adding a new device and verify the new value does not exceed device > capabilities. > > In addition, change the arrays holding virtqueue and callback contexts > to be dyna

Re: [PATCH 4/7] vdpa/mlx5: Report queried max supported virtqueues

2021-12-02 Thread Jason Wang
On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen wrote: > > Report back in get_vq_num_max() the correct number of virtqueues queried > from the device instead of using a constant value. > > Signed-off-by: Eli Cohen > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- > 1 file changed, 2 insertions(+), 2

Re: [PATCH 5/7] vdpa: Add support for querying control virtqueue index

2021-12-02 Thread Jason Wang
On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen wrote: > > Add netlink attribute and callback function to query the control VQ > index of a device. It's better to explain the motivation of this. Actually we can deduce it from the max_virtqueue_paris if I was not wrong. So it means the value varies depen

Re: [PATCH 7/7] vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps()

2021-12-02 Thread Jason Wang
On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen wrote: > > Restore ndev->cur_num_vqs to the original value in case change_num_qps() > fails. > > Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- >

Re: [PATCH] eni_vdpa: alibaba: select VIRTIO_PCI_LIB

2021-12-05 Thread Jason Wang
On Sat, Dec 4, 2021 at 2:55 AM Arnd Bergmann wrote: > > From: Arnd Bergmann > > When VIRTIO_PCI_LIB is not built-in but the alibaba driver is, the > kernel runs into a link error: > > x86_64-linux-ld: drivers/vdpa/alibaba/eni_vdpa.o: in function > `eni_vdpa_set_features': > eni_vdpa.c:(.text+0x2

Re: [PATCH 1/1] vduse: moving kvfree into caller

2021-12-06 Thread Jason Wang
On Mon, Dec 6, 2021 at 3:54 PM Guanjun wrote: > > From: Guanjun > > This free action should be moved into caller 'vduse_ioctl' in > concert with the allocation. > > No functional change. > > Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Does this fix a real problem? I

Re: [PATCH] eni_vdpa: alibaba: select VIRTIO_PCI_LIB

2021-12-06 Thread Jason Wang
On Mon, Dec 6, 2021 at 4:14 PM Arnd Bergmann wrote: > > On Mon, Dec 6, 2021 at 4:12 AM Jason Wang wrote: > > > > On Sat, Dec 4, 2021 at 2:55 AM Arnd Bergmann wrote: > > > > > > From: Arnd Bergmann > > > > > > When VIRTIO_PCI_LIB is not bui

Re: [PATCH 5/7] vdpa: Add support for querying control virtqueue index

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 3:57 PM Eli Cohen wrote: > > On Fri, Dec 03, 2021 at 10:35:30AM +0800, Jason Wang wrote: > > On Thu, Dec 2, 2021 at 3:58 AM Eli Cohen wrote: > > > > > > Add netlink attribute and callback function to query the control VQ > > > in

Re: [PATCH 3/7] vdpa/mlx5: Support configuring max data virtqueue pairs

2021-12-07 Thread Jason Wang
On Wed, Dec 8, 2021 at 7:16 AM Si-Wei Liu wrote: > > > > On 12/7/2021 12:19 AM, Eli Cohen wrote: > > On Thu, Dec 02, 2021 at 11:28:12PM -0800, Si-Wei Liu wrote: > >> > >> On 12/1/2021 11:57 AM, Eli Cohen wrote: > >>> Check whether the max number of data virtqueue pairs was provided when a > >>> ad

Re: [PATCH] vdpa: Provide means to read configured features

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 9:03 PM Eli Cohen wrote: > > Hi Jason, > > I noticed the lack of interface to get the currently configured > features. > > Does the below patch make sense to you? If so I can post it along with > a patch that implements the function for all current vdpa drivers. Yes. > > >

Re: [PATCH v3] vduse: vduse: check that offsets are within bounds

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 7:49 PM Dan Carpenter wrote: > > In vduse_dev_ioctl(), the "config.offset" comes from the user. There > needs to a check to prevent it being out of bounds. The "config.offset" > and "dev->config_size" variables are both type u32. So if the offset is > out of bounds then t

Re: [PATCH 1/7] vhost: get rid of vhost_poll_flush() wrapper

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 10:45 AM Mike Christie wrote: > > vhost_poll_flush() is a simple wrapper around vhost_work_dev_flush(). > It gives wrong impression that we are doing some work over vhost_poll, > while in fact it flushes vhost_poll->dev. This "problem" is a byproduct of 7235acdb1144 ("vhost

Re: [PATCH 5/7] vhost_vsock: simplify vhost_vsock_flush()

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 10:45 AM Mike Christie wrote: > > From: Andrey Ryabinin > > vhost_vsock_flush() calls vhost_work_dev_flush(vsock->vqs[i].poll.dev) > before vhost_work_dev_flush(&vsock->dev). This seems pointless > as vsock->vqs[i].poll.dev is the same as &vsock->dev and several flushes > i

Re: [PATCH 6/7] vhost-scsi: drop flush after vhost_dev_cleanup

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 10:45 AM Mike Christie wrote: > > The flush after vhost_dev_cleanup is not needed because: > > 1. It doesn't do anything. vhost_dev_cleanup will stop the worker thread > so the flush call will just return since the worker has not device. > > 2. It's not needed for the re-que

Re: [PATCH 7/7] vhost-test: drop flush after vhost_dev_cleanup

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 10:45 AM Mike Christie wrote: > > The flush after vhost_dev_cleanup is not needed because: > > 1. It doesn't do anything. vhost_dev_cleanup will stop the worker thread > so the flush call will just return since the worker has not device. > > 2. It's not needed. The comment a

Re: [PATCH V5 00/12] vhost: multiple worker support

2021-12-07 Thread Jason Wang
On Tue, Dec 7, 2021 at 10:51 AM Mike Christie wrote: > > The following patches apply over linus's tree and the user_worker > patchset here: > > https://lore.kernel.org/virtualization/20211129194707.5863-1-michael.chris...@oracle.com/T/#t It looks to me it gets some acks, maybe we need to nudge th

Re: [PATCH 5/7] vdpa: Add support for querying control virtqueue index

2021-12-07 Thread Jason Wang
On Wed, Dec 8, 2021 at 2:07 PM Eli Cohen wrote: > > On Wed, Dec 08, 2021 at 11:25:01AM +0800, Jason Wang wrote: > > On Tue, Dec 7, 2021 at 3:57 PM Eli Cohen wrote: > > > > > > On Fri, Dec 03, 2021 at 10:35:30AM +0800, Jason Wang wrote: > > > > On Th

Re: [PATCH 1/7] vhost: get rid of vhost_poll_flush() wrapper

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 12:41 AM Mike Christie wrote: > > On 12/7/21 9:49 PM, Jason Wang wrote: > > On Tue, Dec 7, 2021 at 10:45 AM Mike Christie > > wrote: > >> > >> vhost_poll_flush() is a simple wrapper around vhost_work_dev_flush(). > >> It gives

Re: [PATCH 6/7] vhost-scsi: drop flush after vhost_dev_cleanup

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 12:45 AM Mike Christie wrote: > > On 12/7/21 10:07 PM, Jason Wang wrote: > > On Tue, Dec 7, 2021 at 10:45 AM Mike Christie > > wrote: > >> > >> The flush after vhost_dev_cleanup is not needed because: > >> > >> 1. I

Re: [PATCH 5/7] vhost_vsock: simplify vhost_vsock_flush()

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 1:35 AM wrote: > > On 12/7/21 9:53 PM, Jason Wang wrote: > > On Tue, Dec 7, 2021 at 10:45 AM Mike Christie > > wrote: > >> > >> From: Andrey Ryabinin > >> > >> vhost_vsock_flush() calls vhost_work_dev_flush(vsock->

Re: [PATCH V2] virtio-mmio: harden interrupt

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 4:27 AM Michael S. Tsirkin wrote: > > On Fri, Nov 26, 2021 at 12:41:02PM +0800, Jason Wang wrote: > > This patch tries to make sure the virtio interrupt handler for MMIO > > won't be called after a reset and before virtio_device_ready(). We >

Re: [PATCH 1/2 v4] vduse: fix memory corruption in vduse_dev_ioctl()

2021-12-08 Thread Jason Wang
t;) > Signed-off-by: Dan Carpenter > --- > v2: fix reversed if statement > v3: fix vhost_vdpa_config_validate() as pointed out by Yongji Xie. > v4: split the vhost_vdpa_config_validate() change into a separate path Acked-by: Jason Wang > > drivers/vdpa/vdpa_user/vduse_dev.c | 3 ++- &g

Re: [PATCH 2/2 v4] vdpa: check that offsets are within bounds

2021-12-08 Thread Jason Wang
n -E2BIG. But on 32bit systems the subtraction is type > promoted to a high positive u32 value and basically any "c->len" is > accepted. > > Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") > Reported-by: Xie Yongji > Signed-off-by: Dan Carpe

Re: [PATCH v1 1/7] vdpa: Provide interface to read driver features

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 4:14 AM Eli Cohen wrote: > > Provide an interface to read the negotiated features. This is needed > when building the netlink message in vdpa_dev_net_config_fill(). > > Also fix the implementation of vdpa_dev_net_config_fill() to use the > negotiated features instead of the

Re: [PATCH v1 3/7] vdpa: Allow to configure max data virtqueues

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 8:25 AM Si-Wei Liu wrote: > > > > On 12/8/2021 12:14 PM, Eli Cohen wrote: > > Add netlink support to configure the max virtqueue pairs for a device. > > At least one pair is required. The maximum is dictated by the device. > > > > Example: > > > > $ vdpa dev add name vdpa-a

Re: [PATCH v1 5/7] vdpa/mlx5: Support configuring max data virtqueue pairs

2021-12-08 Thread Jason Wang
k contexts > to be dynamically allocated. > > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > v0->v1: > 1. Remove requirement to configure power of two virtqueue pairs > 2. Fix cleanup if kcalloc failed > > drivers/vdpa/mlx5/net/mlx5_vnet.c | 43

Re: [PATCH v1 6/7] vdpa: Add support for querying control virtqueue index

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 4:15 AM Eli Cohen wrote: > > Add netlink attribute and callback function to query the control VQ > index of a device. > > Example: > > $ vdpa dev config show vdpa-a > vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 5 \ > mtu 9000 ctrl_vq_idx 10 I

Re: [PATCH v1 6/7] vdpa: Add support for querying control virtqueue index

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 3:09 PM Eli Cohen wrote: > > On Thu, Dec 09, 2021 at 01:44:56PM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 4:15 AM Eli Cohen wrote: > > > > > > Add netlink attribute and callback function to query the control VQ > > >

Re: [PATCH v1 1/7] vdpa: Provide interface to read driver features

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 3:07 PM Eli Cohen wrote: > > On Thu, Dec 09, 2021 at 01:33:01PM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 4:14 AM Eli Cohen wrote: > > > > > > Provide an interface to read the negotiated features. This is needed > > &g

Re: [PATCH V2] virtio-mmio: harden interrupt

2021-12-08 Thread Jason Wang
On Thu, Dec 9, 2021 at 2:55 PM Michael S. Tsirkin wrote: > > On Thu, Dec 09, 2021 at 10:06:34AM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 4:27 AM Michael S. Tsirkin wrote: > > > > > > On Fri, Nov 26, 2021 at 12:41:02PM +0800, Jason Wang wrote: > > &

Re: [PATCH v1 6/7] vdpa: Add support for querying control virtqueue index

2021-12-09 Thread Jason Wang
On Thu, Dec 9, 2021 at 4:04 PM Eli Cohen wrote: > > On Thu, Dec 09, 2021 at 03:55:48PM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 3:09 PM Eli Cohen wrote: > > > > > > On Thu, Dec 09, 2021 at 01:44:56PM +0800, Jason Wang wrote: > > > > On Th

Re: [PATCH v1 6/7] vdpa: Add support for querying control virtqueue index

2021-12-09 Thread Jason Wang
On Thu, Dec 9, 2021 at 4:26 PM Eli Cohen wrote: > > On Thu, Dec 09, 2021 at 04:17:22PM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 4:04 PM Eli Cohen wrote: > > > > > > On Thu, Dec 09, 2021 at 03:55:48PM +0800, Jason Wang wrote: > > > > On Th

Re: [PATCH v1 6/7] vdpa: Add support for querying control virtqueue index

2021-12-09 Thread Jason Wang
On Thu, Dec 9, 2021 at 5:21 PM Eli Cohen wrote: > > On Thu, Dec 09, 2021 at 05:12:01PM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 4:26 PM Eli Cohen wrote: > > > > > > On Thu, Dec 09, 2021 at 04:17:22PM +0800, Jason Wang wrote: > > > > On Th

Re: [PATCH v1 3/7] vdpa: Allow to configure max data virtqueues

2021-12-09 Thread Jason Wang
On Fri, Dec 10, 2021 at 5:51 AM Si-Wei Liu wrote: > > > > On 12/8/2021 9:36 PM, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 8:25 AM Si-Wei Liu wrote: > >> > >> > >> On 12/8/2021 12:14 PM, Eli Cohen wrote: > >>> Add netlink support to

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-12 Thread Jason Wang
buf, len); > > > > I can post a patch to fix 2) if there's consensus already reached. > > > > Thanks, > > -Siwei > > I'm not sure how important it is to change that. > In any case it only affects transitional devices, right? > Legacy only should not car

Re: [PATCH v1 6/7] vdpa: Add support for querying control virtqueue index

2021-12-12 Thread Jason Wang
On Thu, Dec 9, 2021 at 5:21 PM Eli Cohen wrote: > > On Thu, Dec 09, 2021 at 05:12:01PM +0800, Jason Wang wrote: > > On Thu, Dec 9, 2021 at 4:26 PM Eli Cohen wrote: > > > > > > On Thu, Dec 09, 2021 at 04:17:22PM +0800, Jason Wang wrote: > > > > On Th

Re: [PATCH] virtio-net: make copy len check in xdp_linearize_page

2021-12-12 Thread Jason Wang
On Mon, Dec 13, 2021 at 12:50 PM wrote: > > From: mengensun > > xdp_linearize_page asume ring elem size is smaller then page size > when copy the first ring elem, but, there may be a elem size bigger > then page size. > > add_recvbuf_mergeable may add a hole to ring elem, the hole size is > not s

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-13 Thread Jason Wang
On Mon, Dec 13, 2021 at 4:07 PM Michael S. Tsirkin wrote: > > On Mon, Dec 13, 2021 at 11:02:39AM +0800, Jason Wang wrote: > > On Sun, Dec 12, 2021 at 5:26 PM Michael S. Tsirkin wrote: > > > > > > On Fri, Dec 10, 2021 at 05:44:15PM -0800, Si-Wei Liu wrote: > >

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-13 Thread Jason Wang
transitional devices, right? > > Legacy only should not care ... > Yes I'd like to distinguish legacy driver (suppose it is 0.95) against > the modern one in a transitional device model rather than being legacy > only. That way a v0.95 and v1.0 supporting vdpa parent can support

Re: [PATCH] virtio-net: make copy len check in xdp_linearize_page

2021-12-13 Thread Jason Wang
On Mon, Dec 13, 2021 at 5:14 PM 孙蒙恩 wrote: > > Jason Wang 于2021年12月13日周一 15:49写道: > > > > On Mon, Dec 13, 2021 at 12:50 PM wrote: > > > > > > From: mengensun > > > > > > xdp_linearize_page asume ring elem size is smaller then page size &g

Re: [PATCH v2 00/10] Allow for configuring max number of virtqueue pairs

2021-12-13 Thread Jason Wang
On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen wrote: > > Allow the user to configure the max number of virtqueue pairs for a vdpa > instance. The user can then control the actual number of virtqueue pairs > using ethtool. > > Example, set number of VQPs to 2: > $ ethtool -L ens1 combined 2 > > A user

Re: [PATCH v2 01/10] vdpa: Provide interface to read driver features

2021-12-13 Thread Jason Wang
r_features to return the negotiated features and > add implementation to all the upstream drivers. > > Signed-off-by: Eli Cohen > - > v1 -> v2: > 1. Fix to call vp_modern_get_driver_features() in >vp_vdpa_get_driver_features

Re: [PATCH v2 03/10] vdpa: Read device configuration only if FEATURES_OK

2021-12-13 Thread Jason Wang
On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen wrote: > > Avoid reading device configuration during feature negotiation. Read > device status and verify that VIRTIO_CONFIG_S_FEATURES_OK is set. > Otherwise, return -EAGAIN. > > Signed-off-by: Eli Cohen > --- > drivers/vdpa/vdpa.c | 7 +++ > 1

Re: [PATCH v2 07/10] vdpa: Add support for returning device configuration information

2021-12-13 Thread Jason Wang
On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen wrote: > > Add netlink attribute to store flags indicating current state of the > device. > In addition, introduce a flag to indicate whether control virtqueue is > used. > > This indication can be retrieved by: > > vdpa dev config show vdpa-a > vdpa-a: m

Re: [PATCH] virtio-net: make copy len check in xdp_linearize_page

2021-12-13 Thread Jason Wang
On Tue, Dec 14, 2021 at 11:48 AM 孙蒙恩 wrote: > > Jason Wang 于2021年12月14日周二 11:13写道: > > > > On Mon, Dec 13, 2021 at 5:14 PM 孙蒙恩 wrote: > > > > > > Jason Wang 于2021年12月13日周一 15:49写道: > > > > > > > > On Mon, Dec 13,

Re: [PATCH v2 00/10] Allow for configuring max number of virtqueue pairs

2021-12-13 Thread Jason Wang
On Tue, Dec 14, 2021 at 12:11 PM Parav Pandit wrote: > > > > From: Jason Wang > > Sent: Tuesday, December 14, 2021 8:47 AM > > > > A question, consider the parent support both net and block, if user use > > > > vdpa dev add name vdpa-a mgmtdev auxiliary/

Re: [PATCH v2 03/10] vdpa: Read device configuration only if FEATURES_OK

2021-12-14 Thread Jason Wang
On Tue, Dec 14, 2021 at 3:14 PM Eli Cohen wrote: > > On Tue, Dec 14, 2021 at 11:44:06AM +0800, Jason Wang wrote: > > On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen wrote: > > > > > > Avoid reading device configuration during feature negotiation. Read >

Re: [PATCH v2 00/10] Allow for configuring max number of virtqueue pairs

2021-12-14 Thread Jason Wang
On Tue, Dec 14, 2021 at 3:32 PM Eli Cohen wrote: > > On Tue, Dec 14, 2021 at 11:17:00AM +0800, Jason Wang wrote: > > On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen wrote: > > > > > > Allow the user to configure the max number of virtqueue pairs for a vdpa > > &

Re: [PATCH v2 07/10] vdpa: Add support for returning device configuration information

2021-12-14 Thread Jason Wang
On Tue, Dec 14, 2021 at 3:17 PM Eli Cohen wrote: > > On Tue, Dec 14, 2021 at 12:05:38PM +0800, Jason Wang wrote: > > On Mon, Dec 13, 2021 at 10:43 PM Eli Cohen wrote: > > > > > > Add netlink attribute to store flags indicating current state of the > > >

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-14 Thread Jason Wang
orting vdpa parent can support both types of > >> guests without having to reconfigure. Or are you suggesting limit to legacy > >> only at the time of vdpa creation would simplify the implementation a lot? > >> > >> Thanks, > >> -Siwei > > > > I

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-15 Thread Jason Wang
On Thu, Dec 16, 2021 at 10:02 AM Si-Wei Liu wrote: > > > > On 12/15/2021 1:33 PM, Michael S. Tsirkin wrote: > > On Wed, Dec 15, 2021 at 12:52:20PM -0800, Si-Wei Liu wrote: > >> > >> On 12/14/2021 6:06 PM, Jason Wang wrote: > >>> On Wed, Dec 15, 202

Re: [RFC PATCH] virtio: do not reset stateful devices on resume

2021-12-15 Thread Jason Wang
On Thu, Dec 16, 2021 at 1:27 AM Mikhail Golubev wrote: > > The 12/14/2021 18:26, Michael S. Tsirkin wrote: > > On Tue, Dec 14, 2021 at 05:33:05PM +0100, Mikhail Golubev wrote: > > > From: Anton Yakovlev > > > > > > We assume that stateful devices can maintain their state while > > > suspended. An

Re: [PATCH] virtio_net: fix rx_drops stat for small pkts

2021-12-15 Thread Jason Wang
On Thu, Dec 16, 2021 at 11:12 AM Wenliang Wang wrote: > > We found the stat of rx drops for small pkts does not increment when > build_skb fail, it's not coherent with other mode's rx drops stat. > > Signed-off-by: Wenliang Wang Acked-by: Jason Wang > --- >

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-15 Thread Jason Wang
On Thu, Dec 16, 2021 at 4:52 AM Si-Wei Liu wrote: > > > > On 12/14/2021 6:06 PM, Jason Wang wrote: > > On Wed, Dec 15, 2021 at 9:05 AM Si-Wei Liu wrote: > >> > >> > >> On 12/13/2021 9:06 PM, Michael S. Tsirkin wrote: > >>> On Mon, Dec 13,

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-16 Thread Jason Wang
On Fri, Dec 17, 2021 at 6:32 AM Si-Wei Liu wrote: > > > > On 12/15/2021 6:53 PM, Jason Wang wrote: > > On Thu, Dec 16, 2021 at 10:02 AM Si-Wei Liu wrote: > >> > >> > >> On 12/15/2021 1:33 PM, Michael S. Tsirkin wrote: > >>> On Wed, Dec 15,

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-16 Thread Jason Wang
On Fri, Dec 17, 2021 at 9:08 AM Si-Wei Liu wrote: > > > > On 12/15/2021 7:43 PM, Jason Wang wrote: > > On Thu, Dec 16, 2021 at 4:52 AM Si-Wei Liu wrote: > >> > >> > >> On 12/14/2021 6:06 PM, Jason Wang wrote: > >>> On Wed, Dec 15, 2021 at

Re: vdpa legacy guest support (was Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero)

2021-12-16 Thread Jason Wang
On Fri, Dec 17, 2021 at 10:01 AM Michael S. Tsirkin wrote: > > On Fri, Dec 17, 2021 at 09:57:38AM +0800, Jason Wang wrote: > > On Fri, Dec 17, 2021 at 6:32 AM Si-Wei Liu wrote: > > > > > > > > > > > > On 12/15/2021 6:53 PM, Jason Wang wrote: >

<    3   4   5   6   7   8   9   10   11   12   >