[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B95BC5A0-EB56-4921-8FFB-C41CFB7929C5@vmware.com>
Date: Thu, 30 Mar 2023 21:49:12 +0000
From: Vishnu Dasa <vdasa@...are.com>
To: Arseniy Krasnov <AVKrasnov@...rdevices.ru>
CC: Stefan Hajnoczi <stefanha@...hat.com>,
Stefano Garzarella <sgarzare@...hat.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Bobby Eshleman <bobby.eshleman@...edance.com>,
Bryan Tan <bryantan@...are.com>,
"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>,
"kernel@...rdevices.ru" <kernel@...rdevices.ru>,
"oxffffaa@...il.com" <oxffffaa@...il.com>,
Pv-drivers <Pv-drivers@...are.com>
Subject: Re: [RFC PATCH v3 2/4] vsock/vmci: convert VMCI error code to -ENOMEM
on receive
> On Mar 30, 2023, at 1:18 PM, Arseniy Krasnov <AVKrasnov@...rdevices.ru> wrote:
>
> !! External Email
>
> On 30.03.2023 23:13, Arseniy Krasnov wrote:
>> This adds conversion of VMCI specific error code to general -ENOMEM. It
>> is needed, because af_vsock.c passes error value returned from transport
>> to the user, which does not expect to get VMCI_ERROR_* values.
>
> @Stefano, I have some doubts about this commit message, as it says "... af_vsock.c
> passes error value returned from transport to the user ...", but this
> behaviour is implemented only in the next patch. Is it ok, if both patches
> are in a single patchset?
>
> For patch 1 I think it is ok, as it fixes current implementation.
>
> Thanks, Arseniy
>
>>
>> Signed-off-by: Arseniy Krasnov <AVKrasnov@...rdevices.ru>
Code change looks good to me. Will let you figure out the commit message
with Stefano. Thanks!
Reviewed-by: Vishnu Dasa <vdasa@...are.com>
>> ---
>> net/vmw_vsock/vmci_transport.c | 11 +++++++++--
>> 1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
>> index 95cc4d79ba29..b370070194fa 100644
>> --- a/net/vmw_vsock/vmci_transport.c
>> +++ b/net/vmw_vsock/vmci_transport.c
>> @@ -1831,10 +1831,17 @@ static ssize_t vmci_transport_stream_dequeue(
>> size_t len,
>> int flags)
>> {
>> + ssize_t err;
>> +
>> if (flags & MSG_PEEK)
>> - return vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0);
>> + err = vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len, 0);
>> else
>> - return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0);
>> + err = vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len, 0);
>> +
>> + if (err < 0)
>> + err = -ENOMEM;
>> +
>> + return err;
>> }
>>
>> static ssize_t vmci_transport_stream_enqueue(
>
> !! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Powered by blists - more mailing lists