[RFC PATCH 4/6] vdpa_sim: make devices agnostic for work management

2022-12-14 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. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 3 ++- drivers/vdpa/vdpa_sim/vdpa_sim.c | 17

[RFC PATCH 6/6] vdpa_sim: add support for user VA

2022-12-14 Thread Stefano Garzarella
VA (e.g. vhost-vdpa). vdpasim_mm_work_fn work is used to attach the kthread to the user address space when the .bind_mm callback is invoked, and to detach it when the device is reset. Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.h | 1 + drivers/vdpa/vdpa_

[RFC PATCH 3/6] vringh: support VA with iotlb

2022-12-14 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 --- include/linux/vringh.h | 5 +- drivers/vdpa/mlx5/core/resources.c | 3 +- drivers/vdpa/mlx5/net

[RFC PATCH 2/6] vhost-vdpa: use bind_mm device callback

2022-12-14 Thread Stefano Garzarella
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 space and directly use the user VA. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 22

[RFC PATCH 0/6] vdpa_sim: add support for user VA

2022-12-14 Thread Stefano Garzarella
. Thanks, Stefano Note: this series is based on Linux v6.1 + couple of fixes (that I needed to run libblkio tests) already posted but not yet merged. Tree available here: https://gitlab.com/sgarzarella/linux/-/tree/vdpa-sim-use-va Stefano Garzarella (6): vdpa: add bind_mm callback vhost-vdpa

[RFC PATCH 1/6] vdpa: add bind_mm callback

2022-12-14 Thread Stefano Garzarella
This new optional callback is used to bind the device to a specific address space so the vDPA framework can use VA when this callback is implemented. Suggested-by: Jason Wang Signed-off-by: Stefano Garzarella --- include/linux/vdpa.h | 8 1 file changed, 8 insertions(+) diff --git

Re: [PATCH net-next v7] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-12-14 Thread Stefano Garzarella
g2h Before: 11.86 Mb/s After: 17.41 Mb/s (+46%) Test: 64KB, h2g Before: 2.15 Gb/s After: 3.6 Gb/s (+67%) Test: 16B, h2g Before: 14.38 Mb/s After: 18.43 Mb/s (+28%) Signed-off-by: Bobby Eshleman --- Note: v7 only built, not retested since v6. I re-tested and everything seems okay: Reviewed-b

