Message ID | 675b1f93-dc07-0a70-0622-c3fc6236c8bb@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4171903wrr; Fri, 25 Nov 2022 09:15:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf5q7vpGnvsI5HXnvrbgJxwdJGda1mAj6jmcJc16Ah4lYM72ieSO9iS3MnknxaXhWwC4PWXd X-Received: by 2002:a63:1e5b:0:b0:477:3c62:49ba with SMTP id p27-20020a631e5b000000b004773c6249bamr16772553pgm.446.1669396524657; Fri, 25 Nov 2022 09:15:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669396524; cv=none; d=google.com; s=arc-20160816; b=ksYRfMXDdhFI7Aa6+ztfGz+pJQlMRt0l0t7ZxDsRDGEYyHpG+td73ze+bfi1rJacwt nXZA1mB45pXV2sz7ZoSq8bZ7EYVGRGtx04Sa3MPe84dRTqDMWqmN1fC1O+MnVc2XHRNH YWMzVEGO2Ca7/gCapC1C14dELSEnMBC2hr2yE7RJGjbemH4fyEF5RncYHqsGkTciBmAI D3DdmczR4kUUMuz1+07sW/4ysvRWWzQHw5kCTjxnVGj7SLO1bLm2AeR90EjjFQcAE1O1 mryTmHuC/hPS61wo+9WSKJFdwu39c2MBlNTrjsNrmMwo54hybzaUNkjfieWS92TYJP4M Czlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=KXyYR4VF9sCYOsS3NPi6MuVELIEouxGMJZ8BpfDIAZo=; b=r0xtBw7MSDyrCAL9/dnbQl/cbgeIyj2yUFYoBEDlxF3WeCi2RBCzJ21tRkAfoeaQdZ +fYegH6GrY5CaK+bEO3AOnaJl6i8uYnY7629u3gK8PEQzoaDQEy93KlTx/IRDw07V0Jl e1H06/csR3aRu+09sDnfu/f1N+d1DorARhFzSMdya41Cny0i+XU3F6D6i9VWtCTwvqge LiHT7n4Zjny+1Lky4NYezDrbunW5YxDsahuEySaFWUsWe2J7lGboA2Vl0Fj3YUycjJNB AjXTGcdvjtALhcYETpezud3RImsnverB+9BObbUKxHXrvxACUpwfciFdYSVlIYH7bi5i vy0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=cyQDFrMQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s8-20020a632c08000000b004772bd99e54si5103276pgs.32.2022.11.25.09.15.09; Fri, 25 Nov 2022 09:15:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=cyQDFrMQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbiKYRIN (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Fri, 25 Nov 2022 12:08:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiKYRIM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 25 Nov 2022 12:08:12 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0852165A8; Fri, 25 Nov 2022 09:08:09 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 1E46B5FD0C; Fri, 25 Nov 2022 20:08:08 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1669396088; bh=KXyYR4VF9sCYOsS3NPi6MuVELIEouxGMJZ8BpfDIAZo=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=cyQDFrMQ8vzelcVlsjJps0cLRUAWlLytI/uP3q6P9R+5SdbJCbaQvZ9W5CFsZinZG oXPE+FxBfkfA98sqOGxND2adWai2xXOoqJxype2JDn4RvKQ0WGTSJa1cf+OVxwXPET M7YLm1wFzcDzkew3sNVRvf+RyL+RAbqVYmWFM0MSMhEvqEOMrde3dVBKl4Tf27CLQo fAXA2NWFMrHZ+0U1q5MHQAtZHnXADT3RRDanIbKJyB8kssS7BzHVmKps4/A8tK+Lrp lHgpvnTbrkVVYuoDx1KVWlDcinJwCV5u/awtMa2LCkStr7Egyuas+d0Azb3kQchsPn ddqI560AwAOHQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Fri, 25 Nov 2022 20:08:06 +0300 (MSK) From: Arseniy Krasnov <AVKrasnov@sberdevices.ru> To: Stefano Garzarella <sgarzare@redhat.com>, "David S. Miller" <davem@davemloft.net>, "edumazet@google.com" <edumazet@google.com>, "Jakub Kicinski" <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, "kys@microsoft.com" <kys@microsoft.com>, "haiyangz@microsoft.com" <haiyangz@microsoft.com>, "wei.liu@kernel.org" <wei.liu@kernel.org>, "Dexuan Cui" <decui@microsoft.com>, Bryan Tan <bryantan@vmware.com>, Vishnu Dasa <vdasa@vmware.com>, Arseniy Krasnov <AVKrasnov@sberdevices.ru>, "Krasnov Arseniy" <oxffffaa@gmail.com>, Bobby Eshleman <bobby.eshleman@gmail.com>, Bobby Eshleman <bobby.eshleman@bytedance.com> CC: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "virtualization@lists.linux-foundation.org" <virtualization@lists.linux-foundation.org>, "linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>, kernel <kernel@sberdevices.ru> Subject: [RFC PATCH v2 3/6] vsock/vmci: always return ENOMEM in case of error Thread-Topic: [RFC PATCH v2 3/6] vsock/vmci: always return ENOMEM in case of error Thread-Index: AQHZAPB8vpTNk9Cz/UiwVhA3FAXi7Q== Date: Fri, 25 Nov 2022 17:08:06 +0000 Message-ID: <675b1f93-dc07-0a70-0622-c3fc6236c8bb@sberdevices.ru> In-Reply-To: <9d96f6c6-1d4f-8197-b3bc-8957124c8933@sberdevices.ru> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-Type: text/plain; charset="utf-8" Content-ID: <EE8E26C4524E094488B07003CE426ABC@sberdevices.ru> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/11/25 14:59:00 #20610704 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750489130535125962?= X-GMAIL-MSGID: =?utf-8?q?1750489130535125962?= |
Series |
vsock: update tools and error handling
|
|
Commit Message
Arseniy Krasnov
Nov. 25, 2022, 5:08 p.m. UTC
From: Bobby Eshleman <bobby.eshleman@bytedance.com> This saves original behaviour from af_vsock.c - switch any error code returned from transport layer to ENOMEM. Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> --- net/vmw_vsock/vmci_transport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.25.1
Comments
On 01.12.2022 12:30, Stefano Garzarella wrote: > On Fri, Nov 25, 2022 at 05:08:06PM +0000, Arseniy Krasnov wrote: >> From: Bobby Eshleman <bobby.eshleman@bytedance.com> >> >> This saves original behaviour from af_vsock.c - switch any error >> code returned from transport layer to ENOMEM. >> >> Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com> >> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >> --- >> net/vmw_vsock/vmci_transport.c | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) > > @Bryan @Vishnu what do you think about this patch? > > A bit of context: > > Before this series, the af_vsock core always returned ENOMEM to the user if the transport failed to queue the packet. > > Now we are changing it by returning the transport error. So I think here we want to preserve the previous behavior for vmci, but I don't know if that's the right thing. > > > > @Arseniy please in the next versions describe better in the commit messages the reasons for these changes, so it is easier review for others and also in the future by reading the commit message we can understand the reason for the change. Hello, Sure! Sorry for that! Also, I can send both vmci and hyperv patches in the next version(e.g. not waiting for reviewers reply and reorder them with 1/6 as You asked), as result of review could be dropped patch only. Thanks, Arseniy > > Thanks, > Stefano > >> >> diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c >> index 842c94286d31..289a36a203a2 100644 >> --- a/net/vmw_vsock/vmci_transport.c >> +++ b/net/vmw_vsock/vmci_transport.c >> @@ -1838,7 +1838,14 @@ static ssize_t vmci_transport_stream_enqueue( >> struct msghdr *msg, >> size_t len) >> { >> - return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >> + int err; >> + >> + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >> + >> + if (err < 0) >> + err = -ENOMEM; >> + >> + return err; >> } >> >> static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk) >> -- >> 2.25.1 >
> On Dec 1, 2022, at 1:30 AM, Stefano Garzarella <sgarzare@redhat.com> wrote: > > !! External Email > > On Fri, Nov 25, 2022 at 05:08:06PM +0000, Arseniy Krasnov wrote: >> From: Bobby Eshleman <bobby.eshleman@bytedance.com> >> >> This saves original behaviour from af_vsock.c - switch any error >> code returned from transport layer to ENOMEM. >> >> Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com> >> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >> --- >> net/vmw_vsock/vmci_transport.c | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) > > @Bryan @Vishnu what do you think about this patch? > > A bit of context: > > Before this series, the af_vsock core always returned ENOMEM to the user > if the transport failed to queue the packet. > > Now we are changing it by returning the transport error. So I think here > we want to preserve the previous behavior for vmci, but I don't know if > that's the right thing. > Agree with Stefano. I don't think we need to preserve the previous behavior for vmci. > > @Arseniy please in the next versions describe better in the commit > messages the reasons for these changes, so it is easier review for > others and also in the future by reading the commit message we can > understand the reason for the change. > > Thanks, > Stefano > >> >> diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c >> index 842c94286d31..289a36a203a2 100644 >> --- a/net/vmw_vsock/vmci_transport.c >> +++ b/net/vmw_vsock/vmci_transport.c >> @@ -1838,7 +1838,14 @@ static ssize_t vmci_transport_stream_enqueue( >> struct msghdr *msg, >> size_t len) >> { >> - return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >> + int err; >> + >> + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >> + >> + if (err < 0) >> + err = -ENOMEM; >> + >> + return err; >> } >> >> static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk) >> -- >> 2.25.1 > > > !! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
On 01.12.2022 18:14, Vishnu Dasa wrote: > > >> On Dec 1, 2022, at 1:30 AM, Stefano Garzarella <sgarzare@redhat.com> wrote: >> >> !! External Email >> >> On Fri, Nov 25, 2022 at 05:08:06PM +0000, Arseniy Krasnov wrote: >>> From: Bobby Eshleman <bobby.eshleman@bytedance.com> >>> >>> This saves original behaviour from af_vsock.c - switch any error >>> code returned from transport layer to ENOMEM. >>> >>> Signed-off-by: Bobby Eshleman <bobby.eshleman@bytedance.com> >>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >>> --- >>> net/vmw_vsock/vmci_transport.c | 9 ++++++++- >>> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> @Bryan @Vishnu what do you think about this patch? >> >> A bit of context: >> >> Before this series, the af_vsock core always returned ENOMEM to the user >> if the transport failed to queue the packet. >> >> Now we are changing it by returning the transport error. So I think here >> we want to preserve the previous behavior for vmci, but I don't know if >> that's the right thing. >> > > Agree with Stefano. I don't think we need to preserve the previous > behavior for vmci. Good! I'll remove this patch from the next version Thanks, Arseniy > >> >> @Arseniy please in the next versions describe better in the commit >> messages the reasons for these changes, so it is easier review for >> others and also in the future by reading the commit message we can >> understand the reason for the change. >> >> Thanks, >> Stefano >> >>> >>> diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c >>> index 842c94286d31..289a36a203a2 100644 >>> --- a/net/vmw_vsock/vmci_transport.c >>> +++ b/net/vmw_vsock/vmci_transport.c >>> @@ -1838,7 +1838,14 @@ static ssize_t vmci_transport_stream_enqueue( >>> struct msghdr *msg, >>> size_t len) >>> { >>> - return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >>> + int err; >>> + >>> + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); >>> + >>> + if (err < 0) >>> + err = -ENOMEM; >>> + >>> + return err; >>> } >>> >>> static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk) >>> -- >>> 2.25.1 >> >> >> !! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender. >
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 842c94286d31..289a36a203a2 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c @@ -1838,7 +1838,14 @@ static ssize_t vmci_transport_stream_enqueue( struct msghdr *msg, size_t len) { - return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); + int err; + + err = vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg, len, 0); + + if (err < 0) + err = -ENOMEM; + + return err; } static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk)