Re: [PATCH] vhost/vsock: Use kvmalloc/kvfree for larger packets.

2022-09-29 Thread Stefano Garzarella
On Thu, Sep 29, 2022 at 03:19:14AM -0400, Michael S. Tsirkin wrote: On Thu, Sep 29, 2022 at 08:14:24AM +0900, Junichi Uekawa (上川純一) wrote: 2022年9月29日(木) 0:11 Stefano Garzarella : > > On Wed, Sep 28, 2022 at 05:31:58AM -0400, Michael S. Tsirkin wrote: > >On Wed, Sep 28, 2022 at 10:2

Re: [PATCH] vhost/vsock: Use kvmalloc/kvfree for larger packets.

2022-09-29 Thread Stefano Garzarella
On Wed, Sep 28, 2022 at 04:02:12PM -0400, Michael S. Tsirkin wrote: On Wed, Sep 28, 2022 at 05:11:35PM +0200, Stefano Garzarella wrote: On Wed, Sep 28, 2022 at 05:31:58AM -0400, Michael S. Tsirkin wrote: > On Wed, Sep 28, 2022 at 10:28:23AM +0200, Stefano Garzarella wrote: > > On We

Re: [PATCH] vhost/vsock: Use kvmalloc/kvfree for larger packets.

2022-09-28 Thread Stefano Garzarella
On Wed, Sep 28, 2022 at 05:31:58AM -0400, Michael S. Tsirkin wrote: On Wed, Sep 28, 2022 at 10:28:23AM +0200, Stefano Garzarella wrote: On Wed, Sep 28, 2022 at 03:45:38PM +0900, Junichi Uekawa wrote: > When copying a large file over sftp over vsock, data size is usually 32kB, > and k

Re: [PATCH] vhost/vsock: Use kvmalloc/kvfree for larger packets.

2022-09-28 Thread Stefano Garzarella
ually we can use it also in vsock_loopback), since the Bobby's patch should rework this code: Reviewed-by: Stefano Garzarella [1] https://lore.kernel.org/lkml/65d117ddc530d12a6d47fcc45b38891465a90d9f.1660362668.git.bobby.eshle...@bytedance.com/ Thanks, Stefano __

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

2022-09-27 Thread Stefano Garzarella
On Mon, Sep 26, 2022 at 03:42:19PM +0200, Stefano Garzarella wrote: Hi, 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. Just a reminder for those who are interested

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

2022-09-26 Thread Stefano Garzarella
Hi, 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. Just a reminder for those who are interested, tomorrow Sep 27 @ 16:00 UTC we will discuss more about the next steps for

Re: [PATCH 2/6] vsock: return errors other than -ENOMEM to socket

2022-09-26 Thread Stefano Garzarella
On Mon, Aug 15, 2022 at 10:56:05AM -0700, Bobby Eshleman wrote: This commit allows vsock implementations to return errors to the socket layer other than -ENOMEM. One immediate effect of this is that upon the sk_sndbuf threshold being reached -EAGAIN will be returned and userspace may throttle

Re: [PATCH 4/6] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2022-09-26 Thread Stefano Garzarella
On Mon, Aug 15, 2022 at 10:56:07AM -0700, Bobby Eshleman wrote: This commit adds a feature bit for virtio vsock to support datagrams. Signed-off-by: Jiang Wang Signed-off-by: Bobby Eshleman --- drivers/vhost/vsock.c | 3 ++- include/uapi/linux/virtio_vsock.h | 1 +

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

2022-09-22 Thread Stefano Garzarella
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 features. 2) clearing the features that is not wanted by the userspace For example: # vdpa mgmtdev

Re: [PATCH 0/3] MAINTAINERS: Update entries for some VMware drivers

2022-09-20 Thread Stefano Garzarella
On Mon, Sep 19, 2022 at 10:41:47AM -0700, Jakub Kicinski wrote: On Tue, 6 Sep 2022 10:27:19 -0700 vd...@vmware.com wrote: From: Vishnu Dasa This series updates a few existing maintainer entries for VMware supported drivers and adds a new entry for vsock vmci transport driver. Just to be

Re: Call to discuss vsock netdev/sk_buff [was Re: [PATCH 0/6] virtio/vsock: introduce dgrams, sk_buff, and qdisc]

2022-09-15 Thread Stefano Garzarella
On Mon, Sep 12, 2022 at 8:28 PM Bobby Eshleman wrote: > > On Mon, Sep 12, 2022 at 08:12:58PM +0200, Stefano Garzarella wrote: > > On Fri, Sep 9, 2022 at 8:13 PM Bobby Eshleman > > wrote: > > > > > > Hey Stefano, thanks for sending this out. > > > &

Re: [PATCH] MAINTAINERS: Add header files under VMWARE VMCI DRIVER

2022-09-15 Thread Stefano Garzarella
On Wed, Sep 14, 2022 at 08:13:21PM -0700, vd...@vmware.com wrote: From: Vishnu Dasa Add include/linux/vmw_vmci* files under VMWARE VMCI DRIVER. Acked-by: Bryan Tan Signed-off-by: Vishnu Dasa Suggested-by: Stefano Garzarella --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) Acked

