Re: [PATCH net-next v3 1/3] vsock/virtio: use skb_frag_*() helpers

2024-01-02 Thread Stefano Garzarella
-off-by: Mina Almasry --- v2: - Also fix skb_frag_off() + skb_frag_size() (David) - Did not apply the reviewed-by from Stefano since the patch changed relatively much. Sorry for the delay, I was off. LGTM! Acked-by: Stefano Garzarella Possibly we can also send this patch alone if the series

Re: [RFC PATCH v1] vsock/test: add '--peer-port' input argument

2024-01-15 Thread Stefano Garzarella
Hi Arseniy, thanks for this patch! On Sat, Jan 13, 2024 at 12:21:10AM +0300, Arseniy Krasnov wrote: Implement port for given CID as input argument instead of using hardcoded value '1234'. This allows to run different test instances on a single CID. Port argument is not required parameter and if

Re: [PATCH V1] vdpa_sim: reset must not run

2024-01-22 Thread Stefano Garzarella
On Wed, Jan 17, 2024 at 11:23:23AM -0800, Steve Sistare wrote: vdpasim_do_reset sets running to true, which is wrong, as it allows vdpasim_kick_vq to post work requests before the device has been configured. To fix, do not set running until VIRTIO_CONFIG_S_FEATURES_OK is set. Fixes: 0c89e2a3a9d

Re: Re: [PATCH V1] vdpa_sim: reset must not run

2024-01-22 Thread Stefano Garzarella
On Mon, Jan 22, 2024 at 11:47:22AM +0100, Eugenio Perez Martin wrote: On Mon, Jan 22, 2024 at 11:22 AM Stefano Garzarella wrote: On Wed, Jan 17, 2024 at 11:23:23AM -0800, Steve Sistare wrote: >vdpasim_do_reset sets running to true, which is wrong, as it allows >vdpasim_kick_vq to pos

Re: [PATCH net-next v2] vsock/test: add '--peer-port' input argument

2024-01-23 Thread Stefano Garzarella
ault value will be '1234' - thus we preserve previous behaviour. Signed-off-by: Arseniy Krasnov --- Changelog: v1 -> v2: * Reword usage message. * Add commas after last field in 'opts' declaration. * 'RFC' -> 'net-next'. Thanks for the changes,

Re: [PATCH net-next v1] vsock/test: print type for SOCK_SEQPACKET

2024-01-25 Thread Stefano Garzarella
! Reviewed-by: Stefano Garzarella diff --git a/tools/testing/vsock/vsock_diag_test.c b/tools/testing/vsock/vsock_diag_test.c index 5e6049226b77..17aeba7cbd14 100644 --- a/tools/testing/vsock/vsock_diag_test.c +++ b/tools/testing/vsock/vsock_diag_test.c @@ -39,6 +39,8 @@ static const char

[PATCH] vhost-vdpa: fail enabling virtqueue in certain conditions

2024-02-06 Thread Stefano Garzarella
U for not meeting this requirement, see https://lore.kernel.org/qemu-devel/20240202132521.32714-1-kw...@redhat.com/ Fixes: 9f09fd6171fe ("vdpa: accept VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK backend feature") Cc: epere...@redhat.com Signed-off-by: Stefano Garzarella --- include/uapi/linu

Re: Re: [PATCH] vhost-vdpa: fail enabling virtqueue in certain conditions

2024-02-06 Thread Stefano Garzarella
On Tue, Feb 06, 2024 at 10:56:50AM -0500, Michael S. Tsirkin wrote: better @subj: try late vq enable only if negotiated I rewrote it 3/4 times, and before sending it I was not happy with the result. Thank you, much better! I'll change it in v2. Stefano

Re: Re: [PATCH] vhost-vdpa: fail enabling virtqueue in certain conditions

2024-02-07 Thread Stefano Garzarella
On Wed, Feb 07, 2024 at 11:27:14AM +0800, Jason Wang wrote: On Tue, Feb 6, 2024 at 10:52 PM Stefano Garzarella wrote: If VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK is not negotiated, we expect the driver to enable virtqueue before setting DRIVER_OK. If the driver tries anyway, better to fail

Re: [PATCH net-next 1/2] net/vsockmon: Leverage core stats allocator

2024-02-26 Thread Stefano Garzarella
+--- 1 file changed, 1 insertion(+), 15 deletions(-) Thanks for this patch! Reviewed-by: Stefano Garzarella diff --git a/drivers/net/vsockmon.c b/drivers/net/vsockmon.c index b1bb1b04b664..a0b4dca36baf 100644 --- a/drivers/net/vsockmon.c +++ b/drivers/net/vsockmon.c @@ -13,

Re: [PATCH net-next 2/2] net/vsockmon: Do not set zeroed statistics