Re: [PATCH net-next v6] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-12-13 Thread Stefano Garzarella
On Tue, Dec 13, 2022 at 10:06:23AM -0500, Michael S. Tsirkin wrote: On Tue, Dec 13, 2022 at 11:22:32AM +0100, Stefano Garzarella wrote: > + if (len <= GOOD_COPY_LEN && !skb_queue_empty_lockless(>rx_queue)) { Same here. If there are no major changes to be made, I think

Re: [RFC PATCH v4 4/4] test/vsock: vsock_perf utility

2022-12-13 Thread Stefano Garzarella
On Tue, Dec 06, 2022 at 08:54:28PM +, Arseniy Krasnov wrote: This adds utility to check vsock rx/tx performance. Usage as sender: ./vsock_perf --sender --port --bytes Little typo "". I mean replace `)` with `>` Usage as receiver: ./vsock_perf --port --rcvlowat Signed-off-by:

Re: [RFC PATCH v4 2/4] test/vsock: rework message bounds test

2022-12-13 Thread Stefano Garzarella
/testing/vsock/vsock_test.c | 128 +++ 5 files changed, 157 insertions(+), 15 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https

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

2022-12-13 Thread Stefano Garzarella
, but this error code will be replaced to ENOMEM and returned to user. Just a minor thing here, I would write "this error code was always replaced with ENOMEM and returned to user" To make it clearer that it was the previous behavior. Anyway, the patch LGTM: Reviewed-by: Stefano

Re: [PATCH net-next v6] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-12-13 Thread Stefano Garzarella
On Tue, Dec 13, 2022 at 07:25:49AM +, Bobby Eshleman wrote: This commit changes virtio/vsock to use sk_buff instead of virtio_vsock_pkt. Beyond better conforming to other net code, using sk_buff allows vsock to use sk_buff-dependent features in the future (such as sockmap) and improves

Re: [PATCH 1/1] virtio/vsock: Make vsock virtio packet buff size configurable

2022-12-12 Thread Stefano Garzarella
On Fri, Dec 09, 2022 at 07:48:02PM +, Carlos Llamas wrote: On Thu, Jul 22, 2021 at 02:55:19PM +0200, Stefano Garzarella wrote: > > +uint virtio_transport_max_vsock_pkt_buf_size = 1024 * 64; > +module_param(virtio_transport_max_vsock_pkt_buf_size, uint, 0444); > +EXPOR

Re: [PATCH v2] vp_vdpa: harden the logic of set status

2022-12-06 Thread Stefano Garzarella
On Tue, Dec 06, 2022 at 10:13:21AM +0800, Longpeng(Mike) wrote: From: Longpeng 1. We should not set status to 0 when invoking vp_vdpa_set_status(), trigger a warning in that case. 2. The driver MUST wait for a read of device_status to return 0 before reinitializing the device. But we also

Re: [RFC PATCH v3 4/4] test/vsock: vsock_perf utility

2022-12-05 Thread Stefano Garzarella
On Sun, Dec 04, 2022 at 07:24:33PM +, Arseniy Krasnov wrote: This adds utility to check vsock rx/tx performance. Usage as sender: ./vsock_perf --port --mb --port --so_rcvlowat Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/Makefile | 1 + tools/testing/vsock/README

Re: [RFC PATCH v3 2/4] test/vsock: rework message bounds test

2022-12-05 Thread Stefano Garzarella
On Sun, Dec 04, 2022 at 07:20:52PM +, Arseniy Krasnov wrote: This updates message bound test making it more complex. Instead of sending 1 bytes messages with one MSG_EOR bit, it sends messages of random length(one half of messages are smaller than page size, second half are bigger) with

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

2022-12-05 Thread Stefano Garzarella
On Sun, Dec 04, 2022 at 07:19:20PM +, Arseniy Krasnov wrote: From: Bobby Eshleman This removes behaviour, where error code returned from any transport was always switched to ENOMEM. I would add here the example you described in the cover letter with EMSGSIZE, so the problem is better

Re: [PATCH v3] net: vmw_vsock: vmci: Check memcpy_from_msg()

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

Re: [PATCH v5] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-12-05 Thread Stefano Garzarella
s issue fixed, I confirm that all the tests passed: Reviewed-by: Stefano Garzarella As pointed out in v4, this is net-next material, so you should use the net-next tag and base the patch on the net-next tree: https://www.kernel.org/doc/html/v6.0/process/maintainer-netdev.html#netdev-faq I

Re: [PATCH v2] net: vmw_vsock: vmci: Check memcpy_from_msg()

2022-12-05 Thread Stefano Garzarella
better here to return the value of memcpy_from_msg() instead of wiring the error. However in the end the behavior is the same, so even if you don't want to change it I'll leave my R-b: Reviewed-by: Stefano Garzarella Thanks, Stefano ___ Virtu

Re: [RFC PATCH v2 5/6] test/vsock: add big message test

2022-12-05 Thread Stefano Garzarella
On Thu, Dec 01, 2022 at 11:44:39AM +, Arseniy Krasnov wrote: On 01.12.2022 12:45, Stefano Garzarella wrote: On Fri, Nov 25, 2022 at 05:13:06PM +, Arseniy Krasnov wrote: This adds test for sending message, bigger than peer's buffer size. For SOCK_SEQPACKET socket it must fail

Re: [RFC PATCH v2 6/6] test/vsock: vsock_perf utility

2022-12-01 Thread Stefano Garzarella
On Fri, Nov 25, 2022 at 05:15:08PM +, Arseniy Krasnov wrote: This adds utility to check vsock rx/tx performance. Usage as sender: ./vsock_perf -p -m -p -r Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/Makefile | 1 + tools/testing/vsock/README | 34 +++

Re: [RFC PATCH v2 5/6] test/vsock: add big message test

2022-12-01 Thread Stefano Garzarella
run_server = test_stream_poll_rcvlowat_server, }, + { + .name = "SOCK_SEQPACKET big message", + .run_client = test_seqpacket_bigmsg_client, + .run_server = test_seqpacket_bigmsg_server, + }, {}, }; -- 2.25.1 LGTM! Reviewed-b