Re: Call to discuss vsock netdev/sk_buff [was Re: [PATCH 0/6] virtio/vsock: introduce dgrams, sk_buff, and qdisc]

2022-09-12 Thread Stefano Garzarella
On Fri, Sep 9, 2022 at 8:13 PM Bobby Eshleman wrote: > > Hey Stefano, thanks for sending this out. > > On Thu, Sep 08, 2022 at 04:36:52PM +0200, Stefano Garzarella wrote: > > > > Looking better at the KVM forum sched, I found 1h slot for Sep 15 at 16:30 > > UTC. &

Call to discuss vsock netdev/sk_buff [was Re: [PATCH 0/6] virtio/vsock: introduce dgrams, sk_buff, and qdisc]

2022-09-08 Thread Stefano Garzarella
, ContainerCon Europe, CloudOpen Europe, etc) then you could meet Stefano Garzarella and others to discuss this patch series. Using netdev and sk_buff is a big change to vsock. Discussing your requirements and the future direction of vsock in person could help. If you won't be in Dublin, don't worry. You can

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

2022-09-08 Thread Stefano Garzarella
, ContainerCon Europe, CloudOpen Europe, etc) then you could meet Stefano Garzarella and others to discuss this patch series. Using netdev and sk_buff is a big change to vsock. Discussing your requirements and the future direction of vsock in person could help. If you won't be in Dublin, don't worry. You can

Re: [PATCH] vsock/vmci: fix repeated words in comments

2022-09-07 Thread Stefano Garzarella
On Wed, Sep 07, 2022 at 12:01:31PM +0800, Jilin Yuan wrote: Delete the redundant word 'that'. Signed-off-by: Jilin Yuan --- net/vmw_vsock/vmci_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/vmci_transport.c b

Re: [PATCH 0/3] MAINTAINERS: Update entries for some VMware drivers

2022-09-07 Thread Stefano Garzarella
On Tue, Sep 06, 2022 at 10:27:19AM -0700, vd...@vmware.com wrote: From: Vishnu Dasa This series updates a few existing maintainer entries for VMware supported drivers and adds a new entry for vsock vmci transport driver. Since you are updating MAINTAINERS, what about adding

Re: [PATCH 3/3] MAINTAINERS: Add a new entry for VMWARE VSOCK VMCI TRANSPORT DRIVER

2022-09-07 Thread Stefano Garzarella
! Will be very useful to review vsock patches for vmci transport. Acked-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

2022-09-06 Thread Stefano Garzarella
On Thu, Aug 18, 2022 at 12:28:48PM +0800, Jason Wang wrote: 在 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

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

2022-09-06 Thread Stefano Garzarella
of the driver API as well as comprehensive doc comments. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Stefano Garzarella Signed-off-by: Stefan Hajnoczi --- Documentation/driver-api/index.rst | 1 + Documentation/driver-api/vdpa.rst | 40 ++ 2 files changed, 41

Re: [PATCH net-next v4 0/9] vsock: updates for SO_RCVLOWAT handling

2022-08-29 Thread Stefano Garzarella
On Tue, Aug 23, 2022 at 10:57:01PM +0200, Paolo Abeni wrote: On Tue, 2022-08-23 at 16:30 -0400, Stefan Hajnoczi wrote: On Tue, Aug 23, 2022 at 12:18:52PM -0700, Jakub Kicinski wrote: > On Tue, 23 Aug 2022 15:14:10 -0400 Stefan Hajnoczi wrote: > > Stefano will be online again on Monday. I

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

2022-08-16 Thread Stefano Garzarella
Hi Bobby, I’m on vacation so I’ll review this series when I’m back on 28th. Please send next versions of this series as RFC until we have at least an agreement on the spec changes. I think will be better to agree on the spec before merge Linux changes. Thanks, Stefano On Monday, August 15,

Re: build failure of next-20220811 due to d79b32c2e4a4 ("vdpa_sim_blk: add support for discard and write-zeroes")

2022-08-11 Thread Stefano Garzarella
On Thu, Aug 11, 2022 at 11:31:21AM -0700, Nathan Chancellor wrote: On Thu, Aug 11, 2022 at 06:22:54PM +0100, Sudip Mukherjee (Codethink) wrote: Hi All, Not sure if it has been reported, builds of arm64 with clang failed to build next-20220811 with the error:

Re: build failure of next-20220811 due to d79b32c2e4a4 ("vdpa_sim_blk: add support for discard and write-zeroes")

2022-08-11 Thread Stefano Garzarella
Hi Sudip, On Thu, Aug 11, 2022 at 06:22:54PM +0100, Sudip Mukherjee (Codethink) wrote: Hi All, Not sure if it has been reported, builds of arm64 with clang failed to build next-20220811 with the error: drivers/vdpa/vdpa_sim/vdpa_sim_blk.c:201:3: error: expected expression

[PATCH] vdpa: fix warning casts when building with C=2

2022-08-11 Thread Stefano Garzarella
from restricted __virtio16 Signed-off-by: Stefano Garzarella --- 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 c06c02704461..2466d5087478 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c @@ -808,7

[PATCH v3 3/4] vdpa_sim_blk: add support for VIRTIO_BLK_T_FLUSH

