Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-28 Thread Jason Wang
On Tue, Sep 27, 2022 at 5:41 PM Si-Wei Liu wrote: > > > > On 9/26/2022 8:59 PM, Jason Wang wrote: > > On Tue, Sep 27, 2022 at 9:02 AM Si-Wei Liu wrote: > > > On 9/26/2022 12:11 AM, Jason Wang wrote: > > On Sat, Sep 24, 2022 at 4:01 AM Si-Wei Liu wrote: >

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-28 Thread Jason Wang
On Tue, Sep 27, 2022 at 6:01 PM Si-Wei Liu wrote: > > > > On 9/26/2022 9:07 PM, Jason Wang wrote: > > On Tue, Sep 27, 2022 at 11:59 AM Jason Wang wrote: > > On Tue, Sep 27, 2022 at 9:02 AM Si-Wei Liu wrote: > > > On 9/26/2022 12:11 AM, Jason Wang wrote: >

Re: [PATCH v3] virtio_pci: avoid to request intx irq if pin is zero

2022-09-28 Thread Jason Wang
On Wed, Sep 28, 2022 at 6:47 PM Angus Chen wrote: > > The background is that we use dpu in cloud computing,the arch is x86,80 > cores.We will have a lots of virtio devices,like 512 or more. > When we probe about 200 virtio_blk devices,it will fail and > the stack is print as follows: Not for

[PATCH V3 3/3] vp_vdpa: support feature provisioning

2022-09-27 Thread Jason Wang
dev1 mgmtdev pci/:02:00.0 device_features 0x30002 # dev1: mac 52:54:00:12:34:56 link up link_announce false mtu 65535 negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Reviewed-by: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/virtio_pci/vp_vdpa.c | 22

[PATCH V3 2/3] vdpa_sim_net: support feature provisioning

2022-09-27 Thread Jason Wang
negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Reviewed-by: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 12 +++- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3 ++- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim_net.c

[PATCH V3 0/3] vdpa: device feature provisioning

2022-09-27 Thread Jason Wang
to provision vp_vdpa device features Changes since V1: - Add vdpa tool command output Please review. Jason Wang (3): vdpa: device feature provisioning vdpa_sim_net: support feature provisioning vp_vdpa: support feature provisioning drivers/vdpa/vdpa.c | 5 + drivers

[PATCH V3 1/3] vdpa: device feature provisioning

2022-09-27 Thread Jason Wang
migration. - Better debug-ability for vDPA framework and parent. Reviewed-by: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/vdpa.c | 5 + include/linux/vdpa.h | 1 + include/uapi/linux/vdpa.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/vdpa/vdpa.c b/drivers

Re: [PATCH V2 RESEND 5/6] vDPA: fix spars cast warning in vdpa_dev_net_mq_config_fill

2022-09-26 Thread Jason Wang
On Tue, Sep 27, 2022 at 11:10 AM Zhu Lingshan wrote: > > This commit fixes spars warnings: cast to restricted __le16 > in function vdpa_dev_net_mq_config_fill() > > Signed-off-by: Zhu Lingshan Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 3 ++- > 1 file cha

Re: [PATCH V2 RESEND 4/6] vDPA: check virtio device features to detect MQ

2022-09-26 Thread Jason Wang
On Tue, Sep 27, 2022 at 11:09 AM Zhu Lingshan wrote: > > vdpa_dev_net_mq_config_fill() should checks device features > for MQ than driver features. > > Signed-off-by: Zhu Lingshan Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 2 +- > 1 file changed, 1

Re: [PATCH V2 RESEND 3/6] vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence

2022-09-26 Thread Jason Wang
gt; unused parameter struct vdpa_device *vdev is removed > > Signed-off-by: Zhu Lingshan Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > index e776595330

Re: [PATCH V2 RESEND 2/6] vDPA: only report driver features if FEATURES_OK is set

2022-09-26 Thread Jason Wang
On Tue, Sep 27, 2022 at 11:09 AM Zhu Lingshan wrote: > > This commit reports driver features to user space > only after FEATURES_OK is features negotiation is done. > > Signed-off-by: Zhu Lingshan > --- > drivers/vdpa/vdpa.c | 22 -- > 1 file changed, 16 insertions(+), 6

Re: [PATCH V2 RESEND 1/6] vDPA: allow userspace to query features of a vDPA device

2022-09-26 Thread Jason Wang
On Tue, Sep 27, 2022 at 11:09 AM Zhu Lingshan wrote: > > This commit adds a new vDPA netlink attribution > VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES. Userspace can query > features of vDPA devices through this new attr. > > This commit invokes vdpa_config_ops.get_config() > rather than

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-26 Thread Jason Wang
On Tue, Sep 27, 2022 at 11:59 AM Jason Wang wrote: > > On Tue, Sep 27, 2022 at 9:02 AM Si-Wei Liu wrote: > > > > > > > > On 9/26/2022 12:11 AM, Jason Wang wrote: > > > > On Sat, Sep 24, 2022 at 4:01 AM Si-Wei Liu wrote: > > > > > >

