Re: [RFC PATCH v2 00/15] vsock: MSG_ZEROCOPY flag support

2023-05-03 Thread Stefano Garzarella
On Wed, May 03, 2023 at 04:11:59PM +0300, Arseniy Krasnov wrote: On 03.05.2023 15:52, Stefano Garzarella wrote: Hi Arseniy, Sorry for the delay, but I have been very busy. Hello, no problem! I can't apply this series on master or net-next, can you share with me the base commit? Here

Re: [RFC PATCH v2 00/15] vsock: MSG_ZEROCOPY flag support

2023-05-03 Thread Stefano Garzarella
Hi Arseniy, Sorry for the delay, but I have been very busy. I can't apply this series on master or net-next, can you share with me the base commit? On Sun, Apr 23, 2023 at 10:26:28PM +0300, Arseniy Krasnov wrote: Hello, DESCRIPTION this is MSG_ZEROCOPY feature

Re: [PATCH RFC net-next v2 0/4] virtio/vsock: support datagrams

2023-05-03 Thread Stefano Garzarella
On Sat, Apr 15, 2023 at 03:55:05PM +, Bobby Eshleman wrote: On Fri, Apr 28, 2023 at 12:43:09PM +0200, Stefano Garzarella wrote: On Sat, Apr 15, 2023 at 07:13:47AM +, Bobby Eshleman wrote: > CC'ing virtio-...@lists.oasis-open.org because this thread is starting > to touch th

Re: [PATCH RFC net-next v2 3/4] vsock: Add lockless sendmsg() support

2023-05-03 Thread Stefano Garzarella
On Sat, Apr 15, 2023 at 05:29:12PM +, Bobby Eshleman wrote: On Fri, Apr 28, 2023 at 12:29:50PM +0200, Stefano Garzarella wrote: On Sat, Apr 15, 2023 at 10:30:55AM +, Bobby Eshleman wrote: > On Wed, Apr 19, 2023 at 11:30:53AM +0200, Stefano Garzarella wrote: > > On Fri, Apr

Re: [Patch net] vsock: improve tap delivery accuracy

2023-05-03 Thread Stefano Garzarella
t; we should not deliver the copy to tap device in this case. So we > need to move virtio_transport_deliver_tap_pkt() down after all > possible failures. > > Fixes: 82dfb540aeb2 ("VSOCK: Add virtio vsock vsockmon hooks") > Cc: Stefan Hajnoczi > Cc: Stefano Garzarella > Cc:

Re: [PATCH RFC net-next v2 0/4] virtio/vsock: support datagrams

2023-04-28 Thread Stefano Garzarella
On Sat, Apr 15, 2023 at 07:13:47AM +, Bobby Eshleman wrote: CC'ing virtio-...@lists.oasis-open.org because this thread is starting to touch the spec. On Wed, Apr 19, 2023 at 12:00:17PM +0200, Stefano Garzarella wrote: Hi Bobby, On Fri, Apr 14, 2023 at 11:18:40AM +, Bobby Eshleman

Re: [PATCH RFC net-next v2 3/4] vsock: Add lockless sendmsg() support

2023-04-28 Thread Stefano Garzarella
On Sat, Apr 15, 2023 at 10:30:55AM +, Bobby Eshleman wrote: On Wed, Apr 19, 2023 at 11:30:53AM +0200, Stefano Garzarella wrote: On Fri, Apr 14, 2023 at 12:25:59AM +, Bobby Eshleman wrote: > Because the dgram sendmsg() path for AF_VSOCK acquires the socket lock > it does not scal

Re: [PATCH RFC net-next v2 0/4] virtio/vsock: support datagrams

2023-04-19 Thread Stefano Garzarella
Hi Bobby, On Fri, Apr 14, 2023 at 11:18:40AM +, Bobby Eshleman wrote: CC'ing Cong. On Fri, Apr 14, 2023 at 12:25:56AM +, Bobby Eshleman wrote: Hey all! This series introduces support for datagrams to virtio/vsock. Great! Thanks for restarting this work! It is a spin-off (and

Re: [PATCH RFC net-next v2 3/4] vsock: Add lockless sendmsg() support

2023-04-19 Thread Stefano Garzarella
On Fri, Apr 14, 2023 at 12:25:59AM +, Bobby Eshleman wrote: Because the dgram sendmsg() path for AF_VSOCK acquires the socket lock it does not scale when many senders share a socket. Prior to this patch the socket lock is used to protect the local_addr, remote_addr, transport, and buffer

Re: [PATCH RFC net-next v2 2/4] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2023-04-19 Thread Stefano Garzarella
On Fri, Apr 14, 2023 at 12:25:58AM +, Bobby Eshleman wrote: This commit adds a feature bit for virtio vsock to support datagrams. This commit should not be applied without first applying the commit that implements datagrams for virtio. Signed-off-by: Jiang Wang Signed-off-by: Bobby

Re: [PATCH RFC net-next v2 1/4] virtio/vsock: support dgram