2022-08-11 Thread Stefano Garzarella
The simulator behaves like a ramdisk, so we don't have to do anything when a VIRTIO_BLK_T_FLUSH request is received, but it could be useful to test driver behavior. Let's expose the VIRTIO_BLK_F_FLUSH feature to inform the driver that we support the flush command. Signed-off-by: Stefano

[PATCH v3 4/4] vdpa_sim_blk: add support for discard and write-zeroes

2022-08-11 Thread Stefano Garzarella
sets to 0 the specified region. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 74 +++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c index

[PATCH v3 2/4] vdpa_sim_blk: make vdpasim_blk_check_range usable by other requests

2022-08-11 Thread Stefano Garzarella
in vdpasim_blk_check_range() to avoid duplicate prints. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 38 +--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c

[PATCH v3 1/4] vdpa_sim_blk: check if sector is 0 for commands other than read or write

2022-08-11 Thread Stefano Garzarella
VIRTIO spec states: "The sector number indicates the offset (multiplied by 512) where the read or write is to occur. This field is unused and set to 0 for commands other than read or write." Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 10

[PATCH v3 0/4] vdpa_sim_blk: add support for flush, discard, and write-zeroes

2022-08-11 Thread Stefano Garzarella
://lore.kernel.org/virtualization/20220810094347.20449-1-sgarz...@redhat.com/ v1: https://lore.kernel.org/virtualization/20220428151242.213824-1-sgarz...@redhat.com/ Tree available here: https://gitlab.com/sgarzarella/linux.git vdpa-sim-blk-flush-discard-wz Thanks, Stefano Stefano Garzarella (4

[PATCH v2 4/4] vdpa_sim_blk: add support for discard and write-zeroes

2022-08-10 Thread Stefano Garzarella
sets to 0 the specified region. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 74 +++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c index

[PATCH v2 3/4] vdpa_sim_blk: add support for VIRTIO_BLK_T_FLUSH

2022-08-10 Thread Stefano Garzarella
The simulator behaves like a ramdisk, so we don't have to do anything when a VIRTIO_BLK_T_FLUSH request is received, but it could be useful to test driver behavior. Let's expose the VIRTIO_BLK_F_FLUSH feature to inform the driver that we support the flush command. Signed-off-by: Stefano

[PATCH v2 2/4] vdpa_sim_blk: make vdpasim_blk_check_range usable by other requests

2022-08-10 Thread Stefano Garzarella
in vdpasim_blk_check_range() to avoid duplicate prints. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 38 +--- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c

[PATCH v2 1/4] vdpa_sim_blk: check if sector is 0 for commands other than read or write

2022-08-10 Thread Stefano Garzarella
VIRTIO spec states: "The sector number indicates the offset (multiplied by 512) where the read or write is to occur. This field is unused and set to 0 for commands other than read or write." Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 10

[PATCH v2 0/4] vdpa_sim_blk: add support for flush, discard, and write-zeroes

2022-08-10 Thread Stefano Garzarella
available here: https://gitlab.com/sgarzarella/linux.git vdpa-sim-blk-flush-discard-wz Thanks, Stefano Stefano Garzarella (4): vdpa_sim_blk: check if sector is 0 for commands other than read or write vdpa_sim_blk: make vdpasim_blk_check_range usable by other requests vdpa_sim_blk: add

Re: [RFC PATCH v3 1/9] vsock: SO_RCVLOWAT transport set callback

2022-08-09 Thread Stefano Garzarella
On Tue, Aug 09, 2022 at 09:45:47AM +, Arseniy Krasnov wrote: On 09.08.2022 12:37, Arseniy Krasnov wrote: On 08.08.2022 13:30, Stefano Garzarella wrote: On Mon, Aug 8, 2022 at 12:23 PM Stefano Garzarella wrote: On Wed, Aug 03, 2022 at 01:51:05PM +, Arseniy Krasnov wrote: This adds

Re: [RFC PATCH v3 0/9] vsock: updates for SO_RCVLOWAT handling

2022-08-08 Thread Stefano Garzarella
Hi Arseniy, On Wed, Aug 03, 2022 at 01:48:06PM +, Arseniy Krasnov wrote: Hello, This patchset includes some updates for SO_RCVLOWAT: I have reviewed all the patches, run tests and everything seems okay :-) I left some minor comments and asked Bryan and Vishnu to take a better look at

Re: [RFC PATCH v3 9/9] vsock_test: POLLIN + SO_RCVLOWAT test

2022-08-08 Thread Stefano Garzarella
On Wed, Aug 03, 2022 at 02:07:58PM +, Arseniy Krasnov wrote: This adds test to check,that when poll() returns POLLIN,POLLRDNORM bits, next read call won't block. Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 107 +++ 1 file changed, 107

Re: [RFC PATCH v3 9/9] vsock_test: POLLIN + SO_RCVLOWAT test

2022-08-08 Thread Stefano Garzarella
macro on both server and client functions, I suggest to move this define outside the function. Other than that the test LGTM. I also ran it and everything is fine :-) thanks for adding it! Reviewed-by: Stefano Garzarella ___ Virtualization mailing

Re: [RFC PATCH v3 8/9] vmci/vsock: check SO_RCVLOWAT before wake up reader