Re: [PATCH] virtio_ring: remove unnecessary to_vvq() call

2022-09-26 Thread Jason Wang
On Mon, Sep 26, 2022 at 5:11 PM Bo Liu wrote: > > It passes '_vq' to vring_free(), which still calls to_vvq() > to get 'vq', let's directly pass 'vq'. It can avoid > unnecessary call of to_vvq() in hot path. > > Signed-off-by: Bo Liu Acked-by: Jason Wang > --- > driv

Re: [PATCH] virtio_ring: Drop unnecessary initialization of detach_buf_packed

2022-09-26 Thread Jason Wang
On Mon, Sep 26, 2022 at 7:15 PM Deming Wang wrote: > > The variable is initialized but it is only used after its assignment. > > Signed-off-by: Deming Wang Acked-by: Jason Wang > --- > drivers/virtio/virtio_ring.c | 2 +- > 1 file changed, 1 insertion(+), 1 delet

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-26 Thread Jason Wang
On Tue, Sep 27, 2022 at 9:02 AM Si-Wei Liu wrote: > > > > On 9/26/2022 12:11 AM, Jason Wang wrote: > > On Sat, Sep 24, 2022 at 4:01 AM Si-Wei Liu wrote: > > > On 9/21/2022 7:43 PM, Jason Wang wrote: > > This patch implements features provisioning fo

Re: [PATCH V2 3/3] vp_vdpa: support feature provisioning

2022-09-26 Thread Jason Wang
On Sat, Sep 24, 2022 at 4:11 AM Si-Wei Liu wrote: > > > > On 9/21/2022 7:43 PM, Jason Wang wrote: > > This patch allows the device features to be provisioned via > > netlink. This is done by: > > > > 1) validating the provisioned features to be a subset o

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-26 Thread Jason Wang
On Mon, Sep 26, 2022 at 3:11 PM Jason Wang wrote: > > On Sat, Sep 24, 2022 at 4:01 AM Si-Wei Liu wrote: > > > > > > > > On 9/21/2022 7:43 PM, Jason Wang wrote: > > > This patch implements features provisioning for vdpa_sim_net. > > > > > &

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-26 Thread Jason Wang
On Sat, Sep 24, 2022 at 4:01 AM Si-Wei Liu wrote: > > > > On 9/21/2022 7:43 PM, Jason Wang wrote: > > This patch implements features provisioning for vdpa_sim_net. > > > > 1) validating the provisioned features to be a subset of the parent > > fe

Re: [PATCH v1] vdpa/ifcvf: avoid waste ioremap area of vdpa hot migration

2022-09-22 Thread Jason Wang
On Fri, Sep 23, 2022 at 12:22 PM Zhu, Lingshan wrote: > > > > On 9/23/2022 12:18 PM, Jason Wang wrote: > > On Fri, Sep 23, 2022 at 12:15 PM Zhu, Lingshan > > wrote: > >> > >> > >> On 9/23/2022 12:09 PM, Jason Wang wrote: > >>

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-22 Thread Jason Wang
On Thu, Sep 22, 2022 at 1:14 PM Eli Cohen wrote: > > > From: Jason Wang > > Sent: Thursday, 22 September 2022 5:43 > > To: m...@redhat.com; jasow...@redhat.com > > Cc: Eli Cohen ; si-wei@oracle.com; Parav Pandit > > ; wuzongy...@linux.alibaba.co

Re: [PATCH v1] vdpa/ifcvf: avoid waste ioremap area of vdpa hot migration

2022-09-22 Thread Jason Wang
On Fri, Sep 23, 2022 at 12:15 PM Zhu, Lingshan wrote: > > > > On 9/23/2022 12:09 PM, Jason Wang wrote: > > On Fri, Sep 23, 2022 at 11:53 AM Angus Chen > > wrote: > >> The array capacity should be queuepair, > > If this is true, we need a better na

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-22 Thread Jason Wang
On Thu, Sep 22, 2022 at 5:12 PM Michael S. Tsirkin wrote: > > On Thu, Sep 22, 2022 at 08:01:23AM +, Eli Cohen wrote: > > > From: Michael S. Tsirkin > > > Sent: Thursday, 22 September 2022 10:53 > > > To: Eli Cohen > > > Cc: Jason Wang ; si-wei...

Re: [PATCH] vDPA/ifcvf: fix the Calculation of queuepair

2022-09-22 Thread Jason Wang
On Thu, Sep 22, 2022 at 7:00 PM Angus Chen wrote: > > The queuepair should be divided by 2 > It should not be hw->nr_vring when multi-queue feature was enabled > fix commit 2ddae773c93b ("detect and use the onboard number ") > > Signed-off-by: Angus Chen Fixed tags should be placed above SOB.

Re: [PATCH v1] vdpa/ifcvf: avoid waste ioremap area of vdpa hot migration

2022-09-22 Thread Jason Wang
On Fri, Sep 23, 2022 at 11:53 AM Angus Chen wrote: > > The array capacity should be queuepair, If this is true, we need a better name for the ifcvf_vring_lm_cfg structure. Thanks > and the queuepairs should > be half of IFCVF_MAX_QUEUES without control queue, > or should be

