[PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support

Arseniy Krasnov posted 12 patches 2 years, 3 months ago
There is a newer version of this series
Documentation/networking/msg_zerocopy.rst |  13 +-
drivers/vhost/vsock.c                     |   7 +
include/linux/socket.h                    |   1 +
include/net/af_vsock.h                    |   7 +
include/uapi/linux/vm_sockets.h           |   4 +
net/vmw_vsock/af_vsock.c                  |  63 ++++-
net/vmw_vsock/virtio_transport.c          |   7 +
net/vmw_vsock/vsock_loopback.c            |   6 +
tools/testing/vsock/Makefile              |   9 +-
tools/testing/vsock/util.c                | 214 +++++++++++++++
tools/testing/vsock/util.h                |  27 ++
tools/testing/vsock/vsock_perf.c          | 143 +++++++++-
tools/testing/vsock/vsock_test.c          |  16 ++
tools/testing/vsock/vsock_test_zerocopy.c | 314 +++++++++++++++++++++
tools/testing/vsock/vsock_test_zerocopy.h |  15 +
tools/testing/vsock/vsock_uring_test.c    | 321 ++++++++++++++++++++++
16 files changed, 1151 insertions(+), 16 deletions(-)
create mode 100644 tools/testing/vsock/vsock_test_zerocopy.c
create mode 100644 tools/testing/vsock/vsock_test_zerocopy.h
create mode 100644 tools/testing/vsock/vsock_uring_test.c
[PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support
Posted by Arseniy Krasnov 2 years, 3 months ago
Hello,

this patchset contains second and third parts of another big patchset
for MSG_ZEROCOPY flag support:
https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/

During review of this series, Stefano Garzarella <sgarzare@redhat.com>
suggested to split it for three parts to simplify review and merging:

1) virtio and vhost updates (for fragged skbs) (merged to net-next, see
   link below)
2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read
   tx completions) and update for Documentation/. <-- this patchset
3) Updates for tests and utils. <-- this patchset

Part 1) was merged:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=71b263e79370348349553ecdf46f4a69eb436dc7

Head for this patchset is:
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=236f3873b517acfaf949c23bb2d5dec13bfd2da2

Link to v1:
https://lore.kernel.org/netdev/20230922052428.4005676-1-avkrasnov@salutedevices.com/

Changelog:                                                              
 v1 -> v2:                                                              
 * Patchset rebased and tested on new HEAD of net-next (see hash above).
 * See per-patch changelog after ---. 

Arseniy Krasnov (12):
  vsock: set EPOLLERR on non-empty error queue
  vsock: read from socket's error queue
  vsock: check for MSG_ZEROCOPY support on send
  vsock: enable SOCK_SUPPORT_ZC bit
  vhost/vsock: support MSG_ZEROCOPY for transport
  vsock/virtio: support MSG_ZEROCOPY for transport
  vsock/loopback: support MSG_ZEROCOPY for transport
  vsock: enable setting SO_ZEROCOPY
  docs: net: description of MSG_ZEROCOPY for AF_VSOCK
  test/vsock: MSG_ZEROCOPY flag tests
  test/vsock: MSG_ZEROCOPY support for vsock_perf
  test/vsock: io_uring rx/tx tests

 Documentation/networking/msg_zerocopy.rst |  13 +-
 drivers/vhost/vsock.c                     |   7 +
 include/linux/socket.h                    |   1 +
 include/net/af_vsock.h                    |   7 +
 include/uapi/linux/vm_sockets.h           |   4 +
 net/vmw_vsock/af_vsock.c                  |  63 ++++-
 net/vmw_vsock/virtio_transport.c          |   7 +
 net/vmw_vsock/vsock_loopback.c            |   6 +
 tools/testing/vsock/Makefile              |   9 +-
 tools/testing/vsock/util.c                | 214 +++++++++++++++
 tools/testing/vsock/util.h                |  27 ++
 tools/testing/vsock/vsock_perf.c          | 143 +++++++++-
 tools/testing/vsock/vsock_test.c          |  16 ++
 tools/testing/vsock/vsock_test_zerocopy.c | 314 +++++++++++++++++++++
 tools/testing/vsock/vsock_test_zerocopy.h |  15 +
 tools/testing/vsock/vsock_uring_test.c    | 321 ++++++++++++++++++++++
 16 files changed, 1151 insertions(+), 16 deletions(-)
 create mode 100644 tools/testing/vsock/vsock_test_zerocopy.c
 create mode 100644 tools/testing/vsock/vsock_test_zerocopy.h
 create mode 100644 tools/testing/vsock/vsock_uring_test.c