2022-08-08 Thread Stefano Garzarella
On Wed, Aug 03, 2022 at 02:05:52PM +, Arseniy Krasnov wrote: This adds extra condition to wake up data reader: do it only when number of readable bytes >= SO_RCVLOWAT. Otherwise, there is no sense to kick user,because it will wait until SO_RCVLOWAT bytes will be dequeued. Ditto as previous

Re: [RFC PATCH v3 7/9] virtio/vsock: check SO_RCVLOWAT before wake up reader

2022-08-08 Thread Stefano Garzarella
can mention that these are done in vsock_data_ready(). Anyway, the patch LGTM: Reviewed-by: Stefano Garzarella Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/

Re: [RFC PATCH v3 6/9] vsock: add API call for data ready

2022-08-08 Thread Stefano Garzarella
an RFC, I suggest you add a space after the punctuation. :-) The patch LGTM: Reviewed-by: Stefano Garzarella Signed-off-by: Arseniy Krasnov --- include/net/af_vsock.h | 1 + net/vmw_vsock/af_vsock.c | 10 ++ 2 files changed, 11 insertions(+) diff --git a/include/net/af_vsock.h b

Re: [RFC PATCH v3 5/9] vsock: pass sock_rcvlowat to notify_poll_in as target

2022-08-08 Thread Stefano Garzarella
expected by the user. Let's use sock_rcvlowat() to get the right target to pass to notify_poll_in(). Anyway, the patch LGTM: Reviewed-by: Stefano Garzarella Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net

Re: [RFC PATCH v3 4/9] vmci/vsock: use 'target' in notify_poll_in callback

2022-08-08 Thread Stefano Garzarella
to sk_rcvlowat in this case. Ditto as the previous patch. With that fixed: Reviewed-by: Stefano Garzarella @Bryan, @Vishnu, if you're happy with this change, can you ack/review? Thanks, Stefano Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/vmci_transport_notify.c| 8 net

Re: [RFC PATCH v3 3/9] virtio/vsock: use 'target' in notify_poll_in callback

2022-08-08 Thread Stefano Garzarella
to sk_rcvlowat in this case. Little suggestion: We should update the commit description, since so far 'target' is not equal to sk_rcvlowat. With that fixed (and adding some spaces after the commas): Reviewed-by: Stefano Garzarella Signed-off-by: Arseniy Krasnov --- net/vmw_vsock

Re: [RFC PATCH v3 2/9] hv_sock: disable SO_RCVLOWAT support

2022-08-08 Thread Stefano Garzarella
insertions(+) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v3 1/9] vsock: SO_RCVLOWAT transport set callback

2022-08-08 Thread Stefano Garzarella
On Mon, Aug 8, 2022 at 12:23 PM Stefano Garzarella wrote: > > On Wed, Aug 03, 2022 at 01:51:05PM +, Arseniy Krasnov wrote: > >This adds transport specific callback for SO_RCVLOWAT, because in some > >transports it may be difficult to know current available number of byte

Re: [RFC PATCH v3 1/9] vsock: SO_RCVLOWAT transport set callback

2022-08-08 Thread Stefano Garzarella
On Wed, Aug 03, 2022 at 01:51:05PM +, Arseniy Krasnov wrote: This adds transport specific callback for SO_RCVLOWAT, because in some transports it may be difficult to know current available number of bytes ready to read. Thus, when SO_RCVLOWAT is set, transport may reject it. Signed-off-by:

Re: [PATCH net v2 2/2] vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout()

2022-08-08 Thread Stefano Garzarella
nd request will return -ETIMEDOUT. Suggested-by: Stefano Garzarella Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Signed-off-by: Peilin Ye --- (new patch in v2) Thanks for sending this :-) Reviewed-by: Stefano Garzarella ___ Virtual

Re: [PATCH net v2 1/2] vsock: Fix memory leak in vsock_connect()

2022-08-08 Thread Stefano Garzarella
k_hold() to keep the reference count balanced. Reported-and-tested-by: syzbot+b03f55bf128f9a38f...@syzkaller.appspotmail.com Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Co-developed-by: Stefano Garzarella Signed-off-by: Stefano Garzarella Signed-off-by: Peilin Ye ---

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

2022-08-06 Thread Stefano Garzarella
On Sat, Aug 06, 2022 at 10:42:40AM +0100, Will Deacon wrote: Hi Stefano, On Sat, Aug 06, 2022 at 09:48:28AM +0200, Stefano Garzarella wrote: On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: > The fundamental issue is, I think, that VIRTIO_F_ACCESS_PLATFORM is > being used f

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