2023-04-19 Thread Stefano Garzarella
On Fri, Apr 14, 2023 at 12:25:57AM +, Bobby Eshleman wrote: This commit adds support for datagrams over virtio/vsock. Message boundaries are preserved on a per-skb and per-vq entry basis. Messages are copied in whole from the user to an SKB, which in turn is added to the scatterlist for the

Re: [RFC PATCH v1] vsock/loopback: don't disable irqs for queue access

2023-04-13 Thread Stefano Garzarella
-by: Stefano Garzarella Thanks, Stefano diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c index e3afc0c866f5..5c6360df1f31 100644 --- a/net/vmw_vsock/vsock_loopback.c +++ b/net/vmw_vsock/vsock_loopback.c @@ -31,8 +31,7 @@ static int vsock_loopback_send_pkt(struct sk_buff *skb

[PATCH 2/2] vdpa_sim_blk: support shared backend

2023-04-07 Thread Stefano Garzarella
-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 57 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c b/drivers/vdpa/vdpa_sim/vdpa_sim_blk.c index c996e750dc02..00d7d72713be 100644 --- a/drivers/vdpa

[PATCH 0/2] vdpa_sim_blk: support shared backend

2023-04-07 Thread Stefano Garzarella
kend=mem \ -object memory-backend-file,share=on,id=mem,size="512M",mem-path="/dev/shm" ... -blockdev node-name=drive_src1,driver=virtio-blk-vhost-vdpa,path=/dev/vhost-vdpa-0,cache.direct=on \ -device virtio-blk-pci,id=src1,bootindex=2,drive=drive_src1 (qemu) migr

[PATCH 1/2] vdpa_sim: move buffer allocation in the devices

2023-04-07 Thread Stefano Garzarella
by the device. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3 +-- drivers/vdpa/vdpa_sim/vdpa_sim.c | 7 ++--- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 40 +++- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 28 ++- 4 files changed, 57

[PATCH v5 9/9] vdpa_sim: add support for user VA

2023-04-04 Thread Stefano Garzarella
as needed, following the documentation of mmget() in include/linux/sched/mm.h: * Never use this function to pin this address space for an * unbounded/indefinite amount of time. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v4: - checked `use_va` in vdpasim_work_fn() [

[PATCH v5 7/9] vdpa_sim: use kthread worker

2023-04-04 Thread Stefano Garzarella
Let's use our own kthread to run device jobs. This allows us more flexibility, especially we can attach the kthread to the user address space when vDPA uses user's VA. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v3: - fix `dev` not initialized in the error path

[PATCH v5 8/9] vdpa_sim: replace the spinlock with a mutex to protect the state

2023-04-04 Thread Stefano Garzarella
. For these reasons, let's replace the spinlock with a mutex that gives us more flexibility. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 4 ++-- drivers/vdpa/vdpa_sim/vdpa_sim.c | 34

[PATCH v5 6/9] vdpa_sim: make devices agnostic for work management

2023-04-04 Thread Stefano Garzarella
Let's move work management inside the vdpa_sim core. This way we can easily change how we manage the works, without having to change the devices each time. Acked-by: Eugenio Pérez Martin Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3

[PATCH v5 5/9] vringh: support VA with iotlb

2023-04-04 Thread Stefano Garzarella
vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Acked-by: Eugenio Pérez Signed-off-by: Stefano Garzarella --- Notes: v5: - s/userpace/userspace/ in the vringh_init_iotlb_va doc [Simon

[PATCH v5 4/9] vringh: define the stride used for translation

2023-04-04 Thread Stefano Garzarella
Define a macro to be reused in the different parts of the code. Useful for the next patches where we add more arrays to manage also translations with user VA. Suggested-by: Eugenio Perez Martin Signed-off-by: Stefano Garzarella --- Notes: v4: - added this patch with the changes

[PATCH v5 3/9] vringh: replace kmap_atomic() with kmap_local_page()

2023-04-04 Thread Stefano Garzarella
lt_disable() and/or preempt_disable()). This commit reuses a "boiler plate" commit message from Fabio, who has already did this change in several places. Cc: "Fabio M. De Francesco" Reviewed-by: Fabio M. De Francesco Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes

[PATCH v5 2/9] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-04-04 Thread Stefano Garzarella
-off-by: Stefano Garzarella --- Notes: v4: - added new switch after vhost_dev_ioctl() [Jason] v3: - added `case VHOST_SET_OWNER` in vhost_vdpa_unlocked_ioctl() [Jason] v2: - call the new unbind_mm callback during the release [Jason] - avoid to call bind_mm callback

[PATCH v5 0/9] vdpa_sim: add support for user VA

2023-04-04 Thread Stefano Garzarella
/20230324153607.46836-1-sgarz...@redhat.com/ v3: https://lore.kernel.org/lkml/20230321154228.182769-1-sgarz...@redhat.com/ v2: https://lore.kernel.org/lkml/20230302113421.174582-1-sgarz...@redhat.com/ RFC v1: https://lore.kernel.org/lkml/20221214163025.103075-1-sgarz...@redhat.com/ Stefano Garzarella (9

[PATCH v5 1/9] vdpa: add bind_mm/unbind_mm callbacks

2023-04-04 Thread Stefano Garzarella
These new optional callbacks is used to bind/unbind the device to a specific address space so the vDPA framework can use VA when these callbacks are implemented. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v2: - removed `struct

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

2023-04-03 Thread Stefano Garzarella
eive calls. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) LGTM! Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 5f2dda35c980..413407bb646c 100644 --- a/net/vmw_vsock/

Re: [RFC PATCH v4 1/3] vsock/vmci: convert VMCI error code to -ENOMEM on receive

2023-04-03 Thread Stefano Garzarella
Krasnov Reviewed-by: Vishnu Dasa --- net/vmw_vsock/vmci_transport.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) LGTM! Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 36eb16a40745..a5375c97f5b0 100644

Re: [PATCH net-next v4 0/3] Add support for sockmap to vsock.

2023-04-03 Thread Stefano Garzarella
On Fri, Mar 31, 2023 at 06:06:10PM -0700, John Fastabend wrote: Bobby Eshleman wrote: We're testing usage of vsock as a way to redirect guest-local UDS requests to the host and this patch series greatly improves the performance of such a setup. Compared to copying packets via userspace, this

[PATCH] vringh: fix typos in the vringh_init_* documentation

2023-03-31 Thread Stefano Garzarella
Replace `userpace` with `userspace`. Cc: Simon Horman Signed-off-by: Stefano Garzarella --- drivers/vhost/vringh.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index a1e27da54481..694462ba3242 100644

Re: [PATCH v4 5/9] vringh: support VA with iotlb

2023-03-31 Thread Stefano Garzarella
On Thu, Mar 30, 2023 at 03:02:21PM +0200, Simon Horman wrote: On Fri, Mar 24, 2023 at 04:39:19PM +0100, Stefano Garzarella wrote: vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Signed-off

Re: [RFC PATCH v3 1/4] vsock/vmci: convert VMCI error code to -ENOMEM on send

2023-03-31 Thread Stefano Garzarella
hile other patches can be sent to net-next. Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v3 2/4] vsock/vmci: convert VMCI error code to -ENOMEM on receive

2023-03-31 Thread Stefano Garzarella
On Thu, Mar 30, 2023 at 11:18:36PM +0300, Arseniy Krasnov wrote: On 30.03.2023 23:13, Arseniy Krasnov wrote: This adds conversion of VMCI specific error code to general -ENOMEM. It is needed, because af_vsock.c passes error value returned from transport to the user, which does not expect to

Re: [RFC PATCH v2 2/3] vsock/vmci: convert VMCI error code to -ENOMEM

2023-03-30 Thread Stefano Garzarella
On Thu, Mar 30, 2023 at 10:07:36AM +0300, Arseniy Krasnov wrote: This adds conversion of VMCI specific error code to general -ENOMEM. It is needed, because af_vsock.c passes error value returned from transport to the user. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/vmci_transport.c | 19

Re: [RFC PATCH v2 1/3] vsock: return errors other than -ENOMEM to socket

2023-03-30 Thread Stefano Garzarella
On Thu, Mar 30, 2023 at 10:05:45AM +0300, Arseniy Krasnov wrote: This removes behaviour, where error code returned from any transport was always switched to ENOMEM. This works in the same way as: commit c43170b7e157 ("vsock: return errors other than -ENOMEM to socket"), but for receive calls.

Re: [PATCH net v3] virtio/vsock: fix leaks due to missing skb owner

2023-03-30 Thread Stefano Garzarella
, ...), but I don't have a strong opinion on that, so that's fine too: Reviewed-by: Stefano Garzarella Thanks, Stefano ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] vdpa_sim_net: complete the initialization before register the device

2023-03-29 Thread Stefano Garzarella
ove _vdpa_register_device() to the end of vdpasim_net_dev_add() and add a comment to avoid future issues. Fixes: 0899774cb360 ("vdpa_sim_net: vendor satistics") Signed-off-by: Stefano Garzarella --- Notes: I don't have a reproducer, but I became aware of this problem while I

Re: [PATCH net v2] virtio/vsock: fix leaks due to missing skb owner

2023-03-29 Thread Stefano Garzarella
On Tue, Mar 28, 2023 at 04:29:09PM +, Bobby Eshleman wrote: This patch sets the skb owner in the recv and send path for virtio. For the send path, this solves the leak caused when virtio_transport_purge_skbs() finds skb->sk is always NULL and therefore never matches it with the current

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

2023-03-28 Thread Stefano Garzarella
On Tue, Mar 28, 2023 at 01:42:19PM +0300, Arseniy Krasnov wrote: On 28.03.2023 12:42, Stefano Garzarella wrote: I pressed send too early... CCing Bryan, Vishnu, and pv-driv...@vmware.com On Tue, Mar 28, 2023 at 11:39 AM Stefano Garzarella wrote: On Sun, Mar 26, 2023 at 01:13:11AM +0300

Re: [RFC PATCH v1 2/2] vsock/test: update expected return values

2023-03-28 Thread Stefano Garzarella
have the same behavior between transports. Reviewed-by: Stefano Garzarella Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c index

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

2023-03-28 Thread Stefano Garzarella
I pressed send too early... CCing Bryan, Vishnu, and pv-driv...@vmware.com On Tue, Mar 28, 2023 at 11:39 AM Stefano Garzarella wrote: > > On Sun, Mar 26, 2023 at 01:13:11AM +0300, Arseniy Krasnov wrote: > >This removes behaviour, where error code returned from any transport &

Re: [RFC PATCH v2 2/3] virtio/vsock: WARN_ONCE() for invalid state of socket

2023-03-28 Thread Stefano Garzarella
On Tue, Mar 28, 2023 at 11:35 AM Arseniy Krasnov wrote: > > > > On 28.03.2023 12:29, Stefano Garzarella wrote: > > On Sun, Mar 26, 2023 at 01:09:25AM +0300, Arseniy Krasnov wrote: > >> This adds WARN_ONCE() and return from stream dequeue callback when > >> so

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

2023-03-28 Thread Stefano Garzarella
On Sun, Mar 26, 2023 at 01:13:11AM +0300, Arseniy Krasnov wrote: This removes behaviour, where error code returned from any transport was always switched to ENOMEM. This works in the same way as: commit c43170b7e157 ("vsock: return errors other than -ENOMEM to socket"), but for receive calls.

Re: [RFC PATCH v2 3/3] test/vsock: new skbuff appending test

2023-03-28 Thread Stefano Garzarella
received skbuff to another. Test checks that this feature works correctly. This test is actual only for virtio transport. Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 90 1 file changed, 90 insertions(+) Reviewed-by: Stefano Garzarella

Re: [RFC PATCH v2 2/3] virtio/vsock: WARN_ONCE() for invalid state of socket

2023-03-28 Thread Stefano Garzarella
otal < len && !skb_queue_empty(>rx_queue)) { skb = skb_peek(>rx_queue); -- 2.25.1 Anyway the patch LGTM! Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v2 1/3] virtio/vsock: fix header length on skb merging

2023-03-28 Thread Stefano Garzarella
free_pkt = true; last_hdr->flags |= hdr->flags; - last_hdr->len = cpu_to_le32(last_skb->len); + le32_add_cpu(_hdr->len, len); goto out; } } -

Re: [PATCH net-next v4 1/3] vsock: support sockmap

2023-03-28 Thread Stefano Garzarella
! Reviewed-by: Stefano Garzarella Thanks, Stefano ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH net] virtio/vsock: fix leak due to missing skb owner

2023-03-28 Thread Stefano Garzarella
On Mon, Mar 27, 2023 at 10:01:05PM +, Bobby Eshleman wrote: This patch sets the owner for the skb when being sent from a socket and so solves the leak caused when virtio_transport_purge_skbs() finds skb->sk is always NULL and therefore never matches it with the current socket. Setting the

Re: [PATCH net-next] testing/vsock: add vsock_perf to gitignore

2023-03-28 Thread Stefano Garzarella
Reviewed-by: Stefano Garzarella diff --git a/tools/testing/vsock/.gitignore b/tools/testing/vsock/.gitignore index 87ca2731cff9..a8adcfdc292b 100644 --- a/tools/testing/vsock/.gitignore +++ b/tools/testing/vsock/.gitignore @@ -2,3 +2,4 @@ *.d vsock_test vsock_diag_test +vsock_perf --- b

Re: [syzbot] [net?] [virt?] [io-uring?] [kvm?] BUG: soft lockup in vsock_connect

2023-03-27 Thread Stefano Garzarella
On Sat, Mar 25, 2023 at 1:44 AM Bobby Eshleman wrote: > > On Fri, Mar 24, 2023 at 09:38:38AM +0100, Stefano Garzarella wrote: > > Hi Bobby, > > FYI we have also this one, but it seems related to > > syzbot+befff0a9536049e79...@syzkaller.appspotmail.com > > >

[PATCH v4 9/9] vdpa_sim: add support for user VA

2023-03-24 Thread Stefano Garzarella
as needed, following the documentation of mmget() in include/linux/sched/mm.h: * Never use this function to pin this address space for an * unbounded/indefinite amount of time. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v4: - checked `use_va` in vdpasim_work_fn() [

[PATCH v4 8/9] vdpa_sim: replace the spinlock with a mutex to protect the state

2023-03-24 Thread Stefano Garzarella
. For these reasons, let's replace the spinlock with a mutex that gives us more flexibility. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 4 ++-- drivers/vdpa/vdpa_sim/vdpa_sim.c | 34

[PATCH v4 7/9] vdpa_sim: use kthread worker

2023-03-24 Thread Stefano Garzarella
Let's use our own kthread to run device jobs. This allows us more flexibility, especially we can attach the kthread to the user address space when vDPA uses user's VA. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v3: - fix `dev` not initialized in the error path

[PATCH v4 6/9] vdpa_sim: make devices agnostic for work management

2023-03-24 Thread Stefano Garzarella
Let's move work management inside the vdpa_sim core. This way we can easily change how we manage the works, without having to change the devices each time. Acked-by: Eugenio Pérez Martin Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3

[PATCH v4 5/9] vringh: support VA with iotlb

2023-03-24 Thread Stefano Garzarella
vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Signed-off-by: Stefano Garzarella --- Notes: v4: - used uintptr_t for `io_addr` [Eugenio] - added `io_addr` and `io_len` variables

[PATCH v4 4/9] vringh: define the stride used for translation

2023-03-24 Thread Stefano Garzarella
Define a macro to be reused in the different parts of the code. Useful for the next patches where we add more arrays to manage also translations with user VA. Suggested-by: Eugenio Perez Martin Signed-off-by: Stefano Garzarella --- Notes: v4: - added this patch with the changes

[PATCH v4 2/9] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-03-24 Thread Stefano Garzarella
-off-by: Stefano Garzarella --- Notes: v4: - added new switch after vhost_dev_ioctl() [Jason] v3: - added `case VHOST_SET_OWNER` in vhost_vdpa_unlocked_ioctl() [Jason] v2: - call the new unbind_mm callback during the release [Jason] - avoid to call bind_mm callback

[PATCH v4 1/9] vdpa: add bind_mm/unbind_mm callbacks

2023-03-24 Thread Stefano Garzarella
These new optional callbacks is used to bind/unbind the device to a specific address space so the vDPA framework can use VA when these callbacks are implemented. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v2: - removed `struct

[PATCH v4 3/9] vringh: replace kmap_atomic() with kmap_local_page()

2023-03-24 Thread Stefano Garzarella
lt_disable() and/or preempt_disable()). This commit reuses a "boiler plate" commit message from Fabio, who has already did this change in several places. Cc: "Fabio M. De Francesco" Reviewed-by: Fabio M. De Francesco Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes

[PATCH v4 0/9] vdpa_sim: add support for user VA

2023-03-24 Thread Stefano Garzarella
/20230321154228.182769-1-sgarz...@redhat.com/ v2: https://lore.kernel.org/lkml/20230302113421.174582-1-sgarz...@redhat.com/ RFC v1: https://lore.kernel.org/lkml/20221214163025.103075-1-sgarz...@redhat.com/ Stefano Garzarella (9): vdpa: add bind_mm/unbind_mm callbacks vhost-vdpa: use bind_mm/unbind_mm

Re: [syzbot] [net?] [virt?] [io-uring?] [kvm?] BUG: soft lockup in vsock_connect

2023-03-24 Thread Stefano Garzarella
#syz dup general protection fault in virtio_transport_purge_skbs On Fri, Mar 24, 2023 at 1:52 AM syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit:fe15c26ee26e Linux 6.3-rc1 > git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git >

Re: [PATCH v3 8/8] vdpa_sim: add support for user VA

2023-03-24 Thread Stefano Garzarella
On Fri, Mar 24, 2023 at 11:49:32AM +0800, Jason Wang wrote: 在 2023/3/21 23:48, Stefano Garzarella 写道: The new "use_va" module parameter (default: true) is used in vdpa_alloc_device() to inform the vDPA framework that the device supports VA. vringh is initialized to use VA only wh

Re: [PATCH v3 8/8] vdpa_sim: add support for user VA

2023-03-24 Thread Stefano Garzarella
On Fri, Mar 24, 2023 at 10:54:39AM +0800, Jason Wang wrote: On Thu, Mar 23, 2023 at 5:50 PM Stefano Garzarella wrote: On Thu, Mar 23, 2023 at 11:42:07AM +0800, Jason Wang wrote: >On Tue, Mar 21, 2023 at 11:48 PM Stefano Garzarella wrote: >> >> The new "use_va"

Re: [PATCH v3 4/8] vringh: support VA with iotlb

2023-03-24 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 03:43:34PM +0100, Eugenio Perez Martin wrote: On Thu, Mar 23, 2023 at 11:46 AM Stefano Garzarella wrote: On Thu, Mar 23, 2023 at 09:09:14AM +0100, Eugenio Perez Martin wrote: >On Tue, Mar 21, 2023 at 4:43 PM Stefano Garzarella wrote: >> >>

Re: [syzbot] [kvm?] [net?] [virt?] general protection fault in virtio_transport_purge_skbs

2023-03-24 Thread Stefano Garzarella
On Fri, Mar 24, 2023 at 10:06 AM Stefano Garzarella wrote: > > On Fri, Mar 24, 2023 at 9:55 AM Stefano Garzarella > wrote: > > > > On Fri, Mar 24, 2023 at 9:31 AM Stefano Garzarella > > wrote: > > > > > > Hi Bobby, > > > can you ta

[PATCH net] vsock/loopback: use only sk_buff_head.lock to protect the packet queue

2023-03-24 Thread Stefano Garzarella
tmail.com Signed-off-by: Stefano Garzarella --- net/vmw_vsock/vsock_loopback.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c index 671e03240fc5..89905c092645 100644 --- a/net/vmw_vsock/vsock_loopback.c

Re: [syzbot] [kvm?] [net?] [virt?] general protection fault in virtio_transport_purge_skbs

2023-03-24 Thread Stefano Garzarella
On Fri, Mar 24, 2023 at 10:10 AM Arseniy Krasnov wrote: > On 24.03.2023 12:06, Stefano Garzarella wrote: > > On Fri, Mar 24, 2023 at 9:55 AM Stefano Garzarella > > wrote: > >> > >> On Fri, Mar 24, 2023 at 9:31 AM Stefano Garzarella > >> wrote: >

Re: [syzbot] [kvm?] [net?] [virt?] general protection fault in virtio_transport_purge_skbs

2023-03-24 Thread Stefano Garzarella
On Fri, Mar 24, 2023 at 9:55 AM Stefano Garzarella wrote: > > On Fri, Mar 24, 2023 at 9:31 AM Stefano Garzarella > wrote: > > > > Hi Bobby, > > can you take a look at this report? > > > > It seems related to the changes we made to support skbuff. > &g

Re: [syzbot] [kvm?] [net?] [virt?] general protection fault in virtio_transport_purge_skbs

2023-03-24 Thread Stefano Garzarella
On Fri, Mar 24, 2023 at 9:31 AM Stefano Garzarella wrote: > > Hi Bobby, > can you take a look at this report? > > It seems related to the changes we made to support skbuff. Could it be a problem of concurrent access to pkt_queue ? IIUC we should hold pkt_queue.lo

Re: [syzbot] [net?] [virt?] [io-uring?] [kvm?] BUG: soft lockup in vsock_connect

2023-03-24 Thread Stefano Garzarella
Hi Bobby, FYI we have also this one, but it seems related to syzbot+befff0a9536049e79...@syzkaller.appspotmail.com Thanks, Stefano On Fri, Mar 24, 2023 at 1:52 AM syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit:fe15c26ee26e Linux 6.3-rc1 > git tree:

Re: [syzbot] [kvm?] [net?] [virt?] general protection fault in virtio_transport_purge_skbs

2023-03-24 Thread Stefano Garzarella
Hi Bobby, can you take a look at this report? It seems related to the changes we made to support skbuff. Thanks, Stefano On Fri, Mar 24, 2023 at 1:52 AM syzbot wrote: > > Hello, > > syzbot found the following issue on: > > HEAD commit:fff5a5e7f528 Merge tag 'for-linus' of

Re: [RFC PATCH v5 0/2] allocate multiple skbuffs on tx

2023-03-23 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 01:53:40PM +0300, Arseniy Krasnov wrote: On 23.03.2023 13:48, Stefano Garzarella wrote: On Thu, Mar 23, 2023 at 01:01:40PM +0300, Arseniy Krasnov wrote: Hello Stefano, thanks for review! You're welcome! Since both patches are R-b, i can wait for a few days

Re: [RFC PATCH v5 0/2] allocate multiple skbuffs on tx

2023-03-23 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 01:01:40PM +0300, Arseniy Krasnov wrote: Hello Stefano, thanks for review! You're welcome! Since both patches are R-b, i can wait for a few days, then send this as 'net-next'? Yep, maybe even this series could have been directly without RFC ;-) Thanks, Stefano

Re: [PATCH v3 4/8] vringh: support VA with iotlb

2023-03-23 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 09:09:14AM +0100, Eugenio Perez Martin wrote: On Tue, Mar 21, 2023 at 4:43 PM Stefano Garzarella wrote: vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Signed-off

Re: [PATCH v3 4/8] vringh: support VA with iotlb

2023-03-23 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 11:36:28AM +0800, Jason Wang wrote: On Tue, Mar 21, 2023 at 11:43 PM Stefano Garzarella wrote: vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Signed-off-by: Stefano

Re: [PATCH v3 8/8] vdpa_sim: add support for user VA

2023-03-23 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 11:42:07AM +0800, Jason Wang wrote: On Tue, Mar 21, 2023 at 11:48 PM Stefano Garzarella wrote: The new "use_va" module parameter (default: true) is used in vdpa_alloc_device() to inform the vDPA framework that the device supports VA. vringh is initialized

Re: [PATCH v3 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-03-23 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 11:01:39AM +0800, Jason Wang wrote: On Tue, Mar 21, 2023 at 11:42 PM Stefano Garzarella wrote: When the user call VHOST_SET_OWNER ioctl and the vDPA device has `use_va` set to true, let's call the bind_mm callback. In this way we can bind the device to the user address

Re: [RFC PATCH v5 2/2] virtio/vsock: check argument to avoid no effect call

2023-03-23 Thread Stefano Garzarella
, 6 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 9e87c7d4d7cf..312658c176bd 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -302,6 +302,9

Re: [PATCH 1/1] vhost_task: Fix vhost_task_create return value

2023-03-23 Thread Stefano Garzarella
ocess") # mainline only Reported-by: syzbot+6b27b2d2aba1c80cc...@syzkaller.appspotmail.com Signed-off-by: Mike Christie --- kernel/vhost_task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garzarella diff --git a/kernel/vhost_task.c b/kernel/vhost_ta

Re: [RFC PATCH v4] virtio/vsock: allocate multiple skbuffs on tx

2023-03-22 Thread Stefano Garzarella
/* Return number of bytes, if any data has been sent. */ + if (rest_len != pkt_len) + ret = pkt_len - rest_len; + + return ret; } static bool virtio_transport_inc_rx_pkt(struct virtio_vsock_sock *vvs, -- 2.25.1 The patch LGTM: Reviewed-by: Stefano Garzar

[PATCH v3 6/8] vdpa_sim: use kthread worker

2023-03-21 Thread Stefano Garzarella
Let's use our own kthread to run device jobs. This allows us more flexibility, especially we can attach the kthread to the user address space when vDPA uses user's VA. Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v3: - fix `dev` not initialized in the error path

[PATCH v3 5/8] vdpa_sim: make devices agnostic for work management

2023-03-21 Thread Stefano Garzarella
Let's move work management inside the vdpa_sim core. This way we can easily change how we manage the works, without having to change the devices each time. Acked-by: Eugenio Pérez Martin Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3

[PATCH v3 8/8] vdpa_sim: add support for user VA

2023-03-21 Thread Stefano Garzarella
as needed, following the documentation of mmget() in include/linux/sched/mm.h: * Never use this function to pin this address space for an * unbounded/indefinite amount of time. Signed-off-by: Stefano Garzarella --- Notes: v3: - called mmget_not_zero() before kthread_use_mm() [Jason]

[PATCH v3 7/8] vdpa_sim: replace the spinlock with a mutex to protect the state

2023-03-21 Thread Stefano Garzarella
. For these reasons, let's replace the spinlock with a mutex that gives us more flexibility. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 4 ++-- drivers/vdpa/vdpa_sim/vdpa_sim.c | 34

[PATCH v3 4/8] vringh: support VA with iotlb

2023-03-21 Thread Stefano Garzarella
vDPA supports the possibility to use user VA in the iotlb messages. So, let's add support for user VA in vringh to use it in the vDPA simulators. Signed-off-by: Stefano Garzarella --- Notes: v3: - refactored avoiding code duplication [Eugenio] v2: - replace kmap_atomic

[PATCH v3 3/8] vringh: replace kmap_atomic() with kmap_local_page()

2023-03-21 Thread Stefano Garzarella
lt_disable() and/or preempt_disable()). This commit reuses a "boiler plate" commit message from Fabio, who has already did this change in several places. Cc: "Fabio M. De Francesco" Signed-off-by: Stefano Garzarella --- Notes: v3: - credited Fabio for the commit message -

[PATCH v3 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-03-21 Thread Stefano Garzarella
-off-by: Stefano Garzarella --- Notes: v3: - added `case VHOST_SET_OWNER` in vhost_vdpa_unlocked_ioctl() [Jason] v2: - call the new unbind_mm callback during the release [Jason] - avoid to call bind_mm callback after the reset, since the device is not detaching it now

[PATCH v3 0/8] vdpa_sim: add support for user VA

2023-03-21 Thread Stefano Garzarella
/20230302113421.174582-1-sgarz...@redhat.com/ RFC v1: https://lore.kernel.org/lkml/20221214163025.103075-1-sgarz...@redhat.com/ Stefano Garzarella (8): vdpa: add bind_mm/unbind_mm callbacks vhost-vdpa: use bind_mm/unbind_mm device callbacks vringh: replace kmap_atomic() with kmap_local_page() vringh

[PATCH v3 1/8] vdpa: add bind_mm/unbind_mm callbacks

2023-03-21 Thread Stefano Garzarella
These new optional callbacks is used to bind/unbind the device to a specific address space so the vDPA framework can use VA when these callbacks are implemented. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella --- Notes: v2: - removed `struct task_struct *owner` param

Re: [RFC PATCH v3] virtio/vsock: allocate multiple skbuffs on tx

2023-03-21 Thread Stefano Garzarella
On Tue, Mar 21, 2023 at 12:31:48AM +0300, Arseniy Krasnov wrote: This adds small optimization for tx path: instead of allocating single skbuff on every call to transport, allocate multiple skbuff's until credit space allows, thus trying to send as much as possible data without return to

Re: [RFC PATCH v1 1/3] virtio/vsock: fix header length on skb merging

2023-03-21 Thread Stefano Garzarella
On Mon, Mar 20, 2023 at 09:10:13PM +0300, Arseniy Krasnov wrote: On 20.03.2023 17:57, Stefano Garzarella wrote: On Sun, Mar 19, 2023 at 09:51:06PM +0300, Arseniy Krasnov wrote: This fixes header length calculation of skbuff during data appending to it. When such skbuff is processed

Re: [RFC PATCH v2] virtio/vsock: allocate multiple skbuffs on tx

2023-03-21 Thread Stefano Garzarella
On Mon, Mar 20, 2023 at 09:02:19PM +0300, Arseniy Krasnov wrote: On 20.03.2023 17:29, Stefano Garzarella wrote: On Sun, Mar 19, 2023 at 09:46:10PM +0300, Arseniy Krasnov wrote: This adds small optimization for tx path: instead of allocating single skbuff on every call to transport, allocate

Re: [RFC PATCH v1 3/3] test/vsock: skbuff merging test

2023-03-20 Thread Stefano Garzarella
On Sun, Mar 19, 2023 at 09:53:54PM +0300, Arseniy Krasnov wrote: This adds test which checks case when data of newly received skbuff is appended to the last skbuff in the socket's queue. This test is actual only for virtio transport. Signed-off-by: Arseniy Krasnov ---

Re: [RFC PATCH v1 2/3] virtio/vsock: add WARN() for invalid state of socket

2023-03-20 Thread Stefano Garzarella
On Sun, Mar 19, 2023 at 09:52:19PM +0300, Arseniy Krasnov wrote: This prints WARN() and returns from stream dequeue callback when socket's queue is empty, but 'rx_bytes' still non-zero. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/virtio_transport_common.c | 7 +++ 1 file changed, 7

Re: [RFC PATCH v1 1/3] virtio/vsock: fix header length on skb merging

2023-03-20 Thread Stefano Garzarella
On Sun, Mar 19, 2023 at 09:51:06PM +0300, Arseniy Krasnov wrote: This fixes header length calculation of skbuff during data appending to it. When such skbuff is processed in dequeue callbacks, e.g. 'skb_pull()' is called on it, 'skb->len' is dynamic value, so it is impossible to use it in

Re: [RFC PATCH v2] virtio/vsock: allocate multiple skbuffs on tx

2023-03-20 Thread Stefano Garzarella
On Sun, Mar 19, 2023 at 09:46:10PM +0300, Arseniy Krasnov wrote: This adds small optimization for tx path: instead of allocating single skbuff on every call to transport, allocate multiple skbuff's until credit space allows, thus trying to send as much as possible data without return to

Re: [RFC PATCH v1] virtio/vsock: check transport before skb allocation

2023-03-20 Thread Stefano Garzarella
changed, 3 insertions(+), 5 deletions(-) LGTM, I think net-next is fine for this. Reviewed-by: Stefano Garzarella Thanks, Stefano diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index cda587196475..607149259e8b 100644 --- a/net/vmw_vsock

Re: [PATCH v2 4/8] vringh: support VA with iotlb

2023-03-17 Thread Stefano Garzarella
On Fri, Mar 17, 2023 at 10:49:27AM +0100, Eugenio Perez Martin wrote: On Thu, Mar 16, 2023 at 5:07 PM Stefano Garzarella wrote: On Fri, Mar 3, 2023 at 3:39 PM Eugenio Perez Martin wrote: > > On Thu, Mar 2, 2023 at 12:35 PM Stefano Garzarella wrote: > > > > vDPA suppor

Re: [PATCH v2 4/8] vringh: support VA with iotlb

2023-03-16 Thread Stefano Garzarella
On Fri, Mar 3, 2023 at 3:39 PM Eugenio Perez Martin wrote: > > On Thu, Mar 2, 2023 at 12:35 PM Stefano Garzarella > wrote: > > > > vDPA supports the possibility to use user VA in the iotlb messages. > > So, let's add support for user VA in vringh to use it

Re: [PATCH v2 2/8] vhost-vdpa: use bind_mm/unbind_mm device callbacks

2023-03-16 Thread Stefano Garzarella
On Thu, Mar 16, 2023 at 9:31 AM Stefano Garzarella wrote: > > On Tue, Mar 14, 2023 at 11:48:33AM +0800, Jason Wang wrote: > >On Thu, Mar 2, 2023 at 7:34 PM Stefano Garzarella > >wrote: > >> > >> When the user call VHOST_SET_OWNER ioctl and the vDPA device

Re: [PATCH v2 3/8] vringh: replace kmap_atomic() with kmap_local_page()

2023-03-16 Thread Stefano Garzarella
On Thu, Mar 16, 2023 at 10:13:39AM +0100, Fabio M. De Francesco wrote: On giovedì 2 marzo 2023 12:34:16 CET Stefano Garzarella wrote: kmap_atomic() is deprecated in favor of kmap_local_page(). With kmap_local_page() the mappings are per thread, CPU local, can take page-faults, and can

<    1   2   3   4   5   6   7   8   9   10   >