-- 
2.25.1
Re: [PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support
Posted by Stefano Garzarella 2 years, 3 months ago
Hi Arseniy,

On Sun, Oct 01, 2023 at 12:02:56AM +0300, Arseniy Krasnov wrote:
>Hello,
>
>this patchset contains second and third parts of another big patchset
>for MSG_ZEROCOPY flag support:
>https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/
>
>During review of this series, Stefano Garzarella <sgarzare@redhat.com>
>suggested to split it for three parts to simplify review and merging:
>
>1) virtio and vhost updates (for fragged skbs) (merged to net-next, see
>   link below)
>2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read
>   tx completions) and update for Documentation/. <-- this patchset
>3) Updates for tests and utils. <-- this patchset
>
>Part 1) was merged:
>https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=71b263e79370348349553ecdf46f4a69eb436dc7
>
>Head for this patchset is:
>https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=236f3873b517acfaf949c23bb2d5dec13bfd2da2
>
>Link to v1:
>https://lore.kernel.org/netdev/20230922052428.4005676-1-avkrasnov@salutedevices.com/
>
>Changelog:
> v1 -> v2:
> * Patchset rebased and tested on new HEAD of net-next (see hash above).
> * See per-patch changelog after ---.

Thanks for this new version.
I started to include vsock_uring_test in my test suite and tests are
going well.

I reviewed code patches, I still need to review the tests.
I'll do that by the end of the week, but they looks good!

Thanks,
Stefano
Re: [PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support
Posted by Arseniy Krasnov 2 years, 3 months ago

On 03.10.2023 19:26, Stefano Garzarella wrote:
> Hi Arseniy,
> 
> On Sun, Oct 01, 2023 at 12:02:56AM +0300, Arseniy Krasnov wrote:
>> Hello,
>>
>> this patchset contains second and third parts of another big patchset
>> for MSG_ZEROCOPY flag support:
>> https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/
>>
>> During review of this series, Stefano Garzarella <sgarzare@redhat.com>
>> suggested to split it for three parts to simplify review and merging:
>>
>> 1) virtio and vhost updates (for fragged skbs) (merged to net-next, see
>>   link below)
>> 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read
>>   tx completions) and update for Documentation/. <-- this patchset
>> 3) Updates for tests and utils. <-- this patchset
>>
>> Part 1) was merged:
>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=71b263e79370348349553ecdf46f4a69eb436dc7
>>
>> Head for this patchset is:
>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=236f3873b517acfaf949c23bb2d5dec13bfd2da2
>>
>> Link to v1:
>> https://lore.kernel.org/netdev/20230922052428.4005676-1-avkrasnov@salutedevices.com/
>>
>> Changelog:
>> v1 -> v2:
>> * Patchset rebased and tested on new HEAD of net-next (see hash above).
>> * See per-patch changelog after ---.
> 
> Thanks for this new version.
> I started to include vsock_uring_test in my test suite and tests are
> going well.
> 
> I reviewed code patches, I still need to review the tests.
> I'll do that by the end of the week, but they looks good!

Thanks for review! Ok, I'll wait for tests review, and then send next
version.

Thanks, Arseniy

> 
> Thanks,
> Stefano
> 
Re: [PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support
Posted by Arseniy Krasnov 2 years, 3 months ago

On 04.10.2023 08:25, Arseniy Krasnov wrote:
> 
> 
> On 03.10.2023 19:26, Stefano Garzarella wrote:
>> Hi Arseniy,
>>
>> On Sun, Oct 01, 2023 at 12:02:56AM +0300, Arseniy Krasnov wrote:
>>> Hello,
>>>
>>> this patchset contains second and third parts of another big patchset
>>> for MSG_ZEROCOPY flag support:
>>> https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/
>>>
>>> During review of this series, Stefano Garzarella <sgarzare@redhat.com>
>>> suggested to split it for three parts to simplify review and merging:
>>>
>>> 1) virtio and vhost updates (for fragged skbs) (merged to net-next, see
>>>   link below)
>>> 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read
>>>   tx completions) and update for Documentation/. <-- this patchset
>>> 3) Updates for tests and utils. <-- this patchset
>>>
>>> Part 1) was merged:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=71b263e79370348349553ecdf46f4a69eb436dc7
>>>
>>> Head for this patchset is:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=236f3873b517acfaf949c23bb2d5dec13bfd2da2
>>>
>>> Link to v1:
>>> https://lore.kernel.org/netdev/20230922052428.4005676-1-avkrasnov@salutedevices.com/
>>>
>>> Changelog:
>>> v1 -> v2:
>>> * Patchset rebased and tested on new HEAD of net-next (see hash above).
>>> * See per-patch changelog after ---.
>>
>> Thanks for this new version.
>> I started to include vsock_uring_test in my test suite and tests are
>> going well.
>>
>> I reviewed code patches, I still need to review the tests.
>> I'll do that by the end of the week, but they looks good!
> 
> Thanks for review! Ok, I'll wait for tests review, and then send next
> version.

Got your comments from review. I'll update patches by:
1) Trying to avoid touching util.c/util.h
2) Add new header with functions shared between util vsock_perf and tests

Thanks, Arseniy