2024-02-26 Thread Stefano Garzarella
ons(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/net/vsockmon.c b/drivers/net/vsockmon.c index a0b4dca36baf..a1ba5169ed5d 100644 --- a/drivers/net/vsockmon.c +++ b/drivers/net/vsockmon.c @@ -46,9 +46,6 @@ static void vsockmon_get_stats64(struct net_device *dev, struct rtnl_link_stat

Re: [PATCH v3] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI

2024-03-20 Thread Stefano Garzarella
On Wed, Mar 20, 2024 at 06:19:12PM +0800, Wang Rong wrote: From: Rong Wang Once enable iommu domain for one device, the MSI translation tables have to be there for software-managed MSI. Otherwise, platform with software-managed MSI without an irq bypass function, can not get a correct memory wr

Re: [PATCH] vsock/virtio: fix packet delivery to tap device

2024-03-25 Thread Stefano Garzarella
On Mon, Mar 25, 2024 at 06:12:38PM +0100, Marco Pinna wrote: Commit 82dfb540aeb2 ("VSOCK: Add virtio vsock vsockmon hooks") added virtio_transport_deliver_tap_pkt() for handing packets to the vsockmon device. However, in virtio_transport_send_pkt_work(), the function is called before actually sen

Re: [PATCH v3 1/3] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-28 Thread Stefano Garzarella
Reported-by: Yihuang Yu Suggested-by: Will Deacon Signed-off-by: Gavin Shan Acked-by: Jason Wang --- drivers/vhost/vhost.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 0

Re: [PATCH v3 2/3] vhost: Add smp_rmb() in vhost_enable_notify()

2024-03-28 Thread Stefano Garzarella
ted-by: Yihuang Yu Suggested-by: Will Deacon Signed-off-by: Gavin Shan Acked-by: Jason Wang --- drivers/vhost/vhost.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) Thanks for fixing this! Reviewed-by: Stefano Garzarella diff --git a/drivers/vhost/vhost.c b/dr

Re: [PATCH net v2] vsock/virtio: fix packet delivery to tap device

2024-03-29 Thread Stefano Garzarella
er calling virtqueue_add_sgs() and making sure it returned successfully. Fixes: 82dfb540aeb2 ("VSOCK: Add virtio vsock vsockmon hooks") Cc: sta...@vge.kernel.org Signed-off-by: Marco Pinna --- net/vmw_vsock/virtio_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [PATCH] vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE

2024-04-03 Thread Stefano Garzarella
ased any kernels with this yet, right? (other than v6.9-rc*) LGTM: Reviewed-by: Stefano Garzarella include/uapi/linux/vhost.h | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h index bea697390613..b95dd84e

Re: [PATCH] vhost/vsock: always initialize seqpacket_allow

2024-05-16 Thread Stefano Garzarella
rseniy Krasnov Tested-by: Arseniy Krasnov --- Reposting now it's been tested. drivers/vhost/vsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Thanks for fixing this issue! Reviewed-by: Stefano Garzarella

Re: [RFC PATCH v1 0/2] send credit update during setting SO_RCVLOWAT

2023-11-15 Thread Stefano Garzarella
On Wed, Nov 08, 2023 at 10:20:02AM +0300, Arseniy Krasnov wrote: Hello, DESCRIPTION This patchset fixes old problem with hungup of both rx/tx sides and adds test for it. This happens due to non-default SO_RCVLOWAT value and deferred credit update in virtio/vsock. L

Re: [RFC PATCH v1 1/2] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-11-15 Thread Stefano Garzarella
On Wed, Nov 08, 2023 at 10:20:03AM +0300, Arseniy Krasnov wrote: This adds sending credit update message when SO_RCVLOWAT is updated and it is bigger than number of bytes in rx queue. It is needed, because 'poll()' will wait until number of bytes in rx queue will be not smaller than SO_RCVLOWAT,

Re: [RFC PATCH v1 2/2] vsock/test: SO_RCVLOWAT + deferred credit update test

2023-11-15 Thread Stefano Garzarella
On Wed, Nov 08, 2023 at 10:20:04AM +0300, Arseniy Krasnov wrote: This adds test which checks, that updating SO_RCVLOWAT value also sends You can avoid "This adds", and write just "Add test ...". See https://docs.kernel.org/process/submitting-patches.html#describe-your-changes Describe yo

Re: [RFC PATCH v1 2/2] vsock/test: SO_RCVLOWAT + deferred credit update test

2023-11-17 Thread Stefano Garzarella
On Fri, Nov 17, 2023 at 10:12:38AM +0300, Arseniy Krasnov wrote: On 15.11.2023 14:11, Stefano Garzarella wrote: On Wed, Nov 08, 2023 at 10:20:04AM +0300, Arseniy Krasnov wrote: This adds test which checks, that updating SO_RCVLOWAT value also sends You can avoid "This adds", and

Re: [PATCH net v1] vsock/test: fix SEQPACKET message bounds test

2023-11-22 Thread Stefano Garzarella
k: rework message bounds test") Signed-off-by: Arseniy Krasnov --- tools/testing/vsock/vsock_test.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) The fix LGTM and it worked on aarch64 machine. Reviewed-by: Stefano Garzarella Thanks for the fast fix!

Re: [RFC PATCH v3 2/3] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-11-29 Thread Stefano Garzarella
On Wed, Nov 22, 2023 at 09:05:09PM +0300, Arseniy Krasnov wrote: Send credit update message when SO_RCVLOWAT is updated and it is bigger than number of bytes in rx queue. It is needed, because 'poll()' will wait until number of bytes in rx queue will be not smaller than SO_RCVLOWAT, so kick sende

Re: [RFC PATCH v3 3/3] vsock/test: SO_RCVLOWAT + deferred credit update test

2023-11-29 Thread Stefano Garzarella
On Wed, Nov 22, 2023 at 09:05:10PM +0300, Arseniy Krasnov wrote: Test which checks, that updating SO_RCVLOWAT value also sends credit update message. Otherwise mutual hungup may happen when receiver didn't send credit update and then calls 'poll()' with non default SO_RCVLOWAT value (e.g. waiting

Re: [RFC PATCH v3 3/3] vsock/test: SO_RCVLOWAT + deferred credit update test

2023-11-29 Thread Stefano Garzarella
On Wed, Nov 29, 2023 at 12:16:54PM +0300, Arseniy Krasnov wrote: On 29.11.2023 12:16, Stefano Garzarella wrote: On Wed, Nov 22, 2023 at 09:05:10PM +0300, Arseniy Krasnov wrote: Test which checks, that updating SO_RCVLOWAT value also sends credit update message. Otherwise mutual hungup may

Re: [RFC PATCH v4 2/3] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-11-30 Thread Stefano Garzarella
On Thu, Nov 30, 2023 at 12:25:18AM +0300, Arseniy Krasnov wrote: Send credit update message when SO_RCVLOWAT is updated and it is bigger than number of bytes in rx queue. It is needed, because 'poll()' will wait until number of bytes in rx queue will be not smaller than SO_RCVLOWAT, so kick sende

Re: [RFC PATCH v4 3/3] vsock/test: SO_RCVLOWAT + deferred credit update test

2023-11-30 Thread Stefano Garzarella
On Thu, Nov 30, 2023 at 12:25:19AM +0300, Arseniy Krasnov wrote: Test which checks, that updating SO_RCVLOWAT value also sends credit update message. Otherwise mutual hungup may happen when receiver didn't send credit update and then calls 'poll()' with non default SO_RCVLOWAT value (e.g. waiting

Re: [PATCH net-next v5 2/3] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-11-30 Thread Stefano Garzarella
io_transport_read_skb, + .notify_set_rcvlowat = virtio_transport_notify_set_rcvlowat As we discussed in chat, better the order of the previous version, but leaving the line of `.read_skb` untouched (with the final comma). With that fixed in all transports, feel free to add: Revie

Re: [PATCH net-next v5 3/3] vsock/test: SO_RCVLOWAT + deferred credit update test

2023-11-30 Thread Stefano Garzarella
On Thu, Nov 30, 2023 at 04:08:40PM +0300, Arseniy Krasnov wrote: Test which checks, that updating SO_RCVLOWAT value also sends credit update message. Otherwise mutual hungup may happen when receiver didn't send credit update and then calls 'poll()' with non default SO_RCVLOWAT value (e.g. waiting

Re: [PATCH net-next v5 2/3] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-12-01 Thread Stefano Garzarella
On Thu, Nov 30, 2023 at 12:40:43PM -0500, Michael S. Tsirkin wrote: On Thu, Nov 30, 2023 at 03:11:19PM +0100, Stefano Garzarella wrote: On Thu, Nov 30, 2023 at 08:58:58AM -0500, Michael S. Tsirkin wrote: > On Thu, Nov 30, 2023 at 04:43:34PM +0300, Arseniy Krasnov wrote: > > &

Re: [PATCH net-next v5 2/3] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-12-01 Thread Stefano Garzarella
On Fri, Dec 01, 2023 at 11:35:56AM +0300, Arseniy Krasnov wrote: On 01.12.2023 11:27, Stefano Garzarella wrote: On Thu, Nov 30, 2023 at 12:40:43PM -0500, Michael S. Tsirkin wrote: On Thu, Nov 30, 2023 at 03:11:19PM +0100, Stefano Garzarella wrote: On Thu, Nov 30, 2023 at 08:58:58AM -0500

Re: [PATCH net-next v5 2/3] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-12-04 Thread Stefano Garzarella
On Sat, Dec 02, 2023 at 03:22:39PM -0500, Michael S. Tsirkin wrote: On Fri, Dec 01, 2023 at 01:40:41PM +0300, Arseniy Krasnov wrote: On 01.12.2023 12:48, Stefano Garzarella wrote: > On Fri, Dec 01, 2023 at 11:35:56AM +0300, Arseniy Krasnov wrote: >> >> >> On 01.1

Re: [PATCH net-next v6 3/4] virtio/vsock: fix logic which reduces credit update messages

2023-12-05 Thread Stefano Garzarella
On Tue, Dec 05, 2023 at 09:48:05AM +0300, Arseniy Krasnov wrote: Add one more condition for sending credit update during dequeue from stream socket: when number of bytes in the rx queue is smaller than SO_RCVLOWAT value of the socket. This is actual for non-default value of SO_RCVLOWAT (e.g. not

Re: [PATCH net-next v6 4/4] vsock/test: two tests to check credit update logic

2023-12-05 Thread Stefano Garzarella
f bytes ready to read is equal to SO_RCVLOWAT value. v4 -> v5: * Use 'recv_buf(MSG_DONTWAIT)' instead of 'recv(MSG_DONTWAIT)'. v5 -> v6: * Add second test which checks, that credit update is sent during reading data from socket. * Update commit message. tools/testing/vsock/vs

Re: [PATCH net-next v6 3/4] virtio/vsock: fix logic which reduces credit update messages

2023-12-05 Thread Stefano Garzarella
On Tue, Dec 05, 2023 at 03:07:47PM +0300, Arseniy Krasnov wrote: On 05.12.2023 13:54, Stefano Garzarella wrote: On Tue, Dec 05, 2023 at 09:48:05AM +0300, Arseniy Krasnov wrote: Add one more condition for sending credit update during dequeue from stream socket: when number of bytes in the rx

[PATCH net] vsock/virtio: fix "comparison of distinct pointer types lacks a cast" warning

2023-12-06 Thread Stefano Garzarella
ixes: 581512a6dc93 ("vsock/virtio: MSG_ZEROCOPY flag support") Cc: avkras...@salutedevices.com Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/vmw_vsock/virtio_transport_common.c b/net

Re: [PATCH net-next v7 3/4] virtio/vsock: fix logic which reduces credit update messages

2023-12-11 Thread Stefano Garzarella
On Thu, Dec 07, 2023 at 01:50:05AM +0300, Arseniy Krasnov wrote: On 07.12.2023 01:08, Michael S. Tsirkin wrote: On Thu, Dec 07, 2023 at 12:52:51AM +0300, Arseniy Krasnov wrote: On 07.12.2023 00:53, Michael S. Tsirkin wrote: On Thu, Dec 07, 2023 at 12:18:48AM +0300, Arseniy Krasnov wrote:

Re: [PATCH net-next v7 2/4] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-12-11 Thread Stefano Garzarella
+++ net/vmw_vsock/vsock_loopback.c | 1 + 5 files changed, 34 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index f75731396b7e..ec20ecff85c7 100644 --- a/drivers/vhost/vsock.c +++ b/driver

Re: [PATCH] vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()

2023-12-11 Thread Stefano Garzarella
pen. So yes, we need to fix it! Thanks! Reviewed-by: Stefano Garzarella if (bytes < 0) bytes = 0; -- 2.34.1

Re: [PATCH v2] vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()

2023-12-11 Thread Stefano Garzarella
Signed-off-by: Nikolay Kuratov --- V1 -> V2: Added Fixes section Please, next time carry also R-b tags. net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garzarella Thanks, Stefano diff --git a/net/vmw_vsock/virtio_tr

Re: [PATCH net-next v8 3/4] virtio/vsock: fix logic which reduces credit update messages

2023-12-12 Thread Stefano Garzarella
nt'. net/vmw_vsock/virtio_transport_common.c | 13 ++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 e137d740804e..8572f94bb

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-13 Thread Stefano Garzarella
On Tue, Dec 12, 2023 at 08:43:07PM +0300, Arseniy Krasnov wrote: On 12.12.2023 19:12, Michael S. Tsirkin wrote: On Tue, Dec 12, 2023 at 06:59:03PM +0300, Arseniy Krasnov wrote: On 12.12.2023 18:54, Michael S. Tsirkin wrote: On Tue, Dec 12, 2023 at 12:16:54AM +0300, Arseniy Krasnov wrote:

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-13 Thread Stefano Garzarella
On Wed, Dec 13, 2023 at 12:08:27PM +0300, Arseniy Krasnov wrote: On 13.12.2023 11:43, Stefano Garzarella wrote: On Tue, Dec 12, 2023 at 08:43:07PM +0300, Arseniy Krasnov wrote: On 12.12.2023 19:12, Michael S. Tsirkin wrote: On Tue, Dec 12, 2023 at 06:59:03PM +0300, Arseniy Krasnov wrote

Re: [PATCH net-next v8 0/4] send credit update during setting SO_RCVLOWAT

2023-12-14 Thread Stefano Garzarella
On Wed, Dec 13, 2023 at 08:11:57PM +0300, Arseniy Krasnov wrote: On 13.12.2023 18:13, Michael S. Tsirkin wrote: On Wed, Dec 13, 2023 at 10:05:44AM -0500, Michael S. Tsirkin wrote: On Wed, Dec 13, 2023 at 12:08:27PM +0300, Arseniy Krasnov wrote: On 13.12.2023 11:43, Stefano Garzarella

Re: [PATCH net-next v9 0/4] send credit update during setting SO_RCVLOWAT

2023-12-14 Thread Stefano Garzarella
ode in patch 3 I don't have a strong opinion, but I slightly prefer option a. BTW that forces us to backport more patches on stable branches, so I'm fine with option b as well. That said: Nacked-by: Stefano Garzarella

Re: [PATCH net-next v9 2/4] virtio/vsock: send credit update during setting SO_RCVLOWAT

2023-12-14 Thread Stefano Garzarella
T, so kick sender to send more data. Otherwise mutual hungup for tx/rx is possible: sender waits for free space and receiver is waiting data in 'poll()'. Fixes: b89d882dc9fc ("vsock/virtio: reduce credit update messages") Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano G

Re: [RFC PATCH 1/5] vsock/virtio: Extend virtio-vsock spec with an "order" field

2024-05-23 Thread Stefano Garzarella
As Alyssa suggested, we should discuss spec changes in the virtio ML. BTW as long as this is an RFC, it's fine. Just be sure, though, to remember to merge the change in the specification first versus the patches in Linux. So I recommend that you don't send a non-RFC set into Linux until you hav

Re: [RFC PATCH 2/5] vsock/virtio: Add support for multi-devices

2024-05-23 Thread Stefano Garzarella
On Fri, May 17, 2024 at 10:46:04PM GMT, Xuewei Niu wrote: The maximum number of devices is limited by `MAX_VSOCK_NUM`. Extends `vsock_transport` struct with 4 methods to support multi-devices: * `get_virtio_vsock()`: It receives a CID, and returns a struct of virtio vsock. This method is desig

Re: [RFC PATCH 3/5] vsock/virtio: can_msgzerocopy adapts to multi-devices

2024-05-23 Thread Stefano Garzarella
On Fri, May 17, 2024 at 10:46:05PM GMT, Xuewei Niu wrote: Adds a new argument, named "cid", to let them know which `virtio_vsock` to be selected. Signed-off-by: Xuewei Niu --- include/linux/virtio_vsock.h| 2 +- net/vmw_vsock/virtio_transport.c| 5 ++--- net/vmw_vsock/virtio_t

Re: [RFC PATCH 4/5] vsock: seqpacket_allow adapts to multi-devices

2024-05-23 Thread Stefano Garzarella
On Fri, May 17, 2024 at 10:46:06PM GMT, Xuewei Niu wrote: Adds a new argument, named "src_cid", to let them know which `virtio_vsock` to be selected. Signed-off-by: Xuewei Niu --- include/net/af_vsock.h | 2 +- net/vmw_vsock/af_vsock.c | 15 +-- net/vmw_vsock/virtio

Re: [RFC PATCH 5/5] vsock: Add an ioctl request to get all CIDs

2024-05-23 Thread Stefano Garzarella
On Fri, May 17, 2024 at 10:46:07PM GMT, Xuewei Niu wrote: The new request is called `IOCTL_VM_SOCKETS_GET_LOCAL_CIDS`. And the old one, `IOCTL_VM_SOCKETS_GET_LOCAL_CID` is retained. For the transport that supports multi-devices: * `IOCTL_VM_SOCKETS_GET_LOCAL_CID` returns "-1"; What about retu

Re: [RFC PATCH 0/5] vsock/virtio: Add support for multi-devices

2024-05-23 Thread Stefano Garzarella
Hi, thanks for this RFC! On Fri, May 17, 2024 at 10:46:02PM GMT, Xuewei Niu wrote: # Motivition Vsock is a lightweight and widely used data exchange mechanism between host and guest. Kata Containers, a secure container runtime, leverages the capability to exchange control data between the shim

Re: [RFC PATCH v1 1/2] virtio/vsock: rework deferred credit update logic

2024-06-25 Thread Stefano Garzarella
On Fri, Jun 21, 2024 at 10:25:40PM GMT, Arseniy Krasnov wrote: Previous calculation of 'free_space' was wrong (but worked as expected in most cases, see below), because it didn't account number of bytes in rx queue. Let's rework 'free_space' calculation in the following way: as this value is cons

Re: [PATCH net-next v3 1/3] vsock: add support for SIOCOUTQ ioctl for all vsock socket types.

2024-06-28 Thread Stefano Garzarella
nit: in theory in this patch we don't support it for any of the transports, so I wouldn't confuse and take that part out of the title. WDYT with someting like: vsock: add support for SIOCOUTQ ioctl On Wed, Jun 26, 2024 at 02:08:35PM GMT, Luigi Leonardi via B4 Relay wrote: From: Luigi Leo

Re: [PATCH net-next v3 2/3] vsock/virtio: add SIOCOUTQ support for all virtio based transports

2024-06-28 Thread Stefano Garzarella
On Wed, Jun 26, 2024 at 02:08:36PM GMT, Luigi Leonardi via B4 Relay wrote: From: Luigi Leonardi Introduce support for stream_bytes_unsent and seqpacket_bytes_unsent ioctl for virtio_transport, vhost_vsock and vsock_loopback. For all transports the unsent bytes counter is incremented in virtio_

Re: [RFC PATCH v1 1/2] virtio/vsock: rework deferred credit update logic

2024-07-01 Thread Stefano Garzarella
Hi Arseniy, On Fri, Jun 21, 2024 at 10:25:40PM GMT, Arseniy Krasnov wrote: Previous calculation of 'free_space' was wrong (but worked as expected in most cases, see below), because it didn't account number of bytes in rx queue. Let's rework 'free_space' calculation in the following way: as this

Re: [PATCH PATCH net-next v2 1/2] vsock/virtio: refactor virtio_transport_send_pkt_work

2024-07-02 Thread Stefano Garzarella
On Mon, Jul 01, 2024 at 04:28:02PM GMT, Luigi Leonardi via B4 Relay wrote: From: Marco Pinna Preliminary patch to introduce an optimization to the enqueue system. All the code used to enqueue a packet into the virtqueue is removed from virtio_transport_send_pkt_work() and moved to the new virt

Re: [PATCH PATCH net-next v2 2/2] vsock/virtio: avoid enqueue packets when work queue is empty

2024-07-02 Thread Stefano Garzarella
On Mon, Jul 01, 2024 at 04:49:41PM GMT, Luigi Leonardi wrote: Hi all, + /* Inside RCU, can't sleep! */ + ret = mutex_trylock(&vsock->tx_lock); + if (unlikely(ret == 0)) + goto out_worker; I just realized that here I don't release

Re: [PATCH PATCH net-next v2 2/2] vsock/virtio: avoid enqueue packets when work queue is empty

2024-07-02 Thread Stefano Garzarella
On Mon, Jul 01, 2024 at 04:28:03PM GMT, Luigi Leonardi via B4 Relay wrote: From: Marco Pinna Introduce an optimization in virtio_transport_send_pkt: when the work queue (send_pkt_queue) is empty the packet is put directly in the virtqueue reducing latency. In the following benchmark (pingpong

[PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-05 Thread Stefano Garzarella
m-blk capacity=614400 $ vdpa dev add mgmtdev vdpasim_blk name blk0 virtio_blk virtio6: 1/0/0 default/read/poll queues virtio_blk virtio6: [vdb] 614400 512-byte logical blocks (315 MB/300 MiB) Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 25 +--

Re: [PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-05 Thread Stefano Garzarella
On Fri, Jul 05, 2024 at 07:30:51AM GMT, Michael S. Tsirkin wrote: On Fri, Jul 05, 2024 at 01:28:21PM +0200, Stefano Garzarella wrote: The vDPA block simulator always allocated a 128 MiB ram-disk, but some filesystems (e.g. XFS) may require larger minimum sizes (see https://issues.redhat.com

Re: [PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-08 Thread Stefano Garzarella
Hi Cindy, Jason, On Mon, Jul 08, 2024 at 03:59:34PM GMT, Jason Wang wrote: On Mon, Jul 8, 2024 at 3:06 PM Cindy Lu wrote: On Fri, 5 Jul 2024 at 20:42, Stefano Garzarella wrote: > > On Fri, Jul 05, 2024 at 07:30:51AM GMT, Michael S. Tsirkin wrote: > >On Fri, Jul 05, 2024 at 01:2

Re: [PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-09 Thread Stefano Garzarella
On Tue, Jul 09, 2024 at 10:56:16AM GMT, Jason Wang wrote: On Mon, Jul 8, 2024 at 4:15 PM Stefano Garzarella wrote: Hi Cindy, Jason, On Mon, Jul 08, 2024 at 03:59:34PM GMT, Jason Wang wrote: >On Mon, Jul 8, 2024 at 3:06 PM Cindy Lu wrote: >> >> On Fri, 5 Jul 2024 at 20:42, Ste

Re: [PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-10 Thread Stefano Garzarella
On Wed, Jul 10, 2024 at 11:08:48AM GMT, Jason Wang wrote: On Tue, Jul 9, 2024 at 8:41 PM Stefano Garzarella wrote: On Tue, Jul 09, 2024 at 10:56:16AM GMT, Jason Wang wrote: >On Mon, Jul 8, 2024 at 4:15 PM Stefano Garzarella wrote: >> >> Hi Cindy, Jason, >> >> On

Re: [PATCH] test/vsock: add install target

2024-07-10 Thread Stefano Garzarella
On Tue, Jul 09, 2024 at 09:50:51PM GMT, Peng Fan (OSS) wrote: From: Peng Fan Add install target for vsock to make Yocto easy to install the images. Signed-off-by: Peng Fan --- tools/testing/vsock/Makefile | 12 1 file changed, 12 insertions(+) diff --git a/tools/testing/vsock/Mak

Re: [PATCH] vdpa_sim_blk: add `capacity` module parameter

2024-07-10 Thread Stefano Garzarella
On Wed, Jul 10, 2024 at 03:28:31PM GMT, Jason Wang wrote: On Wed, Jul 10, 2024 at 3:19 PM Stefano Garzarella wrote: On Wed, Jul 10, 2024 at 11:08:48AM GMT, Jason Wang wrote: >On Tue, Jul 9, 2024 at 8:41 PM Stefano Garzarella wrote: >> >> On Tue, Jul 09, 2024 at 10:56:16AM

Re: [PATCH] test/vsock: add install target

2024-07-10 Thread Stefano Garzarella
On Wed, Jul 10, 2024 at 08:11:32AM GMT, Peng Fan wrote: Subject: Re: [PATCH] test/vsock: add install target On Tue, Jul 09, 2024 at 09:50:51PM GMT, Peng Fan (OSS) wrote: >From: Peng Fan > >Add install target for vsock to make Yocto easy to install the images. > >Signed-off-by: Peng Fan >--- >

Re: [PATCH] test/vsock: add install target

2024-07-10 Thread Stefano Garzarella
On Wed, Jul 10, 2024 at 11:34:05AM GMT, Peng Fan wrote: Subject: Re: [PATCH] test/vsock: add install target On Wed, Jul 10, 2024 at 08:11:32AM GMT, Peng Fan wrote: >> Subject: Re: [PATCH] test/vsock: add install target >> >> On Tue, Jul 09, 2024 at 09:50:51PM GMT, Peng Fan (OSS) wrote: >> >From:

Re: [PATCH V2] test/vsock: add install target

2024-07-10 Thread Stefano Garzarella
within a week, please resend specifying net-next. Reviewed-by: Stefano Garzarella V2: Use VSOCK_INSTALL_PATH, drop INSTALL_PATH tools/testing/vsock/Makefile | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testing/vsock/Makefile b/tools/testing/vsock/Makefile index

Re: [PATCH] test/vsock: add install target

2024-07-11 Thread Stefano Garzarella
CCing Stefan. On Wed, Jul 10, 2024 at 07:00:59PM GMT, Jakub Kicinski wrote: On Wed, 10 Jul 2024 13:58:39 +0200 Stefano Garzarella wrote: There is a comment there: # Avoid changing the rest of the logic here and lib.mk. Added by commit 17eac6c2db8b2cdfe33d40229bdda2acd86b304a. IIUC they

Re: [PATCH] test/vsock: add install target

2024-07-12 Thread Stefano Garzarella
On Thu, Jul 11, 2024 at 07:14:55AM GMT, Jakub Kicinski wrote: On Thu, 11 Jul 2024 15:38:01 +0200 Stefan Hajnoczi wrote: > Usually vsock tests test both the driver (virtio-vsock) in the guest and the > device in the host kernel (vhost-vsock). So I usually run the tests in 2 > nested VMs to test t

Re: [PATCH net-next v3 1/2] vsock/virtio: refactor virtio_transport_send_pkt_work

2024-07-12 Thread Stefano Garzarella
virtio_transport_send_skb() function. Co-developed-by: Luigi Leonardi Signed-off-by: Luigi Leonardi Signed-off-by: Marco Pinna --- net/vmw_vsock/virtio_transport.c | 105 ++- 1 file changed, 59 insertions(+), 46 deletions(-) LGTM Reviewed-by: Stefano Garzarella

Re: [PATCH net-next v3 2/2] vsock/virtio: avoid queuing packets when work queue is empty

2024-07-12 Thread Stefano Garzarella
On Thu, Jul 11, 2024 at 04:58:47PM GMT, Luigi Leonardi via B4 Relay wrote: From: Luigi Leonardi Introduce an optimization in virtio_transport_send_pkt: when the work queue (send_pkt_queue) is empty the packet is Note: send_pkt_queue is just a queue of sk_buff, is not really a work queue.

Re: [PATCH net-next v3 3/3] test/vsock: add ioctl unsent bytes test

2024-07-15 Thread Stefano Garzarella
On Wed, Jun 26, 2024 at 02:08:37PM GMT, Luigi Leonardi via B4 Relay wrote: From: Luigi Leonardi Introduce two tests, one for SOCK_STREAM and one for SOCK_SEQPACKET, which checks after a packet is delivered, that the number of unsent bytes is zero, using ioctl SIOCOUTQ. Signed-off-by: Luigi Le

Re: [PATCH v1] MAINTAINERS: add me as reviewer of AF_VSOCK and virtio-vsock

2024-07-29 Thread Stefano Garzarella
On Sun, Jul 28, 2024 at 09:33:25PM GMT, Arseniy Krasnov wrote: I'm working on AF_VSOCK and virtio-vsock. Yeah, thanks for the help! Signed-off-by: Arseniy Krasnov --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/MAINTAIN

Re: [PATCH net-next v4 1/3] vsock: add support for SIOCOUTQ ioctl

2024-07-31 Thread Stefano Garzarella
to them using a callback. Suggested-by: Daan De Meyer Signed-off-by: Luigi Leonardi --- include/net/af_vsock.h | 3 +++ net/vmw_vsock/af_vsock.c | 58 +--- 2 files changed, 58 insertions(+), 3 deletions(-) LGTM! Reviewed-by: Stefano Garzarella

Re: [PATCH net-next v4 2/3] vsock/virtio: add SIOCOUTQ support for all virtio based transports

2024-07-31 Thread Stefano Garzarella
changed, 53 insertions(+), 2 deletions(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bf664ec9341b..802153e23073 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -244,7 +244,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock

Re: [PATCH net-next v4 3/3] test/vsock: add ioctl unsent bytes test

2024-07-31 Thread Stefano Garzarella
/util.h | 3 ++ tools/testing/vsock/vsock_test.c | 85 3 files changed, 91 insertions(+), 3 deletions(-) LGTM and I ran them. All good :-) Reviewed-by: Stefano Garzarella diff --git a/tools/testing/vsock/util.c b/tools/testing/vsock/util.c index

Re: [PATCH net-next v4 2/2] vsock/virtio: avoid queuing packets when intermediate queue is empty

2024-07-31 Thread Stefano Garzarella
resolved. I let iperf run bidirectionally for a long time and saw no problems, so: Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index f641e906f351..f992f9a216f0 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock

Re: [PATCH net-next v4 0/2] vsock: avoid queuing on intermediate queue if possible

2024-08-05 Thread Stefano Garzarella
Hi Michael, this series is marked as "Not Applicable" for the net-next tree: https://patchwork.kernel.org/project/netdevbpf/patch/20240730-pinna-v4-2-5c9179164...@outlook.com/ Actually this is more about the virtio-vsock driver, so can you queue this on your tree? Thanks, Stefano On Tue, Jul

Re: BUG: stack guard page was hit in vsock_connectible_recvmsg

2024-08-05 Thread Stefano Garzarella
Hi, On Mon, Aug 05, 2024 at 08:44:11AM GMT, Ubisectech Sirius wrote: Hello. We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. Recently, our team has discovered a issue in Linux kernel 6.8. Attached to the email were a PoC file of the issue. Thanks for the report! It

Re: [PATCH net-next v4 0/2] vsock: avoid queuing on intermediate queue if possible

2024-08-06 Thread Stefano Garzarella
On Tue, Aug 06, 2024 at 09:02:57AM GMT, Jakub Kicinski wrote: On Mon, 5 Aug 2024 10:39:23 +0200 Stefano Garzarella wrote: this series is marked as "Not Applicable" for the net-next tree: https://patchwork.kernel.org/project/netdevbpf/patch/20240730-pinna-v4-2-5c9179164...@outlook.com/

Re: [PATCH net-next v4 0/2] vsock: avoid queuing on intermediate queue if possible

2024-08-29 Thread Stefano Garzarella
ts/get_maintainer.pl -f net/vmw_vsock/virtio_transport.c Stefan Hajnoczi (maintainer:VIRTIO AND VHOST VSOCK DRIVER) Stefano Garzarella (maintainer:VIRTIO AND VHOST VSOCK DRIVER) "David S. Miller" (maintainer:NETWORKING [GENERAL]) Eric Dumazet (maintainer:NETWORKING [GENERAL]) Jakub Ki

[PATCH] MAINTAINERS: add virtio-vsock driver in the VIRTIO CORE section

2024-08-29 Thread Stefano Garzarella
aintainers in CC for changes to the virtio-vsock driver. Cc: "Michael S. Tsirkin" Cc: Jason Wang Signed-off-by: Stefano Garzarella --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 878dcd23b331..6dcea63f396e 100644 --- a/MAINTAINE

Re: [PATCH for 5.10] vdpa_sim: fix param validation in vdpasim_get_config()

2021-02-15 Thread Stefano Garzarella
On Mon, Feb 15, 2021 at 03:32:19PM +0100, Greg KH wrote: On Thu, Feb 11, 2021 at 05:25:19PM +0100, Stefano Garzarella wrote: Commit 65b709586e222fa6ffd4166ac7fdb5d5dad113ee upstream. No, this really is not that commit, so please do not say it is. Oops, sorry. Before this patch, if

[RFC PATCH 01/10] vdpa: add get_config_size callback in vdpa_config_ops

2021-02-16 Thread Stefano Garzarella
This new callback is used to get the size of the configuration space of vDPA devices. Signed-off-by: Stefano Garzarella --- include/linux/vdpa.h | 4 drivers/vdpa/ifcvf/ifcvf_main.c | 6 ++ drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 ++ drivers/vdpa/vdpa_sim/vdpa_sim.c

[RFC PATCH 02/10] vdpa: check vdpa_get_config() parameters and return bytes read

2021-02-16 Thread Stefano Garzarella
We also move vdpa_get_config() implementation in drivers/vdpa/vdpa.c, since the function are growing. Signed-off-by: Stefano Garzarella --- include/linux/vdpa.h | 16 ++-- drivers/vdpa/vdpa.c | 35 +++ 2 files changed, 37 insertions(+), 14 deletions(-) dif

[RFC PATCH 00/10] vdpa: get/set_config() rework

2021-02-16 Thread Stefano Garzarella
uration space in the device, and we return the amount of bytes read/written. In this way the user space can pass buffers bigger than config space. I also returned the amount of bytes read and written to user space. Patches also available here: https://github.com/stefano-garzarella/linux/tree

[RFC PATCH 03/10] vdpa: add vdpa_set_config() helper

2021-02-16 Thread Stefano Garzarella
Let's add a function similar to vpda_get_config() to check the 'offset' and 'len' parameters, call the set_config() device callback, and return the amount of bytes written. Signed-off-by: Stefano Garzarella --- include/linux/vdpa.h | 2 ++ drivers/vdpa/vdpa.c | 16

[RFC PATCH 04/10] vdpa: remove param checks in the get/set_config callbacks

2021-02-16 Thread Stefano Garzarella
vdpa_get_config() and vdpa_set_config() now check parameters before calling callbacks, so we can remove these redundant checks. Signed-off-by: Stefano Garzarella --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +-- drivers/vdpa/vdpa_sim/vdpa_sim.c | 6 -- 2 files changed, 1 insertion(+), 8

[RFC PATCH 05/10] vdpa: remove WARN_ON() in the get/set_config callbacks

2021-02-16 Thread Stefano Garzarella
vdpa_get_config() and vdpa_set_config() now check parameters before calling callbacks, so we can remove these warnings. Signed-off-by: Stefano Garzarella --- Maybe we can skip this patch and leave the WARN_ONs in place. What do you recommend? --- drivers/vdpa/ifcvf/ifcvf_base.c | 3 +-- drivers

[RFC PATCH 06/10] virtio_vdpa: use vdpa_set_config()

2021-02-16 Thread Stefano Garzarella
Instead of calling the 'set_config' callback directly, we call the new vdpa_set_config() helper which also checks the parameters. Signed-off-by: Stefano Garzarella --- drivers/virtio/virtio_vdpa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/virtio/vir

[RFC PATCH 07/10] vhost/vdpa: use vdpa_set_config()

2021-02-16 Thread Stefano Garzarella
Instead of calling the 'set_config' callback directly, we call the new vdpa_set_config() helper which also checks the parameters. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/vhost/vdpa.c b/dri

[RFC PATCH 08/10] vhost/vdpa: allow user space to pass buffers bigger than config space

2021-02-16 Thread Stefano Garzarella
ounce buffer allocated with the device config size. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 36 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index cdd8f24168b2..544f8582a42b 1

[RFC PATCH 09/10] vhost/vdpa: use get_config_size callback in vhost_vdpa_config_validate()

2021-02-16 Thread Stefano Garzarella
Let's use the new 'get_config_size()' callback available instead of using the 'virtio_id' to get the size of the device config space. Signed-off-by: Stefano Garzarella --- drivers/vhost/vdpa.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git

[RFC PATCH 10/10] vhost/vdpa: return configuration bytes read and written to user space

2021-02-16 Thread Stefano Garzarella
vdpa_get_config() and vdpa_set_config() now return the amount of bytes read and written, so let's return them to the user space. We also modify vhost_vdpa_config_validate() to return 0 (bytes read or written) instead of an error, when the buffer length is 0. Signed-off-by: Stefano Garza

Re: [PATCH for 5.10] vdpa_sim: fix param validation in vdpasim_get_config()

2021-02-16 Thread Stefano Garzarella
On Mon, Feb 15, 2021 at 04:23:54PM +0100, Greg KH wrote: On Mon, Feb 15, 2021 at 04:03:21PM +0100, Stefano Garzarella wrote: On Mon, Feb 15, 2021 at 03:32:19PM +0100, Greg KH wrote: > On Thu, Feb 11, 2021 at 05:25:19PM +0100, Stefano Garzarella wrote: > &g

[PATCH for 5.10 v2 0/5] vdpa_sim: fix param validation in vdpasim_get_config()

2021-02-16 Thread Stefano Garzarella
pa_sim: make 'config' generic and usable for any device type' 005/5:[] [-C] 'vdpa_sim: add get_config callback in vdpasim_dev_attr' Thanks, Stefano Max Gurtovoy (1): vdpa_sim: remove hard-coded virtq count Stefano Garzarella (4): vdpa_sim: add struct vdpasim

[PATCH for 5.10 v2 1/5] vdpa_sim: remove hard-coded virtq count

2021-02-16 Thread Stefano Garzarella
: Stefano Garzarella Link: https://lore.kernel.org/r/20201215144256.155342-4-sgarz...@redhat.com Signed-off-by: Michael S. Tsirkin Cc: # 5.10.x Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_sim.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff

  1   2   3   4   5   6   7   8   9   >