2022-08-06 Thread Stefano Garzarella
Hi Linus, On Fri, Aug 05, 2022 at 03:57:08PM -0700, Linus Torvalds wrote: On Fri, Aug 5, 2022 at 11:11 AM Will Deacon wrote: [tl;dr a change from ~18 months ago breaks Android userspace and I don't know what to do about it] Augh. I had hoped that android being "closer" to upstream would

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

2022-08-06 Thread Stefano Garzarella
Hi Will, On Fri, Aug 05, 2022 at 07:11:06PM +0100, Will Deacon wrote: Hi folks, [tl;dr a change from ~18 months ago breaks Android userspace and I don't know what to do about it] As part of the development work for next year's Android, we've recently been bringing up a 5.15 KVM host and have

Re: [RFC PATCH v3 0/9] vsock: updates for SO_RCVLOWAT handling

2022-08-05 Thread Stefano Garzarella
Hi Arseniy, sorry but I didn't have time to review this series. I will definitely do it next Monday! Have a nice weekend, Stefano On Wed, Aug 03, 2022 at 01:48:06PM +, Arseniy Krasnov wrote: Hello, This patchset includes some updates for SO_RCVLOWAT: 1) af_vsock: During my

Re: [PATCH RFC net-next] vsock: Reschedule connect_work for O_NONBLOCK connect() requests

2022-08-05 Thread Stefano Garzarella
On Thu, Aug 04, 2022 at 04:44:47PM -0700, Peilin Ye wrote: Hi Stefano, On Thu, Aug 04, 2022 at 08:59:23AM +0200, Stefano Garzarella wrote: The last thing I was trying to figure out before sending the patch was whether to set sock->state = SS_UNCONNECTED in vsock_connect_timeout(). I think

Re: [PATCH RFC net-next] vsock: Reschedule connect_work for O_NONBLOCK connect() requests

2022-08-04 Thread Stefano Garzarella
On Wed, Aug 03, 2022 at 07:09:25PM -0700, Peilin Ye wrote: From: Peilin Ye An O_NONBLOCK vsock_connect() request may try to reschedule @connect_work. Consider the following vsock_connect() requests: 1. The 1st, non-blocking request schedules @connect_work, which will expire after, say,

Re: memory locking in vhost-vdpa

2022-08-04 Thread Stefano Garzarella
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 patchset and Stefano suggested to instead join efforts on developing vdpa-blk. I played with it a bit and looks like vdpa itself pins the whole

Re: [RFC PATCH v2 0/9] vsock: updates for SO_RCVLOWAT handling

2022-08-02 Thread Stefano Garzarella
Hi Vishnu, On Tue, Aug 02, 2022 at 05:35:22AM +, Vishnu Dasa wrote: On Jul 27, 2022, at 5:37 AM, Stefano Garzarella wrote: Hi Arseniy, On Mon, Jul 25, 2022 at 07:54:05AM +, Arseniy Krasnov wrote: [...] 3) vmci/vsock: Same as 2), but i'm not sure about this changes. Will be very

Re: [RFC 3/5] vhost_test: batch used buffer

2022-08-02 Thread Stefano Garzarella
On Tue, Aug 2, 2022 at 4:45 AM Zhi Guo wrote: > > > > 2022年7月22日 下午3:12,Eugenio Perez Martin 写道: > > On Thu, Jul 21, 2022 at 10:44 AM Guo Zhi wrote: > > > Only add to used ring when a batch a buffer have all been used. And if > in order feature negotiated, add randomness to the used buffer's

Re: [RFC PATCH v2 0/9] vsock: updates for SO_RCVLOWAT handling

2022-07-27 Thread Stefano Garzarella
Hi Arseniy, On Mon, Jul 25, 2022 at 07:54:05AM +, Arseniy Krasnov wrote: Hello, This patchset includes some updates for SO_RCVLOWAT: 1) af_vsock: During my experiments with zerocopy receive, i found, that in some cases, poll() implementation violates POSIX: when socket has non-

Re: [RFC PATCH v2 3/9] vmci/vsock: use 'target' in notify_poll_in, callback

2022-07-27 Thread Stefano Garzarella
On Wed, Jul 27, 2022 at 2:22 PM Stefano Garzarella wrote: > > @Jorgen can you take a look at this series, especially this patch? Jorgen's email bounced back, so I'm CCing VMCI maintainers. Bryan, Rajesh, Vishnu, can you take a look? Thanks, Stefano > > Maybe we need to update

Re: [RFC PATCH v2 5/9] vsock: SO_RCVLOWAT transport set callback

2022-07-27 Thread Stefano Garzarella
On Mon, Jul 25, 2022 at 08:05:28AM +, Arseniy Krasnov wrote: This adds transport specific callback for SO_RCVLOWAT, because in some transports it may be difficult to know current available number of bytes ready to read. Thus, when SO_RCVLOWAT is set, transport may reject it. Signed-off-by:

Re: [RFC PATCH v2 3/9] vmci/vsock: use 'target' in notify_poll_in, callback

2022-07-27 Thread Stefano Garzarella
@Jorgen can you take a look at this series, especially this patch? Maybe we need to update the comments in the else branch, something like s/there is nothing/there is not enough data Thanks, Stefano On Mon, Jul 25, 2022 at 08:01:01AM +, Arseniy Krasnov wrote: This callback controls

Re: [RFC PATCH v2 1/9] vsock: use sk_rcvlowat to set POLLIN/POLLRDNORM

2022-07-27 Thread Stefano Garzarella
On Mon, Jul 25, 2022 at 07:56:59AM +, Arseniy Krasnov wrote: Both bits indicate, that next data read call won't be blocked, but when sk_rcvlowat is not 1, these bits will be set by poll anyway, thus when user tries to dequeue data,it will wait until sk_rcvlowat bytes of data will be