Re: [PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-22 Thread Jason Wang
On Thu, Sep 22, 2022 at 5:23 PM Stefano Garzarella wrote: > > On Thu, Sep 22, 2022 at 10:43:04AM +0800, Jason Wang wrote: > >This patch implements features provisioning for vdpa_sim_net. > > > >1) validating the provisioned features to be a subset of the parent > &

[PATCH V2 3/3] vp_vdpa: support feature provisioning

2022-09-21 Thread Jason Wang
dev1 mgmtdev pci/:02:00.0 device_features 0x30002 # dev1: mac 52:54:00:12:34:56 link up link_announce false mtu 65535 negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Reviewed-by: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/virtio_pci/vp_vdpa.c | 16 ++-- 1

[PATCH V2 2/3] vdpa_sim_net: support feature provisioning

2022-09-21 Thread Jason Wang
negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Reviewed-by: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim

[PATCH V2 1/3] vdpa: device feature provisioning

2022-09-21 Thread Jason Wang
migration. - Better debug-ability for vDPA framework and parent. Reviewed-by: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/vdpa.c | 5 + include/linux/vdpa.h | 1 + include/uapi/linux/vdpa.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/vdpa/vdpa.c b/drivers

[PATCH V2 0/3] vdpa: device feature provisioning

2022-09-21 Thread Jason Wang
: - Add vdpa tool command output Please review. Thanks Jason Wang (3): vdpa: device feature provisioning vdpa_sim_net: support feature provisioning vp_vdpa: support feature provisioning drivers/vdpa/vdpa.c | 5 + drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 11

Re: [PATCH v6 2/2] virtio-net: use mtu size as buffer length for big packets

2022-09-21 Thread Jason Wang
-by: Gavi Teitz Reviewed-by: Parav Pandit Reviewed-by: Xuan Zhuo Reviewed-by: Si-Wei Liu Acked-by: Jason Wang --- changelog: v5->v6 - Addressed comments from Jason and Michael S. Tsirkin - Remove wrong commit log description - Rename virtnet_set_big_packets_fie

Re: [PATCH v6 1/2] virtio-net: introduce and use helper function for guest gso support checks

2022-09-21 Thread Jason Wang
在 2022/9/14 22:49, Gavin Li 写道: Probe routine is already several hundred lines. Use helper function for guest gso support check. Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Reviewed-by: Parav Pandit Reviewed-by: Xuan Zhuo Reviewed-by: Si-Wei Liu Acked-by: Jason Wang

Re: [PATCH 0/3] vdpa: device feature provisioning

2022-09-21 Thread Jason Wang
On Wed, Sep 21, 2022 at 3:17 AM Parav Pandit wrote: > > Hi Jason, > > > From: Jason Wang > > Sent: Thursday, September 15, 2022 4:51 AM > > To: m...@redhat.com; jasow...@redhat.com > > Cc: Eli Cohen ; si-wei@oracle.com; Parav Pandit > > ; wuzongy..

Re: [PATCH 1/4] vDPA: allow userspace to query features of a vDPA device

2022-09-21 Thread Jason Wang
On Wed, Sep 21, 2022 at 2:00 PM Zhu, Lingshan wrote: > > > > On 9/21/2022 10:17 AM, Jason Wang wrote: > > On Tue, Sep 20, 2022 at 5:58 PM Zhu, Lingshan > > wrote: > >> > >> > >> On 9/20/2022 10:02 AM, Jason Wang wrote: > >>

Re: [PATCH 2/4] vDPA: only report driver features if FEATURES_OK is set

2022-09-21 Thread Jason Wang
On Wed, Sep 21, 2022 at 1:39 PM Zhu, Lingshan wrote: > > > > On 9/21/2022 10:14 AM, Jason Wang wrote: > > On Tue, Sep 20, 2022 at 1:46 PM Zhu, Lingshan > > wrote: > >> > >> > >> On 9/20/2022 10:16 AM, Jason Wang wrote: > >>

Re: [PATCH 1/4] vDPA: allow userspace to query features of a vDPA device

2022-09-20 Thread Jason Wang
On Tue, Sep 20, 2022 at 5:58 PM Zhu, Lingshan wrote: > > > > On 9/20/2022 10:02 AM, Jason Wang wrote: > > On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > >> This commit adds a new vDPA netlink attribution > >> VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES. Users

Re: [PATCH 2/4] vDPA: only report driver features if FEATURES_OK is set

2022-09-20 Thread Jason Wang
On Tue, Sep 20, 2022 at 1:46 PM Zhu, Lingshan wrote: > > > > On 9/20/2022 10:16 AM, Jason Wang wrote: > > On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > >> vdpa_dev_net_config_fill() should only report driver features > >> to userspace after features n

Re: [PATCH 4/4] vDPA: Conditionally read MTU and MAC in dev cfg space

2022-09-19 Thread Jason Wang
itionally on the feature bits. > > Signed-off-by: Zhu Lingshan Acked-by: Jason Wang > --- > drivers/vdpa/vdpa.c | 37 + > 1 file changed, 29 insertions(+), 8 deletions(-) > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdp

Re: [PATCH 3/4] vDPA: check VIRTIO_NET_F_RSS for max_virtqueue_paris's presence

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > virtio 1.2 spec says: > max_virtqueue_pairs only exists if VIRTIO_NET_F_MQ or > VIRTIO_NET_F_RSS is set. > > So when reporint MQ to userspace, it should check both > VIRTIO_NET_F_MQ and VIRTIO_NET_F_RSS. > > This commit also fixes: > 1) a

Re: [PATCH 2/4] vDPA: only report driver features if FEATURES_OK is set

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > vdpa_dev_net_config_fill() should only report driver features > to userspace after features negotiation is done. > > Signed-off-by: Zhu Lingshan > --- > drivers/vdpa/vdpa.c | 13 + > 1 file changed, 9 insertions(+), 4

Re: [PATCH 1/4] vDPA: allow userspace to query features of a vDPA device

2022-09-19 Thread Jason Wang
On Fri, Sep 9, 2022 at 5:05 PM Zhu Lingshan wrote: > > This commit adds a new vDPA netlink attribution > VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES. Userspace can query > features of vDPA devices through this new attr. > > This commit invokes vdpa_config_ops.get_config() than >

Re: [PATCH 3/3] vp_vdpa: support feature provisioning

2022-09-19 Thread Jason Wang
On Mon, Sep 19, 2022 at 3:05 PM Eli Cohen wrote: > > > From: Jason Wang > > Sent: Thursday, 15 September 2022 11:51 > > To: m...@redhat.com; jasow...@redhat.com > > Cc: Eli Cohen ; si-wei@oracle.com; Parav Pandit > > ; wuzongy...@linux.alibaba.co

[PATCH 3/3] vp_vdpa: support feature provisioning

2022-09-15 Thread Jason Wang
This patch allows the device features to be provisioned via netlink. This is done by: 1) validating the provisioned features to be a subset of the parent features. 2) clearing the features that is not wanted by the userspace Signed-off-by: Jason Wang --- drivers/vdpa/virtio_pci/vp_vdpa.c

[PATCH 2/3] vdpa_sim_net: support feature provisioning

2022-09-15 Thread Jason Wang
This patch implements features provisioning for vdpa_sim_net. 1) validating the provisioned features to be a subset of the parent features. 2) clearing the features that is not wanted by the userspace Signed-off-by: Jason Wang --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 11 ++- 1

[PATCH 1/3] vdpa: device feature provisioning

2022-09-15 Thread Jason Wang
migration. - Better debug-ability for vDPA framework and parent. Signed-off-by: Jason Wang --- drivers/vdpa/vdpa.c | 5 + include/linux/vdpa.h | 1 + include/uapi/linux/vdpa.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index

[PATCH 0/3] vdpa: device feature provisioning

2022-09-15 Thread Jason Wang
. Thanks Jason Wang (3): vdpa: device feature provisioning vdpa_sim_net: support feature provisioning vp_vdpa: support feature provisioning drivers/vdpa/vdpa.c | 5 + drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 11 ++- drivers/vdpa/virtio_pci/vp_vdpa.c| 16

Re: [PATCH] vdpa/mlx5: Fix MQ to support non power of two num queues

2022-09-13 Thread Jason Wang
ithout this patch, attempt to create a device with non power of two QPs > would result in error from firmware. > > Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") > Signed-off-by: Eli Cohen Acked-by: Jason Wang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.

Re: [Q] packet truncated after enabling ip_forward for virtio-net in guest

2022-09-13 Thread Jason Wang
On Tue, Sep 13, 2022 at 11:43 PM Wei Yang wrote: > > Hi, I am running a guest with vhost-net as backend. After I enable > ip_forward, the packet received is truncated. > > Host runs a 5.10 kernel, while guest kernel is v5.11 which doesn't > include this commit: > > virtio-net: use

Re: [PATCH net] virtio-net: add cond_resched() to the command waiting loop

2022-09-07 Thread Jason Wang
在 2022/9/7 15:46, Michael S. Tsirkin 写道: On Wed, Sep 07, 2022 at 09:07:20AM +0200, Paolo Abeni wrote: On Wed, 2022-09-07 at 10:09 +0800, Jason Wang wrote: On Tue, Sep 6, 2022 at 6:56 PM Paolo Abeni wrote: On Mon, 2022-09-05 at 15:49 +0800, Jason Wang wrote: On Mon, Sep 5, 2022 at 3:15 PM

Re: [PATCH] vdpa: conditionally fill max max queue pair for stats

2022-09-07 Thread Jason Wang
On Wed, Sep 7, 2022 at 2:11 PM Eli Cohen wrote: > > > From: Jason Wang > > Sent: Wednesday, 7 September 2022 9:01 > > To: m...@redhat.com; jasow...@redhat.com; Eli Cohen ; > > virtualization@lists.linux-foundation.org; linux-ker...@vger.kernel.org > > Subject:

[PATCH] vdpa: conditionally fill max max queue pair for stats

2022-09-07 Thread Jason Wang
userspace can assume 1 when the attr is not provided. Fixes: 13b00b135665c("vdpa: Add support for querying vendor statistics") Cc: Eli Cohen Signed-off-by: Jason Wang --- drivers/vdpa/vdpa.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/dr

Re: [RFC v3 6/7] virtio: in order support for virtio_ring

2022-09-06 Thread Jason Wang
在 2022/9/1 13:54, Guo Zhi 写道: If in order feature negotiated, we can skip the used ring to get buffer's desc id sequentially. For skipped buffers in the batch, the used ring doesn't contain the buffer length, actually there is not need to get skipped buffers' length as they are tx buffer.

Re: [RFC v3 3/7] vsock: batch buffers in tx

2022-09-06 Thread Jason Wang
在 2022/9/1 13:54, Guo Zhi 写道: Vsock uses buffers in order, and for tx driver doesn't have to know the length of the buffer. So we can do a batch for vsock if in order negotiated, only write one used ring for a batch of buffers Signed-off-by: Guo Zhi --- drivers/vhost/vsock.c | 12

Re: [RFC v3 1/7] vhost: expose used buffers

2022-09-06 Thread Jason Wang
在 2022/9/1 13:54, Guo Zhi 写道: Follow VIRTIO 1.1 spec, only writing out a single used ring for a batch of descriptors. Signed-off-by: Guo Zhi --- drivers/vhost/vhost.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c

Re: [RFC v3 0/7] In order support for virtio_ring, vhost and vsock.

2022-09-06 Thread Jason Wang
在 2022/9/1 13:54, Guo Zhi 写道: In virtio-spec 1.1, new feature bit VIRTIO_F_IN_ORDER was introduced. When this feature has been negotiated, virtio driver will use descriptors in ring order: starting from offset 0 in the table, and wrapping around at the end of the table. Vhost devices will

Re: [virtio-dev] [PATCH v5 2/2] virtio-net: use mtu size as buffer length for big packets

2022-09-06 Thread Jason Wang
在 2022/9/1 10:10, Gavin Li 写道: Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big packets even when GUEST_* offloads are not present on the device. However, if guest GSO is not supported, it would be sufficient to allocate segments to cover just up the MTU size and no further.

Re: [PATCH net] virtio-net: add cond_resched() to the command waiting loop

2022-09-06 Thread Jason Wang
On Tue, Sep 6, 2022 at 6:56 PM Paolo Abeni wrote: > > On Mon, 2022-09-05 at 15:49 +0800, Jason Wang wrote: > > On Mon, Sep 5, 2022 at 3:15 PM Michael S. Tsirkin wrote: > > > > > > On Mon, Sep 05, 2022 at 12:53:41PM +0800, Jason Wang wrote: > > > > Ad

Re: [RFC 1/4] vDPA/ifcvf: add get/set_vq_endian support for vDPA

2022-09-05 Thread Jason Wang
在 2022/9/1 18:15, Zhu Lingshan 写道: This commit introuduces new config operatoions for vDPA: vdpa_config_ops.get_vq_endian: set vq endian-ness vdpa_config_ops.set_vq_endian: get vq endian-ness Because the endian-ness is a device wide attribute, so seting a vq's endian-ness will result in

Re: [PATCH] vhost-net: support VIRTIO_F_RING_RESET

2022-09-05 Thread Jason Wang
we use set_backend to attach the virtqueue, the virtqueue will be enabled and start to work. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- Test environment and method: Host: 5.19.0-rc3 Qemu: QEMU emulator version 7.0.50 (With vq rset support

Re: [PATCH net] virtio-net: add cond_resched() to the command waiting loop

2022-09-05 Thread Jason Wang
On Mon, Sep 5, 2022 at 3:15 PM Michael S. Tsirkin wrote: > > On Mon, Sep 05, 2022 at 12:53:41PM +0800, Jason Wang wrote: > > Adding cond_resched() to the command waiting loop for a better > > co-operation with the scheduler. This allows to give CPU a breath to > >

[PATCH net] virtio-net: add cond_resched() to the command waiting loop

2022-09-04 Thread Jason Wang
virtqueue is emulated via a workqueue for those parents. Fixes: bda324fd037a ("vdpasim: control virtqueue support") Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_n

Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev

2022-09-04 Thread Jason Wang
On Fri, Sep 2, 2022 at 2:14 PM Michael S. Tsirkin wrote: > > On Fri, Sep 02, 2022 at 02:03:22PM +0800, Jason Wang wrote: > > On Fri, Aug 26, 2022 at 2:24 PM Si-Wei Liu wrote: > > > > > > > > > > > > On 8/22/2022 8:26 PM, Jason Wang wrote: >

Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev

2022-09-02 Thread Jason Wang
On Fri, Aug 26, 2022 at 2:24 PM Si-Wei Liu wrote: > > > > On 8/22/2022 8:26 PM, Jason Wang wrote: > > On Mon, Aug 22, 2022 at 1:08 PM Zhu, Lingshan > > wrote: > >> > >> > >> On 8/20/2022 4:55 PM, Si-Wei Liu wrote: > >>> > >&

Re: [PATCH] virtio_net: Abort driver initialization if device fails

2022-08-31 Thread Jason Wang
On Mon, Aug 29, 2022 at 12:52 PM Eli Cohen wrote: > > > > > -Original Message- > > From: Jason Wang > > Sent: Monday, August 29, 2022 3:33 AM > > To: Michael S. Tsirkin > > Cc: Eli Cohen ; eperezma ; Si- > > Wei Liu ; virtualization > fou

Re: [PATCH] vduse: prevent uninitialized memory accesses

2022-08-28 Thread Jason Wang
; the driver to store the config value. > > Signed-off-by: Maxime Coquelin Acked-by: Jason Wang > --- > drivers/vdpa/vdpa_user/vduse_dev.c | 9 +++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c > b/drivers/vd

Re: [PATCH] virtio_net: Abort driver initialization if device fails

2022-08-28 Thread Jason Wang
On Mon, Aug 29, 2022 at 4:07 AM Michael S. Tsirkin wrote: > > On Sun, Aug 28, 2022 at 06:48:20PM +0300, Eli Cohen wrote: > > Read the status bit after virtio_device_ready() to check if device > > initialization was successful. If it was not, abort driver > > initialization to avoid further

Re: [RFC v2 6/7] virtio: in order support for virtio_ring

2022-08-25 Thread Jason Wang
在 2022/8/17 21:57, Guo Zhi 写道: If in order feature negotiated, we can skip the used ring to get buffer's desc id sequentially. Signed-off-by: Guo Zhi --- drivers/virtio/virtio_ring.c | 53 ++-- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git

Re: [RFC v2 5/7] virtio: unmask F_NEXT flag in desc_extra

2022-08-25 Thread Jason Wang
在 2022/8/17 21:57, Guo Zhi 写道: We didn't unmask F_NEXT flag in desc_extra in the end of a chain, unmask it so that we can access desc_extra to get next information. Signed-off-by: Guo Zhi I post a similar patch in the past. Please share the perf numbers (e.g pps via pktgen). Thanks

Re: [RFC v2 3/7] vsock: batch buffers in tx

2022-08-25 Thread Jason Wang
在 2022/8/17 21:57, Guo Zhi 写道: Vsock uses buffers in order, and for tx driver doesn't have to know the length of the buffer. So we can do a batch for vsock if in order negotiated, only write one used ring for a batch of buffers Signed-off-by: Guo Zhi --- drivers/vhost/vsock.c | 9 -

Re: [RFC v2 2/7] vhost_test: batch used buffer

2022-08-25 Thread Jason Wang
在 2022/8/17 21:57, Guo Zhi 写道: Only add to used ring when a batch of buffer have all been used. And if in order feature negotiated, only add the last used descriptor for a batch of buffer. Signed-off-by: Guo Zhi --- drivers/vhost/test.c | 8 +++- 1 file changed, 7 insertions(+), 1

Re: [RFC v2 1/7] vhost: expose used buffers

2022-08-25 Thread Jason Wang
在 2022/8/17 21:57, Guo Zhi 写道: Follow VIRTIO 1.1 spec, only writing out a single used ring for a batch of descriptors. Signed-off-by: Guo Zhi --- drivers/vhost/vhost.c | 14 -- drivers/vhost/vhost.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git

Re: Virtio-net - add timeouts to control commands

2022-08-24 Thread Jason Wang
On Wed, Aug 24, 2022 at 5:43 PM Alvaro Karsz wrote: > > Hi Hannes, > > > a) let the device do the timeout: pass in a timeout value with the > > command, and allow the device to return an ETIMEDOUT error when the > > timeout expires. Then it's up to the device to do the necessary timeout > >

Re: Virtio-net - add timeouts to control commands

2022-08-24 Thread Jason Wang
On Wed, Aug 24, 2022 at 5:16 PM Alvaro Karsz wrote: > > Hi Jason, > > > Or reset but can we simply use interrupt instead of the busy waiting? > > I agree that timeouts are not needed using interrupts. > This can be done, but seems like a big change. > All functions calling virtnet_send_command

Re: Virtio-net - add timeouts to control commands

2022-08-24 Thread Jason Wang
On Wed, Aug 24, 2022 at 3:52 PM Alvaro Karsz wrote: > > I think that we should add a timeout to the control virtqueue commands. > If the hypervisor crashes while handling a control command, the guest > will spin forever. > This may not be necessary for a virtual environment, when both the >

Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev

2022-08-22 Thread Jason Wang
On Mon, Aug 22, 2022 at 1:08 PM Zhu, Lingshan wrote: > > > > On 8/20/2022 4:55 PM, Si-Wei Liu wrote: > > > > > > On 8/18/2022 5:42 PM, Jason Wang wrote: > >> On Fri, Aug 19, 2022 at 7:20 AM Si-Wei Liu > >> wrote: > >>> > >>>

Re: [PATCH] virtio_pci: use container_of replace type conversion

