mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arseniy Krasnov <avkrasnov@sberdevices.ru>
To: Stefano Garzarella <sgarzare@redhat.com>, Vishnu Dasa <vdasa@vmware.com>
Cc: Bryan Tan <bryantan@vmware.com>,
	VMware PV-Drivers Reviewers <pv-drivers@vmware.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Bobby Eshleman <bobby.eshleman@bytedance.com>,
	<kvm@vger.kernel.org>,
	<virtualization@lists.linux-foundation.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<kernel@sberdevices.ru>, <oxffffaa@gmail.com>
Subject: Re: [RFC PATCH v1 1/2] vsock: return errors other than -ENOMEM to socket
Date: Tue, 28 Mar 2023 14:20:33 +0300	[thread overview]
Message-ID: <64451c35-5442-73cb-4398-2b907dd810cc@sberdevices.ru> (raw)
In-Reply-To: <ak74j6l2qesrixxmw7pfw56najqhdn32lv3xfxcb53nvmkyi3x@fr25vo2jlvbj>



On 28.03.2023 14:19, Stefano Garzarella wrote:
> On Tue, Mar 28, 2023 at 01:42:19PM +0300, Arseniy Krasnov wrote:
>>
>>
>> On 28.03.2023 12:42, Stefano Garzarella wrote:
>>> I pressed send too early...
>>>
>>> CCing Bryan, Vishnu, and pv-drivers@vmware.com
>>>
>>> On Tue, Mar 28, 2023 at 11:39 AM Stefano Garzarella <sgarzare@redhat.com> wrote:
>>>>
>>>> On Sun, Mar 26, 2023 at 01:13:11AM +0300, Arseniy Krasnov wrote:
>>>>> This removes behaviour, where error code returned from any transport
>>>>> was always switched to ENOMEM. This works in the same way as:
>>>>> commit
>>>>> c43170b7e157 ("vsock: return errors other than -ENOMEM to socket"),
>>>>> but for receive calls.
>>>>>
>>>>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
>>>>> ---
>>>>> net/vmw_vsock/af_vsock.c | 4 ++--
>>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
>>>>> index 19aea7cba26e..9262e0b77d47 100644
>>>>> --- a/net/vmw_vsock/af_vsock.c
>>>>> +++ b/net/vmw_vsock/af_vsock.c
>>>>> @@ -2007,7 +2007,7 @@ static int __vsock_stream_recvmsg(struct sock *sk, struct msghdr *msg,
>>>>>
>>>>>               read = transport->stream_dequeue(vsk, msg, len - copied, flags);
>>>>
>>>> In vmci_transport_stream_dequeue() vmci_qpair_peekv() and
>>>> vmci_qpair_dequev() return VMCI_ERROR_* in case of errors.
>>>>
>>>> Maybe we should return -ENOMEM in vmci_transport_stream_dequeue() if
>>>> those functions fail to keep the same behavior.
>>
>> Yes, seems i missed it, because several months ago we had similar question for send
>> logic:
>> https://www.spinics.net/lists/kernel/msg4611091.html
>> And it was ok to not handle VMCI send path in this way. So i think current implementation
>> for tx is a little bit buggy, because VMCI specific error from 'vmci_qpair_enquev()' is
>> returned to af_vsock.c. I think error conversion must be added to VMCI transport for tx
>> also.
> 
> Good point!
> 
> These are negative values, so there are no big problems, but I don't
> know what the user expects in this case.
> 
> @Vishnu Do we want to return an errno to the user or a VMCI_ERROR_*?

Small remark, as i can see, VMCI_ERROR_ is not exported to user in include/uapi,
so IIUC user won't be able to interpret such values correctly.

Thanks, Arseniy

> 
> In both cases I think we should do the same for both enqueue and
> dequeue.
> 
>>
>> Good thing is that Hyper-V uses general error codes.
> 
> Yeah!
> 
> Thanks,
> Stefano
> 
>>
>> Thanks, Arseniy
>>>>
>>>> CCing Bryan, Vishnu, and pv-drivers@vmware.com
>>>>
>>>> The other transports seem okay to me.
>>>>
>>>> Thanks,
>>>> Stefano
>>>>
>>>>>               if (read < 0) {
>>>>> -                      err = -ENOMEM;
>>>>> +                      err = read;
>>>>>                       break;
>>>>>               }
>>>>>
>>>>> @@ -2058,7 +2058,7 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg,
>>>>>       msg_len = transport->seqpacket_dequeue(vsk, msg, flags);
>>>>>
>>>>>       if (msg_len < 0) {
>>>>> -              err = -ENOMEM;
>>>>> +              err = msg_len;
>>>>>               goto out;
>>>>>       }
>>>>>
>>>>> -- 
>>>>> 2.25.1
>>>>>
>>>
>>
> 

  reply	other threads:[~2023-03-28 11:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 22:12 [RFC PATCH v1 0/2] " Arseniy Krasnov
2023-03-25 22:13 ` [RFC PATCH v1 1/2] vsock: " Arseniy Krasnov
2023-03-28  9:39   ` Stefano Garzarella
2023-03-28  9:42     ` Stefano Garzarella
2023-03-28 10:42       ` Arseniy Krasnov
2023-03-28 11:19         ` Stefano Garzarella
2023-03-28 11:20           ` Arseniy Krasnov [this message]
2023-03-29 21:44             ` Vishnu Dasa
2023-03-30  5:13               ` Arseniy Krasnov
2023-03-25 22:14 ` [RFC PATCH v1 2/2] vsock/test: update expected return values Arseniy Krasnov
2023-03-28  9:44   ` 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=64451c35-5442-73cb-4398-2b907dd810cc@sberdevices.ru \
    --to=avkrasnov@sberdevices.ru \
    --cc=bobby.eshleman@bytedance.com \
    --cc=bryantan@vmware.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@sberdevices.ru \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oxffffaa@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=pv-drivers@vmware.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=vdasa@vmware.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

all inboxes | Powered by JetHome®