Re: [RFC PATCH v1 0/3] virtio/vsock: use SO_RCVLOWAT to set POLLIN/POLLRDNORM

2022-07-20 Thread Stefano Garzarella
On Wed, Jul 20, 2022 at 06:07:47AM +, Arseniy Krasnov wrote: On 19.07.2022 15:58, Stefano Garzarella wrote: On Mon, Jul 18, 2022 at 08:12:52AM +, Arseniy Krasnov wrote: Hello, during my experiments with zerocopy receive, i found, that in some cases, poll() implementation violates

Re: [RFC PATCH v1 3/3] vsock_test: POLLIN + SO_RCVLOWAT test.

2022-07-20 Thread Stefano Garzarella
On Wed, Jul 20, 2022 at 05:46:01AM +, Arseniy Krasnov wrote: On 19.07.2022 15:52, Stefano Garzarella wrote: On Mon, Jul 18, 2022 at 08:19:06AM +, Arseniy Krasnov wrote: This adds test to check, that when poll() returns POLLIN and POLLRDNORM bits, next read call won't block. Signed-off

Re: [RFC PATCH v1 2/3] virtio/vsock: use 'target' in notify_poll_in, callback.

2022-07-20 Thread Stefano Garzarella
On Wed, Jul 20, 2022 at 05:38:03AM +, Arseniy Krasnov wrote: On 19.07.2022 15:48, Stefano Garzarella wrote: On Mon, Jul 18, 2022 at 08:17:31AM +, Arseniy Krasnov wrote: This callback controls setting of POLLIN,POLLRDNORM output bits of poll() syscall,but in some cases,it is incorrectly

Re: [RFC PATCH v1 0/3] virtio/vsock: use SO_RCVLOWAT to set POLLIN/POLLRDNORM

2022-07-19 Thread Stefano Garzarella
On Mon, Jul 18, 2022 at 08:12:52AM +, Arseniy Krasnov wrote: Hello, during my experiments with zerocopy receive, i found, that in some cases, poll() implementation violates POSIX: when socket has non- default SO_RCVLOWAT(e.g. not 1), poll() will always set POLLIN and POLLRDNORM bits in

Re: [RFC PATCH v1 3/3] vsock_test: POLLIN + SO_RCVLOWAT test.

2022-07-19 Thread Stefano Garzarella
On Mon, Jul 18, 2022 at 08:19:06AM +, Arseniy Krasnov wrote: This adds test to check, that when poll() returns POLLIN and POLLRDNORM bits, next read call won't block. Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 90 1 file changed,

Re: [RFC PATCH v1 2/3] virtio/vsock: use 'target' in notify_poll_in, callback.

2022-07-19 Thread Stefano Garzarella
On Mon, Jul 18, 2022 at 08:17:31AM +, Arseniy Krasnov wrote: This callback controls setting of POLLIN,POLLRDNORM output bits of poll() syscall,but in some cases,it is incorrectly to set it, when socket has at least 1 bytes of available data. Use 'target' which is already exists and equal to

Re: [RFC PATCH v1 1/3] vsock: use sk_skrcvlowat to set POLLIN,POLLRDNORM, bits.

2022-07-19 Thread Stefano Garzarella
On Mon, Jul 18, 2022 at 08:15:42AM +, Arseniy Krasnov wrote: Both bits indicate, that next data read call won't be blocked, but when sk_rcvlowat is not 1,these bits will be set by poll anyway,thus when user tries to dequeue data, it will wait until sk_rcvlowat bytes of data will be

Re: [RFC PATCH 0/6] virtio_test: add support for vhost-vdpa

2022-07-12 Thread Stefano Garzarella
On Tue, Jul 12, 2022 at 04:47:10PM +0800, Jason Wang wrote: On Tue, Jul 12, 2022 at 4:46 PM Stefano Garzarella wrote: On Tue, Jul 12, 2022 at 04:34:11PM +0800, Jason Wang wrote: > >在 2022/7/5 01:16, Stefano Garzarella 写道: >>The first 3 patches fix various problems I have

Re: [RFC PATCH 0/6] virtio_test: add support for vhost-vdpa

2022-07-12 Thread Stefano Garzarella
On Tue, Jul 12, 2022 at 04:34:11PM +0800, Jason Wang wrote: 在 2022/7/5 01:16, Stefano Garzarella 写道: The first 3 patches fix various problems I have encountered with virtio_test (they may go without this series, but I included to allow you to test the series). Patch 4 is in preparation

Re: [PATCH v6 2/4] vhost-vdpa: introduce SUSPEND backend feature bit

2022-07-08 Thread Stefano Garzarella
On Fri, Jul 08, 2022 at 01:38:45PM +0200, Eugenio Perez Martin wrote: On Tue, Jun 28, 2022 at 3:43 PM Stefano Garzarella wrote: On Thu, Jun 23, 2022 at 06:07:36PM +0200, Eugenio Pérez wrote: >Userland knows if it can suspend the device or not by checking this feature >bit. > &

[PATCH] tools/virtio: fix build