2022-08-19 Thread Jason Wang
On Tue, Aug 16, 2022 at 11:06 AM Xuan Zhuo wrote: > > Replace type conversion with container_of() in > vp_modern_set_queue_reset()/vp_modern_get_queue_reset() . > Also combine declarations and assignments. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang >

Re: [PATCH v8 3/3] vhost: Remove invalid parameter of VHOST_VDPA_SUSPEND ioctl

2022-08-18 Thread Jason Wang
On Thu, Aug 11, 2022 at 9:54 PM Eugenio Pérez wrote: > > It was a leftover from previous versions. > > Signed-off-by: Eugenio Pérez Acked-by: Jason Wang > --- > Note that I'm not sure this removal is valid. The ioctl is not in master > branch by the se

Re: [PATCH v8 2/3] vdpa: Remove wrong doc of VHOST_VDPA_SUSPEND ioctl

2022-08-18 Thread Jason Wang
On Thu, Aug 11, 2022 at 9:54 PM Eugenio Pérez wrote: > > It was a leftover from previous versions. > > Signed-off-by: Eugenio Pérez Acked-by: Jason Wang > --- > include/linux/vdpa.h | 2 +- > include/uapi/linux/vhost.h | 15 +-- > 2 files chan

Re: [PATCH v8 1/3] vdpa: delete unreachable branch on vdpasim_suspend

2022-08-18 Thread Jason Wang
On Thu, Aug 11, 2022 at 9:54 PM Eugenio Pérez wrote: > > It was a leftover from previous versions. > > Signed-off-by: Eugenio Pérez Acked-by: Jason Wang > --- > drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 --- > 1 file changed, 7 deletions(-) > > diff --git a/drive

Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev

2022-08-18 Thread Jason Wang
On Fri, Aug 19, 2022 at 7:20 AM Si-Wei Liu wrote: > > > > On 8/17/2022 9:15 PM, Jason Wang wrote: > > > > 在 2022/8/17 18:37, Michael S. Tsirkin 写道: > >> On Wed, Aug 17, 2022 at 05:43:22PM +0800, Zhu, Lingshan wrote: > >>> > >>> On 8/17/2022

Re: [PATCH v2] virtio/virtio_pci_legacy: debug checking for queue size

2022-08-18 Thread Jason Wang
On Thu, Aug 18, 2022 at 4:13 PM Xuan Zhuo wrote: > > On Thu, 18 Aug 2022 16:10:45 +0800, Jason Wang wrote: > > On Thu, Aug 18, 2022 at 11:04 AM Xuan Zhuo > > wrote: > > > > > > Legacy virtio pci has no way to communicate a change in vq size to > > &

Re: [PATCH v2] virtio/virtio_pci_legacy: debug checking for queue size

2022-08-18 Thread Jason Wang
On Thu, Aug 18, 2022 at 11:04 AM Xuan Zhuo wrote: > > Legacy virtio pci has no way to communicate a change in vq size to > the hypervisor. If ring sizes don't match hypervisor will happily > corrupt memory. > > We add a check to vring size before calling > vp_legacy_set_queue_address(). Checking

Re: [PATCH] Documentation: add basic information on vDPA

2022-08-18 Thread Jason Wang
to add an overview of the driver API as > well as comprehensive doc comments. +1 > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Stefano Garzarella > Signed-off-by: Stefan Hajnoczi Acked-by: Jason Wang > --- > Documentation/driver-api/index.r

Re: [PATCH 3/6] vsock: add netdev to vhost/virtio vsock

2022-08-17 Thread Jason Wang
在 2022/8/18 01:20, Michael S. Tsirkin 写道: On Tue, Aug 16, 2022 at 10:50:55AM +, Bobby Eshleman wrote: Eh, I was hoping it was a side channel of an existing virtio_net which is not the case. Given the zero-config requirement IDK if we'll be able to fit this into netdev semantics :( It's

Re: [PATCH 0/6] virtio/vsock: introduce dgrams, sk_buff, and qdisc

2022-08-17 Thread Jason Wang
在 2022/8/17 14:54, Michael S. Tsirkin 写道: On Mon, Aug 15, 2022 at 10:56:03AM -0700, Bobby Eshleman wrote: Hey everybody, This series introduces datagrams, packet scheduling, and sk_buff usage to virtio vsock. The usage of struct sk_buff benefits users by a) preparing vsock to use other

Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev

2022-08-17 Thread Jason Wang
在 2022/8/17 10:03, Zhu, Lingshan 写道: On 8/17/2022 5:09 AM, Michael S. Tsirkin wrote: On Tue, Aug 16, 2022 at 09:02:17PM +, Parav Pandit wrote: From: Zhu, Lingshan Sent: Tuesday, August 16, 2022 12:19 AM On 8/16/2022 10:32 AM, Parav Pandit wrote: From: Zhu Lingshan Sent: Monday,

Re: [PATCH 2/2] vDPA: conditionally read fields in virtio-net dev

