netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Krasnov Arseniy <AVKrasnov@sberdevices.ru>
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Krasnov Arseniy <oxffffaa@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	kernel <kernel@sberdevices.ru>
Subject: Re: [RFC PATCH v1 12/12] test/vsock: MSG_ZEROCOPY support for vsock_perf
Date: Tue, 28 Feb 2023 11:32:05 +0100	[thread overview]
Message-ID: <20230228103205.6vorc4z363wtxwlk@sgarzare-redhat> (raw)
In-Reply-To: <d5de8b79-f903-d65f-a5bc-e591578144e7@sberdevices.ru>

On Mon, Feb 20, 2023 at 09:05:12AM +0000, Krasnov Arseniy wrote:
>On 16.02.2023 18:29, Stefano Garzarella wrote:
>> On Mon, Feb 06, 2023 at 07:06:32AM +0000, Arseniy Krasnov wrote:
>>> To use this option pass '--zc' parameter:
>>
>> --zerocopy or --zero-copy maybe better follow what we did with the other parameters :-)
>>
>>>
>>> ./vsock_perf --zc --sender <cid> --port <port> --bytes <bytes to send>
>>>
>>> With this option MSG_ZEROCOPY flag will be passed to the 'send()' call.
>>>
>>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
>>> ---
>>> tools/testing/vsock/vsock_perf.c | 127 +++++++++++++++++++++++++++++--
>>> 1 file changed, 120 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/tools/testing/vsock/vsock_perf.c b/tools/testing/vsock/vsock_perf.c
>>> index a72520338f84..1d435be9b48e 100644
>>> --- a/tools/testing/vsock/vsock_perf.c
>>> +++ b/tools/testing/vsock/vsock_perf.c
>>> @@ -18,6 +18,8 @@
>>> #include <poll.h>
>>> #include <sys/socket.h>
>>> #include <linux/vm_sockets.h>
>>> +#include <sys/mman.h>
>>> +#include <linux/errqueue.h>
>>>
>>> #define DEFAULT_BUF_SIZE_BYTES    (128 * 1024)
>>> #define DEFAULT_TO_SEND_BYTES    (64 * 1024)
>>> @@ -28,9 +30,14 @@
>>> #define BYTES_PER_GB        (1024 * 1024 * 1024ULL)
>>> #define NSEC_PER_SEC        (1000000000ULL)
>>>
>>> +#ifndef SOL_VSOCK
>>> +#define SOL_VSOCK 287
>>> +#endif
>>
>> I thought we use the current kernel headers when we compile the tests,
>> do we need to fix something in the makefile?
>Not sure, of course we are using uapi. But i see, that defines like SOL_XXX is not
>defined in uapi headers. For example SOL_IP is defined in include/linux/socket.h,
>but userspace app uses SOL_IP from in.h (at least on my machine). E.g. SOL_XXX is
>not exported to user.

Right, I see only few SOL_* in the uapi, e.g. SOL_TIPC in 
uapi/linux/tipc.h

So it's fine for now, otherwise we can define it in 
uapi/linux/vm_sockets.h

Thanks,
Stefano


  reply	other threads:[~2023-02-28 10:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  6:51 [RFC PATCH v1 00/12] vsock: MSG_ZEROCOPY flag support Arseniy Krasnov
2023-02-06  6:53 ` [RFC PATCH v1 01/12] vsock: check error queue to set EPOLLERR Arseniy Krasnov
2023-02-16 13:40   ` Stefano Garzarella
2023-02-20  9:00     ` Krasnov Arseniy
2023-02-06  6:54 ` [RFC PATCH v1 02/12] vsock: read from socket's error queue Arseniy Krasnov
2023-02-16 13:55   ` Stefano Garzarella
2023-02-06  6:55 ` [RFC PATCH v1 03/12] vsock: check for MSG_ZEROCOPY support Arseniy Krasnov
2023-02-16 14:02   ` Stefano Garzarella
2023-02-06  6:57 ` [RFC PATCH v1 04/12] vhost/vsock: non-linear skb handling support Arseniy Krasnov
2023-02-16 14:09   ` Stefano Garzarella
2023-02-20  9:01     ` Krasnov Arseniy
2023-02-06  6:58 ` [RFC PATCH v1 05/12] vsock/virtio: non-linear skb support Arseniy Krasnov
2023-02-16 14:18   ` Stefano Garzarella
2023-02-20  9:02     ` Krasnov Arseniy
2023-02-06  6:59 ` [RFC PATCH v1 06/12] vsock/virtio: non-linear skb handling for TAP dev Arseniy Krasnov
2023-02-16 14:30   ` Stefano Garzarella
2023-02-06  7:00 ` [RFC PATCH v1 07/12] vsock/virtio: MGS_ZEROCOPY flag support Arseniy Krasnov
2023-02-16 15:16   ` Stefano Garzarella
2023-02-20  9:04     ` Krasnov Arseniy
2023-02-28 10:26       ` Stefano Garzarella
2023-02-06  7:01 ` [RFC PATCH v1 08/12] vhost/vsock: support MSG_ZEROCOPY for transport Arseniy Krasnov
2023-02-06  7:02 ` [RFC PATCH v1 09/12] vsock/virtio: " Arseniy Krasnov
2023-02-06  7:03 ` [RFC PATCH v1 10/12] net/sock: enable setting SO_ZEROCOPY for PF_VSOCK Arseniy Krasnov
2023-02-06  7:05 ` [RFC PATCH v1 11/12] test/vsock: MSG_ZEROCOPY flag tests Arseniy Krasnov
2023-02-06  7:06 ` [RFC PATCH v1 12/12] test/vsock: MSG_ZEROCOPY support for vsock_perf Arseniy Krasnov
2023-02-16 15:29   ` Stefano Garzarella
2023-02-20  9:05     ` Krasnov Arseniy
2023-02-28 10:32       ` Stefano Garzarella [this message]
2023-02-16 13:33 ` [RFC PATCH v1 00/12] vsock: MSG_ZEROCOPY flag support Stefano Garzarella
2023-02-20  8:59   ` Krasnov Arseniy
2023-02-28 10:23     ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230228103205.6vorc4z363wtxwlk@sgarzare-redhat \
    --to=sgarzare@redhat.com \
    --cc=AVKrasnov@sberdevices.ru \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jasowang@redhat.com \
    --cc=kernel@sberdevices.ru \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=oxffffaa@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).