* Re: [PATCH net-next v5 3/6] vhost/vsock: support MSG_EOR bit processing
[not found] ` <20210903123238.3273526-1-arseny.krasnov@kaspersky.com>
@ 2021-09-03 12:51 ` Stefano Garzarella
0 siblings, 0 replies; 6+ messages in thread
From: Stefano Garzarella @ 2021-09-03 12:51 UTC (permalink / raw)
To: Arseny Krasnov
Cc: Andra Paraschiv, kvm, Michael S. Tsirkin, netdev, stsp2,
linux-kernel, virtualization, oxffffaa, Norbert Slusarek,
Stefan Hajnoczi, Jakub Kicinski, Colin Ian King, David S. Miller
On Fri, Sep 03, 2021 at 03:32:35PM +0300, Arseny Krasnov wrote:
>'MSG_EOR' handling has similar logic as 'MSG_EOM' - if bit present
>in packet's header, reset it to 0. Then restore it back if packet
>processing wasn't completed. Instead of bool variable for each
>flag, bit mask variable was added: it has logical OR of 'MSG_EOR'
>and 'MSG_EOM' if needed, to restore flags, this variable is ORed
>with flags field of packet.
>
>Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
>---
> drivers/vhost/vsock.c | 22 +++++++++++++---------
> 1 file changed, 13 insertions(+), 9 deletions(-)
>
>diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
>index feaf650affbe..938aefbc75ec 100644
>--- a/drivers/vhost/vsock.c
>+++ b/drivers/vhost/vsock.c
>@@ -114,7 +114,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> size_t nbytes;
> size_t iov_len, payload_len;
> int head;
>- bool restore_flag = false;
>+ u32 flags_to_restore = 0;
>
> spin_lock_bh(&vsock->send_pkt_list_lock);
> if (list_empty(&vsock->send_pkt_list)) {
>@@ -179,15 +179,20 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> * created dynamically and are initialized with header
> * of current packet(except length). But in case of
> * SOCK_SEQPACKET, we also must clear message delimeter
>- * bit(VIRTIO_VSOCK_SEQ_EOM). Otherwise, instead of one
>- * packet with delimeter(which marks end of message),
>- * there will be sequence of packets with delimeter
>- * bit set. After initialized header will be copied to
>- * rx buffer, this bit will be restored.
>+ * bit (VIRTIO_VSOCK_SEQ_EOM) and MSG_EOR bit
>+ * (VIRTIO_VSOCK_SEQ_EOR) if set. Otherwise,
>+ * there will be sequence of packets with these
>+ * bits set. After initialized header will be copied to
>+ * rx buffer, these required bits will be restored.
> */
> if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOM) {
> pkt->hdr.flags &= ~cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM);
>- restore_flag = true;
>+ flags_to_restore |= VIRTIO_VSOCK_SEQ_EOM;
>+
>+ if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOR) {
>+ pkt->hdr.flags &= ~cpu_to_le32(VIRTIO_VSOCK_SEQ_EOR);
>+ flags_to_restore |= VIRTIO_VSOCK_SEQ_EOR;
>+ }
> }
> }
>
>@@ -224,8 +229,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
> * to send it with the next available buffer.
> */
> if (pkt->off < pkt->len) {
>- if (restore_flag)
>- pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM);
>+ pkt->hdr.flags |= cpu_to_le32(flags_to_restore);
>
> /* We are queueing the same virtio_vsock_pkt to
> handle
> * the remaining bytes, and we want to deliver it
>--
>2.25.1
>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v5 0/6] virtio/vsock: introduce MSG_EOR flag for SEQPACKET
[not found] <20210903123016.3272800-1-arseny.krasnov@kaspersky.com>
[not found] ` <20210903123238.3273526-1-arseny.krasnov@kaspersky.com>
@ 2021-09-05 15:55 ` Michael S. Tsirkin
[not found] ` <4558e96b-6330-667f-955b-b689986f884f@kaspersky.com>
1 sibling, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2021-09-05 15:55 UTC (permalink / raw)
To: Arseny Krasnov
Cc: Andra Paraschiv, kvm, netdev, stsp2, linux-kernel, virtualization,
oxffffaa, Norbert Slusarek, Stefan Hajnoczi, Jakub Kicinski,
Colin Ian King, David S. Miller
On Fri, Sep 03, 2021 at 03:30:13PM +0300, Arseny Krasnov wrote:
> This patchset implements support of MSG_EOR bit for SEQPACKET
> AF_VSOCK sockets over virtio transport.
> First we need to define 'messages' and 'records' like this:
> Message is result of sending calls: 'write()', 'send()', 'sendmsg()'
> etc. It has fixed maximum length, and it bounds are visible using
> return from receive calls: 'read()', 'recv()', 'recvmsg()' etc.
> Current implementation based on message definition above.
> Record has unlimited length, it consists of multiple message,
> and bounds of record are visible via MSG_EOR flag returned from
> 'recvmsg()' call. Sender passes MSG_EOR to sending system call and
> receiver will see MSG_EOR when corresponding message will be processed.
> Idea of patchset comes from POSIX: it says that SEQPACKET
> supports record boundaries which are visible for receiver using
> MSG_EOR bit. So, it looks like MSG_EOR is enough thing for SEQPACKET
> and we don't need to maintain boundaries of corresponding send -
> receive system calls. But, for 'sendXXX()' and 'recXXX()' POSIX says,
> that all these calls operates with messages, e.g. 'sendXXX()' sends
> message, while 'recXXX()' reads messages and for SEQPACKET, 'recXXX()'
> must read one entire message from socket, dropping all out of size
> bytes. Thus, both message boundaries and MSG_EOR bit must be supported
> to follow POSIX rules.
> To support MSG_EOR new bit was added along with existing
> 'VIRTIO_VSOCK_SEQ_EOR': 'VIRTIO_VSOCK_SEQ_EOM'(end-of-message) - now it
> works in the same way as 'VIRTIO_VSOCK_SEQ_EOR'. But 'VIRTIO_VSOCK_SEQ_EOR'
> is used to mark 'MSG_EOR' bit passed from userspace.
> This patchset includes simple test for MSG_EOR.
I'm prepared to merge this for this window,
but I'm not sure who's supposed to ack the net/vmw_vsock/af_vsock.c
bits. It's a harmless variable renaming so maybe it does not matter.
The rest is virtio stuff so I guess my tree is ok.
Objections, anyone?
> Arseny Krasnov(6):
> virtio/vsock: rename 'EOR' to 'EOM' bit.
> virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOR' bit.
> vhost/vsock: support MSG_EOR bit processing
> virtio/vsock: support MSG_EOR bit processing
> af_vsock: rename variables in receive loop
> vsock_test: update message bounds test for MSG_EOR
>
> drivers/vhost/vsock.c | 28 +++++++++++++----------
> include/uapi/linux/virtio_vsock.h | 3 ++-
> net/vmw_vsock/af_vsock.c | 10 ++++----
> net/vmw_vsock/virtio_transport_common.c | 23 ++++++++++++-------
> tools/testing/vsock/vsock_test.c | 8 ++++++-
> 5 files changed, 45 insertions(+), 27 deletions(-)
>
> v4 -> v5:
> - Move bitwise and out of le32_to_cpu() in 0003.
>
> v3 -> v4:
> - 'sendXXX()' renamed to 'send*()' in 0002- commit msg.
> - Comment about bit restore updated in 0003-.
> - 'same' renamed to 'similar' in 0003- commit msg.
> - u32 used instead of uint32_t in 0003-.
>
> v2 -> v3:
> - 'virtio/vsock: rename 'EOR' to 'EOM' bit.' - commit message updated.
> - 'VIRTIO_VSOCK_SEQ_EOR' bit add moved to separate patch.
> - 'vhost/vsock: support MSG_EOR bit processing' - commit message
> updated.
> - 'vhost/vsock: support MSG_EOR bit processing' - removed unneeded
> 'le32_to_cpu()', because input argument was already in CPU
> endianness.
>
> v1 -> v2:
> - 'VIRTIO_VSOCK_SEQ_EOR' is renamed to 'VIRTIO_VSOCK_SEQ_EOM', to
> support backward compatibility.
> - use bitmask of flags to restore in vhost.c, instead of separated
> bool variable for each flag.
> - test for EAGAIN removed, as logically it is not part of this
> patchset(will be sent separately).
> - cover letter updated(added part with POSIX description).
>
> Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
> --
> 2.25.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v5 0/6] virtio/vsock: introduce MSG_EOR flag for SEQPACKET
[not found] ` <4558e96b-6330-667f-955b-b689986f884f@kaspersky.com>
@ 2021-09-05 16:19 ` Michael S. Tsirkin
[not found] ` <5b20410a-fb8f-2e38-59d9-74dc6b8a9d4f@kaspersky.com>
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2021-09-05 16:19 UTC (permalink / raw)
To: Arseny Krasnov
Cc: Andra Paraschiv, kvm@vger.kernel.org, netdev@vger.kernel.org,
stsp2@yandex.ru, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, oxffffaa@gmail.com,
Norbert Slusarek, Stefan Hajnoczi, Jakub Kicinski, Colin Ian King,
David S. Miller
On Sun, Sep 05, 2021 at 07:02:44PM +0300, Arseny Krasnov wrote:
>
> On 05.09.2021 18:55, Michael S. Tsirkin wrote:
> > On Fri, Sep 03, 2021 at 03:30:13PM +0300, Arseny Krasnov wrote:
> >> This patchset implements support of MSG_EOR bit for SEQPACKET
> >> AF_VSOCK sockets over virtio transport.
> >> First we need to define 'messages' and 'records' like this:
> >> Message is result of sending calls: 'write()', 'send()', 'sendmsg()'
> >> etc. It has fixed maximum length, and it bounds are visible using
> >> return from receive calls: 'read()', 'recv()', 'recvmsg()' etc.
> >> Current implementation based on message definition above.
> >> Record has unlimited length, it consists of multiple message,
> >> and bounds of record are visible via MSG_EOR flag returned from
> >> 'recvmsg()' call. Sender passes MSG_EOR to sending system call and
> >> receiver will see MSG_EOR when corresponding message will be processed.
> >> Idea of patchset comes from POSIX: it says that SEQPACKET
> >> supports record boundaries which are visible for receiver using
> >> MSG_EOR bit. So, it looks like MSG_EOR is enough thing for SEQPACKET
> >> and we don't need to maintain boundaries of corresponding send -
> >> receive system calls. But, for 'sendXXX()' and 'recXXX()' POSIX says,
> >> that all these calls operates with messages, e.g. 'sendXXX()' sends
> >> message, while 'recXXX()' reads messages and for SEQPACKET, 'recXXX()'
> >> must read one entire message from socket, dropping all out of size
> >> bytes. Thus, both message boundaries and MSG_EOR bit must be supported
> >> to follow POSIX rules.
> >> To support MSG_EOR new bit was added along with existing
> >> 'VIRTIO_VSOCK_SEQ_EOR': 'VIRTIO_VSOCK_SEQ_EOM'(end-of-message) - now it
> >> works in the same way as 'VIRTIO_VSOCK_SEQ_EOR'. But 'VIRTIO_VSOCK_SEQ_EOR'
> >> is used to mark 'MSG_EOR' bit passed from userspace.
> >> This patchset includes simple test for MSG_EOR.
> >
> > I'm prepared to merge this for this window,
> > but I'm not sure who's supposed to ack the net/vmw_vsock/af_vsock.c
> > bits. It's a harmless variable renaming so maybe it does not matter.
> >
> > The rest is virtio stuff so I guess my tree is ok.
> >
> > Objections, anyone?
>
> https://lkml.org/lkml/2021/9/3/76 this is v4. It is same as v5 in af_vsock.c changes.
>
> It has Reviewed by from Stefano Garzarella.
Is Stefano the maintainer for af_vsock then?
I wasn't sure.
> >
> >
> >> Arseny Krasnov(6):
> >> virtio/vsock: rename 'EOR' to 'EOM' bit.
> >> virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOR' bit.
> >> vhost/vsock: support MSG_EOR bit processing
> >> virtio/vsock: support MSG_EOR bit processing
> >> af_vsock: rename variables in receive loop
> >> vsock_test: update message bounds test for MSG_EOR
> >>
> >> drivers/vhost/vsock.c | 28 +++++++++++++----------
> >> include/uapi/linux/virtio_vsock.h | 3 ++-
> >> net/vmw_vsock/af_vsock.c | 10 ++++----
> >> net/vmw_vsock/virtio_transport_common.c | 23 ++++++++++++-------
> >> tools/testing/vsock/vsock_test.c | 8 ++++++-
> >> 5 files changed, 45 insertions(+), 27 deletions(-)
> >>
> >> v4 -> v5:
> >> - Move bitwise and out of le32_to_cpu() in 0003.
> >>
> >> v3 -> v4:
> >> - 'sendXXX()' renamed to 'send*()' in 0002- commit msg.
> >> - Comment about bit restore updated in 0003-.
> >> - 'same' renamed to 'similar' in 0003- commit msg.
> >> - u32 used instead of uint32_t in 0003-.
> >>
> >> v2 -> v3:
> >> - 'virtio/vsock: rename 'EOR' to 'EOM' bit.' - commit message updated.
> >> - 'VIRTIO_VSOCK_SEQ_EOR' bit add moved to separate patch.
> >> - 'vhost/vsock: support MSG_EOR bit processing' - commit message
> >> updated.
> >> - 'vhost/vsock: support MSG_EOR bit processing' - removed unneeded
> >> 'le32_to_cpu()', because input argument was already in CPU
> >> endianness.
> >>
> >> v1 -> v2:
> >> - 'VIRTIO_VSOCK_SEQ_EOR' is renamed to 'VIRTIO_VSOCK_SEQ_EOM', to
> >> support backward compatibility.
> >> - use bitmask of flags to restore in vhost.c, instead of separated
> >> bool variable for each flag.
> >> - test for EAGAIN removed, as logically it is not part of this
> >> patchset(will be sent separately).
> >> - cover letter updated(added part with POSIX description).
> >>
> >> Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
> >> --
> >> 2.25.1
> >
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v5 0/6] virtio/vsock: introduce MSG_EOR flag for SEQPACKET
[not found] ` <5b20410a-fb8f-2e38-59d9-74dc6b8a9d4f@kaspersky.com>
@ 2021-09-05 20:18 ` Michael S. Tsirkin
2021-09-06 7:33 ` Stefano Garzarella
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2021-09-05 20:18 UTC (permalink / raw)
To: Arseny Krasnov
Cc: Andra Paraschiv, kvm@vger.kernel.org, netdev@vger.kernel.org,
stsp2@yandex.ru, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, oxffffaa@gmail.com,
Norbert Slusarek, Stefan Hajnoczi, Jakub Kicinski, Colin Ian King,
David S. Miller
On Sun, Sep 05, 2021 at 07:21:10PM +0300, Arseny Krasnov wrote:
>
> On 05.09.2021 19:19, Michael S. Tsirkin wrote:
> > On Sun, Sep 05, 2021 at 07:02:44PM +0300, Arseny Krasnov wrote:
> >> On 05.09.2021 18:55, Michael S. Tsirkin wrote:
> >>> On Fri, Sep 03, 2021 at 03:30:13PM +0300, Arseny Krasnov wrote:
> >>>> This patchset implements support of MSG_EOR bit for SEQPACKET
> >>>> AF_VSOCK sockets over virtio transport.
> >>>> First we need to define 'messages' and 'records' like this:
> >>>> Message is result of sending calls: 'write()', 'send()', 'sendmsg()'
> >>>> etc. It has fixed maximum length, and it bounds are visible using
> >>>> return from receive calls: 'read()', 'recv()', 'recvmsg()' etc.
> >>>> Current implementation based on message definition above.
> >>>> Record has unlimited length, it consists of multiple message,
> >>>> and bounds of record are visible via MSG_EOR flag returned from
> >>>> 'recvmsg()' call. Sender passes MSG_EOR to sending system call and
> >>>> receiver will see MSG_EOR when corresponding message will be processed.
> >>>> Idea of patchset comes from POSIX: it says that SEQPACKET
> >>>> supports record boundaries which are visible for receiver using
> >>>> MSG_EOR bit. So, it looks like MSG_EOR is enough thing for SEQPACKET
> >>>> and we don't need to maintain boundaries of corresponding send -
> >>>> receive system calls. But, for 'sendXXX()' and 'recXXX()' POSIX says,
> >>>> that all these calls operates with messages, e.g. 'sendXXX()' sends
> >>>> message, while 'recXXX()' reads messages and for SEQPACKET, 'recXXX()'
> >>>> must read one entire message from socket, dropping all out of size
> >>>> bytes. Thus, both message boundaries and MSG_EOR bit must be supported
> >>>> to follow POSIX rules.
> >>>> To support MSG_EOR new bit was added along with existing
> >>>> 'VIRTIO_VSOCK_SEQ_EOR': 'VIRTIO_VSOCK_SEQ_EOM'(end-of-message) - now it
> >>>> works in the same way as 'VIRTIO_VSOCK_SEQ_EOR'. But 'VIRTIO_VSOCK_SEQ_EOR'
> >>>> is used to mark 'MSG_EOR' bit passed from userspace.
> >>>> This patchset includes simple test for MSG_EOR.
> >>> I'm prepared to merge this for this window,
> >>> but I'm not sure who's supposed to ack the net/vmw_vsock/af_vsock.c
> >>> bits. It's a harmless variable renaming so maybe it does not matter.
> >>>
> >>> The rest is virtio stuff so I guess my tree is ok.
> >>>
> >>> Objections, anyone?
> >> https://lkml.org/lkml/2021/9/3/76 this is v4. It is same as v5 in af_vsock.c changes.
> >>
> >> It has Reviewed by from Stefano Garzarella.
> > Is Stefano the maintainer for af_vsock then?
> > I wasn't sure.
> Ack, let's wait for maintainer's comment
The specific patch is a trivial variable renaming so
I parked this in my tree for now, will merge unless I
hear any objections in the next couple of days.
> >>>
> >>>> Arseny Krasnov(6):
> >>>> virtio/vsock: rename 'EOR' to 'EOM' bit.
> >>>> virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOR' bit.
> >>>> vhost/vsock: support MSG_EOR bit processing
> >>>> virtio/vsock: support MSG_EOR bit processing
> >>>> af_vsock: rename variables in receive loop
> >>>> vsock_test: update message bounds test for MSG_EOR
> >>>>
> >>>> drivers/vhost/vsock.c | 28 +++++++++++++----------
> >>>> include/uapi/linux/virtio_vsock.h | 3 ++-
> >>>> net/vmw_vsock/af_vsock.c | 10 ++++----
> >>>> net/vmw_vsock/virtio_transport_common.c | 23 ++++++++++++-------
> >>>> tools/testing/vsock/vsock_test.c | 8 ++++++-
> >>>> 5 files changed, 45 insertions(+), 27 deletions(-)
> >>>>
> >>>> v4 -> v5:
> >>>> - Move bitwise and out of le32_to_cpu() in 0003.
> >>>>
> >>>> v3 -> v4:
> >>>> - 'sendXXX()' renamed to 'send*()' in 0002- commit msg.
> >>>> - Comment about bit restore updated in 0003-.
> >>>> - 'same' renamed to 'similar' in 0003- commit msg.
> >>>> - u32 used instead of uint32_t in 0003-.
> >>>>
> >>>> v2 -> v3:
> >>>> - 'virtio/vsock: rename 'EOR' to 'EOM' bit.' - commit message updated.
> >>>> - 'VIRTIO_VSOCK_SEQ_EOR' bit add moved to separate patch.
> >>>> - 'vhost/vsock: support MSG_EOR bit processing' - commit message
> >>>> updated.
> >>>> - 'vhost/vsock: support MSG_EOR bit processing' - removed unneeded
> >>>> 'le32_to_cpu()', because input argument was already in CPU
> >>>> endianness.
> >>>>
> >>>> v1 -> v2:
> >>>> - 'VIRTIO_VSOCK_SEQ_EOR' is renamed to 'VIRTIO_VSOCK_SEQ_EOM', to
> >>>> support backward compatibility.
> >>>> - use bitmask of flags to restore in vhost.c, instead of separated
> >>>> bool variable for each flag.
> >>>> - test for EAGAIN removed, as logically it is not part of this
> >>>> patchset(will be sent separately).
> >>>> - cover letter updated(added part with POSIX description).
> >>>>
> >>>> Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
> >>>> --
> >>>> 2.25.1
> >
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v5 0/6] virtio/vsock: introduce MSG_EOR flag for SEQPACKET
2021-09-05 20:18 ` Michael S. Tsirkin
@ 2021-09-06 7:33 ` Stefano Garzarella
2021-09-06 8:03 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Stefano Garzarella @ 2021-09-06 7:33 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Andra Paraschiv, kvm@vger.kernel.org, netdev@vger.kernel.org,
stsp2@yandex.ru, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, oxffffaa@gmail.com,
Norbert Slusarek, Stefan Hajnoczi, Jakub Kicinski, Colin Ian King,
Arseny Krasnov, David S. Miller
On Sun, Sep 05, 2021 at 04:18:52PM -0400, Michael S. Tsirkin wrote:
>On Sun, Sep 05, 2021 at 07:21:10PM +0300, Arseny Krasnov wrote:
>>
>> On 05.09.2021 19:19, Michael S. Tsirkin wrote:
>> > On Sun, Sep 05, 2021 at 07:02:44PM +0300, Arseny Krasnov wrote:
>> >> On 05.09.2021 18:55, Michael S. Tsirkin wrote:
>> >>> On Fri, Sep 03, 2021 at 03:30:13PM +0300, Arseny Krasnov wrote:
>> >>>> This patchset implements support of MSG_EOR bit for SEQPACKET
>> >>>> AF_VSOCK sockets over virtio transport.
>> >>>> First we need to define 'messages' and 'records' like this:
>> >>>> Message is result of sending calls: 'write()', 'send()', 'sendmsg()'
>> >>>> etc. It has fixed maximum length, and it bounds are visible using
>> >>>> return from receive calls: 'read()', 'recv()', 'recvmsg()' etc.
>> >>>> Current implementation based on message definition above.
>> >>>> Record has unlimited length, it consists of multiple message,
>> >>>> and bounds of record are visible via MSG_EOR flag returned from
>> >>>> 'recvmsg()' call. Sender passes MSG_EOR to sending system call and
>> >>>> receiver will see MSG_EOR when corresponding message will be processed.
>> >>>> Idea of patchset comes from POSIX: it says that SEQPACKET
>> >>>> supports record boundaries which are visible for receiver using
>> >>>> MSG_EOR bit. So, it looks like MSG_EOR is enough thing for SEQPACKET
>> >>>> and we don't need to maintain boundaries of corresponding send -
>> >>>> receive system calls. But, for 'sendXXX()' and 'recXXX()' POSIX says,
>> >>>> that all these calls operates with messages, e.g. 'sendXXX()' sends
>> >>>> message, while 'recXXX()' reads messages and for SEQPACKET, 'recXXX()'
>> >>>> must read one entire message from socket, dropping all out of size
>> >>>> bytes. Thus, both message boundaries and MSG_EOR bit must be supported
>> >>>> to follow POSIX rules.
>> >>>> To support MSG_EOR new bit was added along with existing
>> >>>> 'VIRTIO_VSOCK_SEQ_EOR': 'VIRTIO_VSOCK_SEQ_EOM'(end-of-message) - now it
>> >>>> works in the same way as 'VIRTIO_VSOCK_SEQ_EOR'. But 'VIRTIO_VSOCK_SEQ_EOR'
>> >>>> is used to mark 'MSG_EOR' bit passed from userspace.
>> >>>> This patchset includes simple test for MSG_EOR.
>> >>> I'm prepared to merge this for this window,
>> >>> but I'm not sure who's supposed to ack the net/vmw_vsock/af_vsock.c
>> >>> bits. It's a harmless variable renaming so maybe it does not matter.
>> >>>
>> >>> The rest is virtio stuff so I guess my tree is ok.
>> >>>
>> >>> Objections, anyone?
>> >> https://lkml.org/lkml/2021/9/3/76 this is v4. It is same as v5 in af_vsock.c changes.
>> >>
>> >> It has Reviewed by from Stefano Garzarella.
>> > Is Stefano the maintainer for af_vsock then?
>> > I wasn't sure.
I'm maintaining virtio-vsock stuff, but I'm reviewing most of the
af_vsock patches. We don't have an entry for it in MAINTAINERS, maybe we
should.
>> Ack, let's wait for maintainer's comment
>
>
>The specific patch is a trivial variable renaming so
>I parked this in my tree for now, will merge unless I
>hear any objections in the next couple of days.
I agree, I think your tree is fine, since this series is mostly about
virtio-vsock.
Thanks,
Stefano
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v5 0/6] virtio/vsock: introduce MSG_EOR flag for SEQPACKET
2021-09-06 7:33 ` Stefano Garzarella
@ 2021-09-06 8:03 ` Michael S. Tsirkin
0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2021-09-06 8:03 UTC (permalink / raw)
To: Stefano Garzarella
Cc: Andra Paraschiv, kvm@vger.kernel.org, netdev@vger.kernel.org,
stsp2@yandex.ru, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, oxffffaa@gmail.com,
Norbert Slusarek, Stefan Hajnoczi, Jakub Kicinski, Colin Ian King,
Arseny Krasnov, David S. Miller
On Mon, Sep 06, 2021 at 09:33:15AM +0200, Stefano Garzarella wrote:
> On Sun, Sep 05, 2021 at 04:18:52PM -0400, Michael S. Tsirkin wrote:
> > On Sun, Sep 05, 2021 at 07:21:10PM +0300, Arseny Krasnov wrote:
> > >
> > > On 05.09.2021 19:19, Michael S. Tsirkin wrote:
> > > > On Sun, Sep 05, 2021 at 07:02:44PM +0300, Arseny Krasnov wrote:
> > > >> On 05.09.2021 18:55, Michael S. Tsirkin wrote:
> > > >>> On Fri, Sep 03, 2021 at 03:30:13PM +0300, Arseny Krasnov wrote:
> > > >>>> This patchset implements support of MSG_EOR bit for SEQPACKET
> > > >>>> AF_VSOCK sockets over virtio transport.
> > > >>>> First we need to define 'messages' and 'records' like this:
> > > >>>> Message is result of sending calls: 'write()', 'send()', 'sendmsg()'
> > > >>>> etc. It has fixed maximum length, and it bounds are visible using
> > > >>>> return from receive calls: 'read()', 'recv()', 'recvmsg()' etc.
> > > >>>> Current implementation based on message definition above.
> > > >>>> Record has unlimited length, it consists of multiple message,
> > > >>>> and bounds of record are visible via MSG_EOR flag returned from
> > > >>>> 'recvmsg()' call. Sender passes MSG_EOR to sending system call and
> > > >>>> receiver will see MSG_EOR when corresponding message will be processed.
> > > >>>> Idea of patchset comes from POSIX: it says that SEQPACKET
> > > >>>> supports record boundaries which are visible for receiver using
> > > >>>> MSG_EOR bit. So, it looks like MSG_EOR is enough thing for SEQPACKET
> > > >>>> and we don't need to maintain boundaries of corresponding send -
> > > >>>> receive system calls. But, for 'sendXXX()' and 'recXXX()' POSIX says,
> > > >>>> that all these calls operates with messages, e.g. 'sendXXX()' sends
> > > >>>> message, while 'recXXX()' reads messages and for SEQPACKET, 'recXXX()'
> > > >>>> must read one entire message from socket, dropping all out of size
> > > >>>> bytes. Thus, both message boundaries and MSG_EOR bit must be supported
> > > >>>> to follow POSIX rules.
> > > >>>> To support MSG_EOR new bit was added along with existing
> > > >>>> 'VIRTIO_VSOCK_SEQ_EOR': 'VIRTIO_VSOCK_SEQ_EOM'(end-of-message) - now it
> > > >>>> works in the same way as 'VIRTIO_VSOCK_SEQ_EOR'. But 'VIRTIO_VSOCK_SEQ_EOR'
> > > >>>> is used to mark 'MSG_EOR' bit passed from userspace.
> > > >>>> This patchset includes simple test for MSG_EOR.
> > > >>> I'm prepared to merge this for this window,
> > > >>> but I'm not sure who's supposed to ack the net/vmw_vsock/af_vsock.c
> > > >>> bits. It's a harmless variable renaming so maybe it does not matter.
> > > >>>
> > > >>> The rest is virtio stuff so I guess my tree is ok.
> > > >>>
> > > >>> Objections, anyone?
> > > >> https://lkml.org/lkml/2021/9/3/76 this is v4. It is same as v5 in af_vsock.c changes.
> > > >>
> > > >> It has Reviewed by from Stefano Garzarella.
> > > > Is Stefano the maintainer for af_vsock then?
> > > > I wasn't sure.
>
> I'm maintaining virtio-vsock stuff, but I'm reviewing most of the af_vsock
> patches. We don't have an entry for it in MAINTAINERS, maybe we should.
Yea, please add that. And the test I guess?
It's now Dave and while he's great as we all know,
reducing the load on him is a good thing to do.
> > > Ack, let's wait for maintainer's comment
> >
> >
> > The specific patch is a trivial variable renaming so
> > I parked this in my tree for now, will merge unless I
> > hear any objections in the next couple of days.
>
> I agree, I think your tree is fine, since this series is mostly about
> virtio-vsock.
>
> Thanks,
> Stefano
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-09-06 8:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210903123016.3272800-1-arseny.krasnov@kaspersky.com>
[not found] ` <20210903123238.3273526-1-arseny.krasnov@kaspersky.com>
2021-09-03 12:51 ` [PATCH net-next v5 3/6] vhost/vsock: support MSG_EOR bit processing Stefano Garzarella
2021-09-05 15:55 ` [PATCH net-next v5 0/6] virtio/vsock: introduce MSG_EOR flag for SEQPACKET Michael S. Tsirkin
[not found] ` <4558e96b-6330-667f-955b-b689986f884f@kaspersky.com>
2021-09-05 16:19 ` Michael S. Tsirkin
[not found] ` <5b20410a-fb8f-2e38-59d9-74dc6b8a9d4f@kaspersky.com>
2021-09-05 20:18 ` Michael S. Tsirkin
2021-09-06 7:33 ` Stefano Garzarella
2021-09-06 8:03 ` Michael S. Tsirkin
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).