Re: [RFC PATCH v2 4/6] test/vsock: rework message bounds test

2022-12-01 Thread Stefano Garzarella
On Fri, Nov 25, 2022 at 05:10:35PM +, Arseniy Krasnov wrote: This updates message bound test making it more complex. Instead of sending 1 bytes messages with one MSG_EOR bit, it sends messages of random length(one half of messages are smaller than page size, second half are bigger) with

Re: [RFC PATCH v2 3/6] vsock/vmci: always return ENOMEM in case of error

2022-12-01 Thread Stefano Garzarella
On Fri, Nov 25, 2022 at 05:08:06PM +, Arseniy Krasnov wrote: From: Bobby Eshleman This saves original behaviour from af_vsock.c - switch any error code returned from transport layer to ENOMEM. Signed-off-by: Bobby Eshleman Signed-off-by: Arseniy Krasnov ---

Re: [RFC PATCH v2 2/6] hv_sock: always return ENOMEM in case of error

2022-12-01 Thread Stefano Garzarella
On Fri, Nov 25, 2022 at 05:05:53PM +, Arseniy Krasnov wrote: From: Bobby Eshleman This saves original behaviour from af_vsock.c - switch any error code returned from transport layer to ENOMEM. Signed-off-by: Bobby Eshleman Signed-off-by: Arseniy Krasnov ---

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

2022-12-01 Thread Stefano Garzarella
On Fri, Nov 25, 2022 at 05:03:06PM +, Arseniy Krasnov wrote: From: Bobby Eshleman This removes behaviour, where error code returned from any transport was always switched to ENOMEM. Signed-off-by: Bobby Eshleman Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 3 ++- 1 file

Re: [PATCH v2] vduse: Validate vq_num in vduse_validate_config()

2022-11-28 Thread Stefano Garzarella
On Mon, Nov 28, 2022 at 01:58:00PM +0300, Dan Carpenter wrote: On Mon, Nov 28, 2022 at 11:53:12AM +0100, Stefano Garzarella wrote: On Mon, Nov 28, 2022 at 12:36:26AM -0800, Harshit Mogalapalli wrote: > Add a limit to 'config->vq_num' which is user controlled data which > c

Re: [PATCH v2] vduse: Validate vq_num in vduse_validate_config()

2022-11-28 Thread Stefano Garzarella
On Mon, Nov 28, 2022 at 12:36:26AM -0800, Harshit Mogalapalli wrote: Add a limit to 'config->vq_num' which is user controlled data which comes from an vduse_ioctl to prevent large memory allocations. This is found using static analysis with smatch. Suggested-by: Michael S. Tsirkin

Re: [PATCH v2] vhost_vdpa: fix the crash in unmap a large memory

2022-11-28 Thread Stefano Garzarella
On Fri, Nov 25, 2022 at 10:23:17AM +0800, Cindy Lu wrote: While testing in vIOMMU, sometimes guest will unmap very large memory, which will cause the crash. To fix this,Move the iommu_unmap to vhost_vdpa_pa_unmap/vhost_vdpa_va_unmap and only unmap the memory that saved in iotlb. Call Trace: [

Re: [PATCH v4] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-11-24 Thread Stefano Garzarella
On Thu, Nov 24, 2022 at 06:13:49PM +0300, Arseniy Krasnov wrote: Hello Stefano On 24.11.2022 18:00, Stefano Garzarella wrote: This is a net-next material, please remember to use net-next tag: https://www.kernel.org/doc/html/v6.0/process/maintainer-netdev.html#netdev-faq On Wed, Nov 23, 2022

Re: [PATCH v4] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-11-24 Thread Stefano Garzarella
On Thu, Nov 24, 2022 at 05:30:24PM +0300, Arseniy Krasnov wrote: Hello Bobby, On 24.11.2022 09:07, Bobby Eshleman wrote: This commit changes virtio/vsock to use sk_buff instead of virtio_vsock_pkt. Beyond better conforming to other net code, using sk_buff allows vsock to use sk_buff-dependent

Re: [PATCH v4] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-11-24 Thread Stefano Garzarella
This is a net-next material, please remember to use net-next tag: https://www.kernel.org/doc/html/v6.0/process/maintainer-netdev.html#netdev-faq On Wed, Nov 23, 2022 at 10:07:49PM -0800, Bobby Eshleman wrote: This commit changes virtio/vsock to use sk_buff instead of virtio_vsock_pkt. Beyond

Re: [RFC PATCH v1 1/3] test/vsock: rework message bound test

2022-11-23 Thread Stefano Garzarella
On Mon, Nov 21, 2022 at 04:49:23PM +, Arseniy Krasnov wrote: On 21.11.2022 17:46, Stefano Garzarella wrote: On Tue, Nov 15, 2022 at 08:50:36PM +, Arseniy Krasnov wrote: This updates message bound test making it more complex. Instead of sending 1 bytes messages with one MSG_EOR bit

Re: [RFC PATCH v1 2/3] test/vsock: add big message test

2022-11-23 Thread Stefano Garzarella
On Mon, Nov 21, 2022 at 09:40:39PM +, Arseniy Krasnov wrote: On 21.11.2022 19:50, Arseniy Krasnov wrote: On 21.11.2022 17:52, Stefano Garzarella wrote: On Tue, Nov 15, 2022 at 08:52:35PM +, Arseniy Krasnov wrote: This adds test for sending message, bigger than peer's buffer size

Re: [RFC PATCH v1 3/3] test/vsock: vsock_perf utility

2022-11-21 Thread Stefano Garzarella
On Tue, Nov 15, 2022 at 08:54:05PM +, Arseniy Krasnov wrote: This adds utility to check vsock receive performance. A small example on how to use it here in the commit message would be nice. Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/Makefile | 1 + Please, can you

Re: [RFC PATCH v1 2/3] test/vsock: add big message test

2022-11-21 Thread Stefano Garzarella
On Tue, Nov 15, 2022 at 08:52:35PM +, Arseniy Krasnov wrote: This adds test for sending message, bigger than peer's buffer size. For SOCK_SEQPACKET socket it must fail, as this type of socket has message size limit. Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 62

Re: [RFC PATCH v1 1/3] test/vsock: rework message bound test

2022-11-21 Thread Stefano Garzarella
On Tue, Nov 15, 2022 at 08:50:36PM +, Arseniy Krasnov wrote: This updates message bound test making it more complex. Instead of sending 1 bytes messages with one MSG_EOR bit, it sends messages of random length(one half of messages are smaller than page size, second half are bigger) with

Re: [PATCH v3] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-11-18 Thread Stefano Garzarella
On Fri, Nov 18, 2022 at 04:18:35AM +, Bobby Eshleman wrote: On Fri, Nov 11, 2022 at 01:24:11PM +0100, Stefano Garzarella wrote: On Thu, Nov 10, 2022 at 09:17:22AM -0800, Bobby Eshleman wrote: > This commit changes virtio/vsock to use sk_buff instead of > virtio_vsock_pkt. Beyond

Re: [PATCH] vdpa_sim_net: Offer VIRTIO_NET_F_STATUS

2022-11-17 Thread Stefano Garzarella
et options, using vhost_vdpa. Not considering as a fix, because there should be no driver trusting in this config read before the feature flag. Signed-off-by: Eugenio Pérez --- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Stefano

Re: [PATCH] vdpa_sim: fix vringh initialization in vdpasim_queue_ready()

2022-11-14 Thread Stefano Garzarella
On Mon, Nov 14, 2022 at 10:13:51AM +0100, Eugenio Perez Martin wrote: On Fri, Nov 11, 2022 at 5:30 PM Stefano Garzarella wrote: On Fri, Nov 11, 2022 at 04:40:33PM +0100, Eugenio Perez Martin wrote: >On Thu, Nov 10, 2022 at 3:13 PM Stefano Garzarella wrote: >> >> When we initia

Re: [PATCH] vp_vdpa: harden the logic of set status

2022-11-11 Thread Stefano Garzarella
On Fri, Nov 11, 2022 at 11:49:10PM +0800, Longpeng (Mike, Cloud Infrastructure Service Product Dept.) wrote: 在 2022/11/11 23:14, Stefano Garzarella 写道: On Fri, Nov 11, 2022 at 10:55:05PM +0800, Longpeng(Mike) wrote: From: Longpeng 1. We should not set status to 0 when invoking

Re: [PATCH] vdpa_sim: fix vringh initialization in vdpasim_queue_ready()

2022-11-11 Thread Stefano Garzarella
On Fri, Nov 11, 2022 at 04:40:33PM +0100, Eugenio Perez Martin wrote: On Thu, Nov 10, 2022 at 3:13 PM Stefano Garzarella wrote: When we initialize vringh, we should pass the features and the number of elements in the virtqueue negotiated with the driver, otherwise operations with vringh may

Re: [PATCH] vp_vdpa: harden the logic of set status

2022-11-11 Thread Stefano Garzarella
On Fri, Nov 11, 2022 at 10:55:05PM +0800, Longpeng(Mike) wrote: From: Longpeng 1. We should not set status to 0 when invoking vp_vdpa_set_status(). 2. The driver MUST wait for a read of device_status to return 0 before reinitializing the device. Signed-off-by: Longpeng ---

Re: [RFC PATCH v3 00/11] virtio/vsock: experimental zerocopy receive

2022-11-11 Thread Stefano Garzarella
On Fri, Nov 11, 2022 at 2:47 PM Stefano Garzarella wrote: > > Hi Arseniy, > maybe we should start rebasing this series on the new support for > skbuff: > https://lore.kernel.org/lkml/20221110171723.24263-1-bobby.eshle...@bytedance.com/ > > CCing Bobby to see if it's easy to i

Re: [RFC PATCH v3 08/11] test/vsock: rework message bound test

2022-11-11 Thread Stefano Garzarella
On Sun, Nov 06, 2022 at 07:48:56PM +, Arseniy Krasnov wrote: This updates message bound test making it more complex. Instead of sending 1 bytes messages with one MSG_EOR bit, it sends messages of random length(one half of messages are smaller than page size, second half are bigger) with

Re: [RFC PATCH v3 03/11] af_vsock: add zerocopy receive logic

2022-11-11 Thread Stefano Garzarella
On Sun, Nov 06, 2022 at 07:40:12PM +, Arseniy Krasnov wrote: This: 1) Adds callback for 'mmap()' call on socket. It checks vm area flags and sets vm area ops. 2) Adds special 'getsockopt()' case which calls transport zerocopy callback. Input argument is vm area address. 3) Adds

Re: [RFC PATCH v3 00/11] virtio/vsock: experimental zerocopy receive

2022-11-11 Thread Stefano Garzarella
Hi Arseniy, maybe we should start rebasing this series on the new support for skbuff: https://lore.kernel.org/lkml/20221110171723.24263-1-bobby.eshle...@bytedance.com/ CCing Bobby to see if it's easy to integrate since you're both changing the packet allocation. On Sun, Nov 06, 2022 at

Re: [PATCH v3] virtio/vsock: replace virtio_vsock_pkt with sk_buff

2022-11-11 Thread Stefano Garzarella
On Thu, Nov 10, 2022 at 09:17:22AM -0800, Bobby Eshleman wrote: This commit changes virtio/vsock to use sk_buff instead of virtio_vsock_pkt. Beyond better conforming to other net code, using sk_buff allows vsock to use sk_buff-dependent features in the future (such as sockmap) and improves

[PATCH] vdpa_sim: fix vringh initialization in vdpasim_queue_ready()

2022-11-10 Thread Stefano Garzarella
by .get_vq_num_max(). In vdpasim_vq_reset() is safe to initialize the vringh with default values, since the virtqueue will not be used until vdpasim_queue_ready() is called again. Fixes: 2c53d0f64c06 ("vdpasim: vDPA device simulator") Signed-off-by: Stefano Garzarella --- drivers/vdp