> 
> Thanks, Arseniy
> 
>>
>> Thanks,
>> Stefano
>>
Re: [PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support
Posted by Stefano Garzarella 2 years, 3 months ago
On Wed, Oct 04, 2023 at 07:22:04PM +0300, Arseniy Krasnov wrote:
>
>
>On 04.10.2023 08:25, Arseniy Krasnov wrote:
>>
>>
>> On 03.10.2023 19:26, Stefano Garzarella wrote:
>>> Hi Arseniy,
>>>
>>> On Sun, Oct 01, 2023 at 12:02:56AM +0300, Arseniy Krasnov wrote:
>>>> Hello,
>>>>
>>>> this patchset contains second and third parts of another big patchset
>>>> for MSG_ZEROCOPY flag support:
>>>> https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/
>>>>
>>>> During review of this series, Stefano Garzarella <sgarzare@redhat.com>
>>>> suggested to split it for three parts to simplify review and merging:
>>>>
>>>> 1) virtio and vhost updates (for fragged skbs) (merged to net-next, see
>>>>   link below)
>>>> 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read
>>>>   tx completions) and update for Documentation/. <-- this patchset
>>>> 3) Updates for tests and utils. <-- this patchset
>>>>
>>>> Part 1) was merged:
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=71b263e79370348349553ecdf46f4a69eb436dc7
>>>>
>>>> Head for this patchset is:
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=236f3873b517acfaf949c23bb2d5dec13bfd2da2
>>>>
>>>> Link to v1:
>>>> https://lore.kernel.org/netdev/20230922052428.4005676-1-avkrasnov@salutedevices.com/
>>>>
>>>> Changelog:
>>>> v1 -> v2:
>>>> * Patchset rebased and tested on new HEAD of net-next (see hash above).
>>>> * See per-patch changelog after ---.
>>>
>>> Thanks for this new version.
>>> I started to include vsock_uring_test in my test suite and tests are
>>> going well.
>>>
>>> I reviewed code patches, I still need to review the tests.
>>> I'll do that by the end of the week, but they looks good!
>>
>> Thanks for review! Ok, I'll wait for tests review, and then send next
>> version.
>
>Got your comments from review. I'll update patches by:
>1) Trying to avoid touching util.c/util.h

I mean, we can touch it ;-) but for this case it looks like we don't
need most of that functions to be there.

At least for now. If we need them to be used in more places, then it
makes sense.

>2) Add new header with functions shared between util vsock_perf and
>tests

We can do this also later in another PR as cleanup if you prefer.

Thanks,
Stefano
Re: [PATCH net-next v2 00/12] vsock/virtio: continue MSG_ZEROCOPY support
Posted by Arseniy Krasnov 2 years, 3 months ago

On 04.10.2023 19:42, Stefano Garzarella wrote:
> On Wed, Oct 04, 2023 at 07:22:04PM +0300, Arseniy Krasnov wrote:
>>
>>
>> On 04.10.2023 08:25, Arseniy Krasnov wrote:
>>>
>>>
>>> On 03.10.2023 19:26, Stefano Garzarella wrote:
>>>> Hi Arseniy,
>>>>
>>>> On Sun, Oct 01, 2023 at 12:02:56AM +0300, Arseniy Krasnov wrote:
>>>>> Hello,
>>>>>
>>>>> this patchset contains second and third parts of another big patchset
>>>>> for MSG_ZEROCOPY flag support:
>>>>> https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/
>>>>>
>>>>> During review of this series, Stefano Garzarella <sgarzare@redhat.com>
>>>>> suggested to split it for three parts to simplify review and merging:
>>>>>
>>>>> 1) virtio and vhost updates (for fragged skbs) (merged to net-next, see
>>>>>   link below)
>>>>> 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read
>>>>>   tx completions) and update for Documentation/. <-- this patchset
>>>>> 3) Updates for tests and utils. <-- this patchset
>>>>>
>>>>> Part 1) was merged:
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=71b263e79370348349553ecdf46f4a69eb436dc7
>>>>>
>>>>> Head for this patchset is:
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=236f3873b517acfaf949c23bb2d5dec13bfd2da2
>>>>>
>>>>> Link to v1:
>>>>> https://lore.kernel.org/netdev/20230922052428.4005676-1-avkrasnov@salutedevices.com/
>>>>>
>>>>> Changelog:
>>>>> v1 -> v2:
>>>>> * Patchset rebased and tested on new HEAD of net-next (see hash above).
>>>>> * See per-patch changelog after ---.
>>>>
>>>> Thanks for this new version.
>>>> I started to include vsock_uring_test in my test suite and tests are
>>>> going well.
>>>>
>>>> I reviewed code patches, I still need to review the tests.
>>>> I'll do that by the end of the week, but they looks good!
>>>
>>> Thanks for review! Ok, I'll wait for tests review, and then send next
>>> version.
>>
>> Got your comments from review. I'll update patches by:
>> 1) Trying to avoid touching util.c/util.h
> 
> I mean, we can touch it ;-) but for this case it looks like we don't
> need most of that functions to be there.
> 
> At least for now. If we need them to be used in more places, then it
> makes sense.

Yes, I mean touching without need :)

> 
>> 2) Add new header with functions shared between util vsock_perf and
>> tests
> 
> We can do this also later in another PR as cleanup if you prefer.
> 
> Thanks,
> Stefano
>