2022-07-05 Thread Stefano Garzarella
Fix the build caused by the following changes: - phys_addr_t is now defined in tools/include/linux/types.h - dev_warn_once() is used in drivers/virtio/virtio_ring.c - linux/uio.h included by vringh.h use INT_MAX defined in limits.h Signed-off-by: Stefano Garzarella --- tools/virtio/linux

Re: [RFC PATCH 1/6] tools/virtio: fix build

2022-07-05 Thread Stefano Garzarella
On Mon, Jul 04, 2022 at 03:07:15PM -0400, Michael S. Tsirkin wrote: On Mon, Jul 04, 2022 at 07:16:56PM +0200, Stefano Garzarella wrote: Fix the build caused by the following changes: - phys_addr_t is now defined in tools/include/linux/types.h - dev_warn_once() is used in drivers/virtio

Re: [RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device

2022-07-05 Thread Stefano Garzarella
On Mon, Jul 04, 2022 at 03:06:39PM -0400, Michael S. Tsirkin wrote: On Mon, Jul 04, 2022 at 07:16:58PM +0200, Stefano Garzarella wrote: Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken to true, so we need to call __virtio_unbreak_device() before starting to us

[RFC PATCH 6/6] vdpasim: add vdpa_sim_test module

2022-07-04 Thread Stefano Garzarella
This adds a test module for vhost-vdpa infrastructure to be used with virtio_test. Intentionally not tied to kbuild to prevent people from installing and loading it accidentally. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_test.c | 203 ++ tools

[RFC PATCH 5/6] virtio_test: support vhost-vdpa device

2022-07-04 Thread Stefano Garzarella
-vdpa The --reset option is not supported for now when using vhost-vdpa. Signed-off-by: Stefano Garzarella --- tools/virtio/virtio_test.c | 127 +++-- 1 file changed, 109 insertions(+), 18 deletions(-) diff --git a/tools/virtio/virtio_test.c b/tools/virtio

[RFC PATCH 4/6] tools/virtio: move feature negotiation in vdev_info_init()

2022-07-04 Thread Stefano Garzarella
The feature negotiation are per device, so it' s better to move them earlier in vdev_info_init() since vhost_vq_setup() contains the code to initialize virtqueue. Signed-off-by: Stefano Garzarella --- tools/virtio/virtio_test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[RFC PATCH 3/6] virtio_test: call __virtio_unbreak_device

2022-07-04 Thread Stefano Garzarella
Commit 8b4ec69d7e09 ("virtio: harden vring IRQ") initialize vq->broken to true, so we need to call __virtio_unbreak_device() before starting to use it. Signed-off-by: Stefano Garzarella --- tools/virtio/linux/virtio.h | 2 ++ tools/virtio/virtio_test.c | 1 + 2 files changed,

[RFC PATCH 2/6] vhost_test: add $(srctree) on the included path

2022-07-04 Thread Stefano Garzarella
Adding $(srctree) on the included path we can build vhost_test also when the kernel is not built in the source tree (make O=...). Use of EXTRA_CFLAGS is deprecated, so let's use ccflags-y. Signed-off-by: Stefano Garzarella --- tools/virtio/vhost_test/Makefile | 2 +- 1 file changed, 1

[RFC PATCH 1/6] tools/virtio: fix build

2022-07-04 Thread Stefano Garzarella
Fix the build caused by the following changes: - phys_addr_t is now defined in tools/include/linux/types.h - dev_warn_once() is used in drivers/virtio/virtio_ring.c - linux/uio.h included by vringh.h use INT_MAX defined in limits.h Signed-off-by: Stefano Garzarella --- tools/virtio/linux

[RFC PATCH 0/6] virtio_test: add support for vhost-vdpa

2022-07-04 Thread Stefano Garzarella
device $ vdpa dev add mgmtdev vdpasim_test name dev0 # run the test using the /dev/vhost-vdpa-0 device $ ./virtio_test --vdpa /dev/vhost-vdpa-0 spurious wakeups: 0x0 started=0x10 completed=0x10 Comments and suggestions are welcome :-) Thanks, Stefano Stefano Garzarella (6): tools

[PATCH v2 3/3] vdpa_sim_blk: call vringh_complete_iotlb() also in the error path

2022-06-30 Thread Stefano Garzarella
Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c index b2d75efec63a..43422b3854d2 100644 --- a/dr

[PATCH v2 2/3] vdpa_sim_blk: limit the number of request handled per batch

2022-06-30 Thread Stefano Garzarella
Limit the number of requests (4 per queue as for vdpa_sim_net) handled in a batch to prevent the worker from using the CPU for too long. Suggested-by: Eugenio Pérez Signed-off-by: Stefano Garzarella --- v2: - restored previous behaviour, exiting the loop immediately if the request

[PATCH v2 1/3] vdpa_sim_blk: use dev_dbg() to print errors

2022-06-30 Thread Stefano Garzarella
-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c index 42d401d43911..a83a5c76f620 100644 --- a/drivers/vdpa/vdpa_sim

[PATCH v2 0/3] vdpa_sim_blk: several fixes for the vDPA block simulator

2022-06-30 Thread Stefano Garzarella
of the guest doing a DoS to the host. The third makes the simulator more correct (following what we do in vdpa_sim_net) by calling vringh_complete_iotlb() in the error path as well. Stefano Garzarella (3): vdpa_sim_blk: use dev_dbg() to print errors vdpa_sim_blk: limit the number of request

Re: [PATCH v6 3/4] vhost-vdpa: uAPI to suspend the device

2022-06-28 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 06:07:37PM +0200, Eugenio Pérez wrote: >The ioctl adds support for suspending the device from userspace. > >This is a must before getting virtqueue indexes (base) for live migration, >since the device could modify them after userland gets them. There are >individual ways to

Re: [PATCH v6 2/4] vhost-vdpa: introduce SUSPEND backend feature bit

2022-06-28 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 06:07:36PM +0200, Eugenio Pérez wrote: Userland knows if it can suspend the device or not by checking this feature bit. It's only offered if the vdpa driver backend implements the suspend() operation callback, and to offer it or userland to ack it if the backend does not

Re: [PATCH v6 1/4] vdpa: Add suspend operation

2022-06-28 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 06:07:35PM +0200, Eugenio Pérez wrote: This operation is optional: It it's not implemented, backend feature bit will not be exposed. Signed-off-by: Eugenio Pérez --- include/linux/vdpa.h | 4 1 file changed, 4 insertions(+) diff --git a/include/linux/vdpa.h

Re: [PATCH 2/3] vdpa_sim_blk: limit the number of request handled per batch

2022-06-28 Thread Stefano Garzarella
On Tue, Jun 28, 2022 at 6:01 AM Jason Wang wrote: > > On Thu, Jun 23, 2022 at 4:58 PM Stefano Garzarella > wrote: > > > > On Thu, Jun 23, 2022 at 11:50:22AM +0800, Jason Wang wrote: > > >On Wed, Jun 22, 2022 at 12:09 AM Stefano Garzarella > > >wrote: >

Re: vhost-vdpa tests in tools/virtio

2022-06-27 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 11:59:56AM +0800, Jason Wang wrote: On Thu, Jun 23, 2022 at 3:21 AM Eugenio Perez Martin wrote: On Wed, Jun 22, 2022 at 5:39 PM Stefano Garzarella wrote: > > Hi, > while developing/testing the vdpa-blk support in libblkio [1], I > realized that we a

[PATCH] vringh: iterate on iotlb_translate to handle large translations

2022-06-24 Thread Stefano Garzarella
extend iotlb_translate() to also return the number of bytes successfully translated. In copy_from_iotlb()/copy_to_iotlb() loops by calling iotlb_translate() several times until we complete the translation. Signed-off-by: Stefano Garzarella --- drivers/vhost/vringh.c | 78

Re: [PATCH 2/3] vdpa_sim_blk: limit the number of request handled per batch

2022-06-23 Thread Stefano Garzarella
On Thu, Jun 23, 2022 at 11:50:22AM +0800, Jason Wang wrote: On Wed, Jun 22, 2022 at 12:09 AM Stefano Garzarella wrote: Limit the number of requests (4 per queue as for vdpa_sim_net) handled in a batch to prevent the worker from using the CPU for too long. Suggested-by: Eugenio Pérez Signed

Re: [PATCH v2 19/19] vdpasim: control virtqueue support

2022-06-22 Thread Stefano Garzarella
On Wed, Jun 22, 2022 at 05:04:44PM +0200, Eugenio Perez Martin wrote: On Wed, Jun 22, 2022 at 12:21 PM Eugenio Perez Martin wrote: On Tue, Jun 21, 2022 at 5:20 PM Stefano Garzarella wrote: > > Hi Gautam, > > On Wed, Mar 30, 2022 at 8:21 PM Gautam Dawar wrote: > > > &g

vhost-vdpa tests in tools/virtio

2022-06-22 Thread Stefano Garzarella
Hi, while developing/testing the vdpa-blk support in libblkio [1], I realized that we added several regressions with the "[PATCH v2 00/19] Control VQ support in vDPA" series (patches/clarifications already sent). To minimize these problems in the future, I was thinking of adding tests for

[PATCH] vhost-vdpa: call vhost_vdpa_cleanup during the release

2022-06-22 Thread Stefano Garzarella
leak since we are not freeing `v->vdev.vqs` during the release from the same commit. Since vhost_vdpa_cleanup() calls vhost_dev_cleanup() we can remove its call from vhost_vdpa_release(). Fixes: 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB") Cc: gautam.da...@xilinx.com

[PATCH 3/3] vdpa_sim_blk: call vringh_complete_iotlb() also in the error path

2022-06-21 Thread Stefano Garzarella
Call vringh_complete_iotlb() even when we encounter a serious error that prevents us from writing the status in the "in" header (e.g. the header length is incorrect, etc.). The guest is misbehaving, so maybe the ring is in a bad state, but let's avoid making things worse. Signed-off-b

[PATCH 2/3] vdpa_sim_blk: limit the number of request handled per batch

2022-06-21 Thread Stefano Garzarella
Limit the number of requests (4 per queue as for vdpa_sim_net) handled in a batch to prevent the worker from using the CPU for too long. Suggested-by: Eugenio Pérez Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 15 ++- 1 file changed, 14 insertions

  1   2   3   4   5   6   7   8   9   10   >