Re: [PATCH v2] vdpa_sim: fix possible memory leak in vdpasim_net_init() and vdpasim_blk_init()

2022-11-10 Thread Stefano Garzarella
ges In this case we should use the following tags: Fixes: 899c4d187f6a ("vdpa_sim_blk: add support for vdpa management tool") Fixes: a3c06ae158dd ("vdpa_sim_net: Add support for user supported devices") With them: Reviewed-

Re: [PATCH] vhost-vdpa: fix potential memory leak during the release

2022-11-09 Thread Stefano Garzarella
On Wed, Nov 09, 2022 at 12:47:19PM -0500, Michael S. Tsirkin wrote: On Wed, Nov 09, 2022 at 04:42:13PM +0100, Stefano Garzarella wrote: Before commit 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB") we call vhost_vdpa_iotlb_unmap(v, iotlb, 0ULL, 0ULL - 1) during the release t

[PATCH] vhost-vdpa: fix potential memory leak during the release

2022-11-09 Thread Stefano Garzarella
tries. The kmemleak log reported was observed with a vDPA device that has `use_va` set to true (e.g. VDUSE). This patch has been tested with both types of devices. Fixes: 037d4305569a ("vhost-vdpa: call vhost_vdpa_cleanup during the release") Fixes: 3d5698793897 ("vhost-vdpa: introduc

[PATCH v2 2/2] vhost: fix range used in translate_desc()

2022-11-09 Thread Stefano Garzarella
to vhost_iotlb_itree_first(), but we should hold the `last` parameter constant. Let's fix it by saving the `last` parameter value before incrementing `addr` in the loop. Fixes: a9709d6874d5 ("vhost: convert pre sorted vhost memory array to interval tree") Acked-by: Jason Wang Signed-off-by: Stefano

[PATCH v2 1/2] vringh: fix range used in iotlb_translate()

2022-11-09 Thread Stefano Garzarella
to vhost_iotlb_itree_first(), but we should hold the `last` parameter constant. Let's fix it by saving the `last` parameter value before incrementing `addr` in the loop. Fixes: 9ad9c49cfe97 ("vringh: IOTLB support") Acked-by: Jason Wang Signed-off-by: Stefano Garzarella --- drivers/vhost/vr

[PATCH v2 0/2] vhost: fix ranges when call vhost_iotlb_itree_first()

2022-11-09 Thread Stefano Garzarella
stopped taking into account the total amount of bytes translated, but I think it's better to fix. Thanks, Stefano Stefano Garzarella (2): vringh: fix range used in iotlb_translate() vhost: fix range used in translate_desc() drivers/vhost/vhost.c | 4 ++-- drivers/vhost/vringh.c | 5 ++--- 2

Re: [PATCH 2/2] vhost: fix range used in translate_desc()

2022-11-09 Thread Stefano Garzarella
On Wed, Nov 09, 2022 at 11:28:41AM +0800, Jason Wang wrote: On Tue, Nov 8, 2022 at 6:34 PM Stefano Garzarella wrote: vhost_iotlb_itree_first() requires `start` and `last` parameters to search for a mapping that overlaps the range. In translate_desc() we cyclically call

[PATCH 1/2] vringh: fix range used in iotlb_translate()

2022-11-08 Thread Stefano Garzarella
to vhost_iotlb_itree_first(), but we should hold the `last` parameter constant. Let's fix it by saving the `last` parameter value before incrementing `addr` in the loop. Fixes: 9ad9c49cfe97 ("vringh: IOTLB support") Signed-off-by: Stefano Garzarella --- drivers/vhost/vringh.c | 5 ++--- 1 file

[PATCH 2/2] vhost: fix range used in translate_desc()

2022-11-08 Thread Stefano Garzarella
to vhost_iotlb_itree_first(), but we should hold the `last` parameter constant. Let's fix it by saving the `last` parameter value before incrementing `addr` in the loop. Fixes: 0bbe30668d89 ("vhost: factor out IOTLB") Signed-off-by: Stefano Garzarella --- I'm not sure about the fixes tag. On the

[PATCH 0/2] vhost: fix ranges when call vhost_iotlb_itree_first()

2022-11-08 Thread Stefano Garzarella
because I noticed the problem by looking at the code. Maybe we didn't have a problem, because a shorter range was being returned anyway and the loop stopped taking into account the total amount of bytes translated, but I think it's better to fix. Thanks, Stefano Stefano Garzarella (2): vringh

Re: [PATCH v2] vhost/vsock: Fix error handling in vhost_vsock_init()

2022-11-08 Thread Stefano Garzarella
ck.ko") Signed-off-by: Yuan Can --- Changes in v2: - change to the correct Fixes: tag I forgot to mention that anyway the patch was okay for me :-) and so: Reviewed-by: Stefano Garzarella Thanks, Stefano drivers/vhost/vsock.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-)

Re: [PATCH] vhost/vsock: Fix error handling in vhost_vsock_init()

2022-11-08 Thread Stefano Garzarella
On Tue, Nov 08, 2022 at 09:13:57AM +, Yuan Can wrote: A problem about modprobe vhost_vsock failed is triggered with the following log given: modprobe: ERROR: could not insert 'vhost_vsock': Device or resource busy The reason is that vhost_vsock_init() returns misc_register() directly

Re: [PATCH] vdpa_sim: fix possible memory leak in vdpasim_net_init() and vdpasim_blk_init()

2022-11-07 Thread Stefano Garzarella
should be: Fixes: 899c4d187f6a ("vdpa_sim_blk: add support for vdpa management tool") Fixes: a3c06ae158dd ("vdpa_sim_net: Add support for user supported devices") With them: Reviewed-by: Stefano Garzarella Thanks, Stefano ___ Vi

Re: Issue with VDUSE (QSD vduse-blk export) and vhost-vdpa

2022-11-03 Thread Stefano Garzarella
On Wed, Oct 26, 2022 at 12:17 PM Stefano Garzarella wrote: > > On Wed, Oct 26, 2022 at 05:39:23PM +0800, Yongji Xie wrote: > >Hi Stefano, > > > >On Wed, Oct 26, 2022 at 5:12 PM Stefano Garzarella > >wrote: > >> > >> Hi Xie, > >> I was te

Re: [PATCH 2/2] vsock: fix possible infinite sleep in vsock_connectible_wait_data()

2022-11-02 Thread Stefano Garzarella
On Tue, Nov 01, 2022 at 09:21:06PM +0100, Frederic Dalleau via Virtualization wrote: Hi Dexan, Stephano, This solution has been proposed here, https://lists.linuxfoundation.org/pipermail/virtualization/2022-August/062656.html Ops, I missed it! Did you use scripts/get_maintainer.pl?

Re: [PATCH v2 2/2] vsock: fix possible infinite sleep in vsock_connectible_wait_data()

2022-11-02 Thread Stefano Garzarella
On Wed, Nov 02, 2022 at 10:31:37AM +0100, Stefano Garzarella wrote: On Mon, Oct 31, 2022 at 07:17:06PM -0700, Dexuan Cui wrote: Currently vsock_connectible_has_data() may miss a wakeup operation between vsock_connectible_has_data() == 0 and the prepare_to_wait(). Fix the race by adding

Re: [PATCH v2 2/2] vsock: fix possible infinite sleep in vsock_connectible_wait_data()

2022-11-02 Thread Stefano Garzarella
(). Fixes: b3f7fd54881b ("af_vsock: separate wait data loop") Signed-off-by: Dexuan Cui --- Changes in v2 (Thanks Stefano!): Fixed a typo in the commit message. Removed the unnecessary finish_wait() at the end of the loop. LGTM: Reviewed-by: Stefano Garzarella net/vmw_vsock/af_v

Re: [PATCH 2/2] vsock: fix possible infinite sleep in vsock_connectible_wait_data()

2022-10-31 Thread Stefano Garzarella
On Fri, Oct 28, 2022 at 01:56:46PM -0700, Dexuan Cui wrote: Currently vsock_connectible_has_data() may miss a wakeup operation between vsock_connectible_has_data() == 0 and the prepare_to_wait(). Fix the race by adding the process to the wait qeuue before checking s/qeuue/queue

Re: [PATCH 1/2] vsock: remove the unused 'wait' in vsock_connectible_recvmsg()

2022-10-31 Thread Stefano Garzarella
Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index ee418701cdee..d258fd43092e 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -2092,8 +2092,6 @@ vsock_connectible_recvmsg(struct socket *sock, struct msghdr *msg,

Re: Issue with VDUSE (QSD vduse-blk export) and vhost-vdpa

2022-10-26 Thread Stefano Garzarella
On Wed, Oct 26, 2022 at 05:39:23PM +0800, Yongji Xie wrote: Hi Stefano, On Wed, Oct 26, 2022 at 5:12 PM Stefano Garzarella wrote: Hi Xie, I was testing libblkio [1] with QSD vduse-blk export and had some issues. In a nutshell, QSD prints me the following messages when using vhost-vdpa

Re: [PATCH] virtio_blk: Fix signedness bug in virtblk_prep_rq()

2022-10-24 Thread Stefano Garzarella
t mq_ops->queue_rqs()") Signed-off-by: Rafael Mendonca --- drivers/block/virtio_blk.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Good catch! Reviewed-by: Stefano Garzarella diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 19da5defd734..291

Re: [RFC PATCH] virtio: document virtio hardening status and TODO

2022-10-18 Thread Stefano Garzarella
I'm not a native speaker, so the following suggestions can be wrong :-) On Fri, Oct 14, 2022 at 12:20:37PM +0800, Jason Wang wrote: This patch summarizes the status of hardening and TODO of hardening virtio core and drivers. Signed-off-by: Jason Wang --- Documentation/security/virtio/core.rst

Re: [PATCH v2] vsock: replace virtio_vsock_pkt with sk_buff

2022-10-14 Thread Stefano Garzarella
On Wed, Oct 05, 2022 at 06:19:44PM -0700, Bobby Eshleman wrote: This patch replaces the struct virtio_vsock_pkt with struct sk_buff. Using sk_buff in vsock benefits it by a) allowing vsock to be extended for socket-related features like sockmap, b) vsock may in the future use other

Re: [PATCH v2] vsock: replace virtio_vsock_pkt with sk_buff

2022-10-06 Thread Stefano Garzarella
On Thu, Oct 06, 2022 at 03:08:12AM -0400, Michael S. Tsirkin wrote: On Wed, Oct 05, 2022 at 06:19:44PM -0700, Bobby Eshleman wrote: This patch replaces the struct virtio_vsock_pkt with struct sk_buff. Using sk_buff in vsock benefits it by a) allowing vsock to be extended for socket-related

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

2022-10-05 Thread Stefano Garzarella
On Thu, Aug 11, 2022 at 10:47 AM Stefano Garzarella wrote: > > Use __virtio16_to_cpu() to read `max_virtqueue_pairs` field in > virtio_net_config since its type is __virtio16. > > This silences the following warning when building with `make C=2`: > > ../drivers/vdpa/v

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

2022-10-04 Thread Stefano Garzarella
1 << VDPA_ATTR_DEV_NET_CFG_MTU), +1 << VDPA_ATTR_DEV_NET_CFG_MTU | +1 << VDPA_ATTR_DEV_FEATURES), .max_supported_vqs = VDPASIM_NET_VQ_NUM, .supported_features = VDPASIM_NET_FEATURES, }; -- 2.25

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

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