2022-08-17 Thread Jason Wang
在 2022/8/17 18:37, Michael S. Tsirkin 写道: On Wed, Aug 17, 2022 at 05:43:22PM +0800, Zhu, Lingshan wrote: On 8/17/2022 5:39 PM, Michael S. Tsirkin wrote: On Wed, Aug 17, 2022 at 05:13:59PM +0800, Zhu, Lingshan wrote: On 8/17/2022 4:55 PM, Michael S. Tsirkin wrote: On Wed, Aug 17, 2022 at

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Jason Wang
ote: > > > > > From: Michael S. Tsirkin > > > > > Sent: Tuesday, August 9, 2022 6:26 PM > > > > > To: Parav Pandit > > > > > Cc: Si-Wei Liu ; Jason Wang > > > > > ; Gavin Li ; Hemminger, > > > > > Stephen ; davem &g

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
在 2022/8/10 06:54, Si-Wei Liu 写道: On 8/9/2022 3:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 03:32:26PM -0700, Si-Wei Liu wrote: On 8/9/2022 2:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday,

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
在 2022/8/10 02:38, Si-Wei Liu 写道: On 8/9/2022 12:44 AM, Jason Wang wrote: On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: On 8/9/2022 7:56 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachments On 8/8/2022 12:31 AM, Gavin Li wrote: On 8/6/2022 6:11 AM, Si-Wei

Re: [PATCH V4 5/6] vDPA: answer num of queue pairs = 1 to userspace when VIRTIO_NET_F_MQ == 0

2022-08-09 Thread Jason Wang
On Wed, Aug 10, 2022 at 8:54 AM Si-Wei Liu wrote: > > > > On 8/9/2022 12:36 PM, Michael S. Tsirkin wrote: > > On Fri, Jul 22, 2022 at 01:14:42PM +, Parav Pandit wrote: > >> > >>> From: Zhu Lingshan > >>> Sent: Friday, July 22, 2022 7:53 AM > >>> > >>> If VIRTIO_NET_F_MQ == 0, the virtio

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
On Tue, Aug 9, 2022 at 5:25 PM Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 03:44:22PM +0800, Jason Wang wrote: > > > + unsigned int mtu = vi->dev->mtu; > > BTW should this not be max_mtu? Yes. > Otherwise if user configures mtu that &g

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
On Tue, Aug 9, 2022 at 5:22 PM Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 03:44:22PM +0800, Jason Wang wrote: > > > @@ -3571,8 +3581,10 @@ static int virtnet_probe(struct virtio_device > > > *vdev) > > > if (virtio_has_feat

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: > > > On 8/9/2022 7:56 AM, Si-Wei Liu wrote: > > External email: Use caution opening links or attachments > > > On 8/8/2022 12:31 AM, Gavin Li wrote: > > > On 8/6/2022 6:11 AM, Si-Wei Liu wrote: > > External email: Use caution opening links or

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Jason Wang
On Mon, Aug 8, 2022 at 8:45 PM Michael S. Tsirkin wrote: > > On Mon, Aug 08, 2022 at 11:18:50AM +0100, Will Deacon wrote: > > Hi Michael, > > > > On Sun, Aug 07, 2022 at 09:14:43AM -0400, Michael S. Tsirkin wrote: > > > Will, thanks very much for the analysis and the writeup! > > > > No problem,

Re: IOTLB support for vhost/vsock breaks crosvm on Android

2022-08-08 Thread Jason Wang
On Sun, Aug 7, 2022 at 9:14 PM Michael S. Tsirkin wrote: > > Will, thanks very much for the analysis and the writeup! > > On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > > So how should we fix this? One possibility is for us to hack crosvm to > > clear the VIRTIO_F_ACCESS_PLATFORM

Re: [PATCH net] virtio_net: fix memory leak inside XPD_TX with mergeable

2022-08-04 Thread Jason Wang
r "goto err_xdp". > > Fixes: 44fa2dbd4759 ("xdp: transition into using xdp_frame for ndo_xdp_xmit") > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang > --- > drivers/net/virtio_net.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/

Re: memory locking in vhost-vdpa

2022-08-04 Thread Jason Wang
On Thu, Aug 4, 2022 at 2:39 PM Stefano Garzarella wrote: > > On Thu, Aug 04, 2022 at 09:52:47AM +0800, Jason Wang wrote: > >On Thu, Aug 4, 2022 at 1:46 AM Andrey Zhadchenko > > wrote: > >> > >> Hi! > >> > >> Recently I sent vhost-blk patch

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-04 Thread Jason Wang
On Thu, Aug 4, 2022 at 3:23 PM Jason Wang wrote: > > On Thu, Aug 4, 2022 at 3:10 PM Michael S. Tsirkin wrote: > > > > On Thu, Aug 04, 2022 at 01:00:46PM +0800, Jason Wang wrote: > > > On Tue, Aug 2, 2022 at 12:47 PM Gavin Li wrote: > > > > > &

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-04 Thread Jason Wang
On Thu, Aug 4, 2022 at 3:10 PM Michael S. Tsirkin wrote: > > On Thu, Aug 04, 2022 at 01:00:46PM +0800, Jason Wang wrote: > > On Tue, Aug 2, 2022 at 12:47 PM Gavin Li wrote: > > > > > > Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big > >

  1   2   3   4   5   6   7   8   9   10   >