[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8e44442c-4cac-dcbc-a88d-17d9878e7d32@kaspersky.com>
Date: Thu, 5 Aug 2021 11:33:12 +0300
From: Arseny Krasnov <arseny.krasnov@...persky.com>
To: Stefano Garzarella <sgarzare@...hat.com>
CC: Stefan Hajnoczi <stefanha@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Colin Ian King <colin.king@...onical.com>,
Andra Paraschiv <andraprs@...zon.com>,
Norbert Slusarek <nslusarek@....net>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"oxffffaa@...il.com" <oxffffaa@...il.com>
Subject: Re: [RFC PATCH v1 0/7] virtio/vsock: introduce MSG_EOR flag for
SEQPACKET
On 04.08.2021 15:57, Stefano Garzarella wrote:
> Caution: This is an external email. Be cautious while opening links or attachments.
>
>
>
> Hi Arseny,
>
> On Mon, Jul 26, 2021 at 07:31:33PM +0300, Arseny Krasnov wrote:
>> This patchset implements support of MSG_EOR bit for SEQPACKET
>> AF_VSOCK sockets over virtio transport.
>> Idea is to distinguish concepts of 'messages' and 'records'.
>> 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.
> Okay, so the implementation we merged is wrong right?
> Should we disable the feature bit in stable kernels that contain it? Or
> maybe we can backport the fixes...
Hi,
No, this is correct and it is message boundary based. Idea of this
patchset is to add extra boundaries marker which i think could be
useful when we want to send data in seqpacket mode which length
is bigger than maximum message length(this is limited by transport).
Of course we can fragment big piece of data too small messages, but this
requires to carry fragmentation info in data protocol. So In this case
when we want to maintain boundaries receiver calls recvmsg() until MSG_EOR found.
But when receiver knows, that data is fit in maximum datagram length,
it doesn't care about checking MSG_EOR just calling recv() or read()(e.g.
message based mode).
Thank You
>
>> 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.
>> 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.
> I understand that it makes sense to remap VIRTIO_VSOCK_SEQ_EOR to
> MSG_EOR to make the user understand the boundaries, but why do we need
> EOM as well?
>
> Why do we care about the boundaries of a message within a record?
> I mean, if the sender makes 3 calls:
> send(A1,0)
> send(A2,0)
> send(A3, MSG_EOR);
>
> IIUC it should be fine if the receiver for example receives all in one
> single recv() calll with MSG_EOR set, so why do we need EOM?
>
> Thanks,
> Stefano
>
>
Powered by blists - more mailing lists