Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp147275rwl; Thu, 30 Mar 2023 13:34:36 -0700 (PDT) X-Google-Smtp-Source: AKy350b5FxIKnzIQD/Kt2qmBwZJtFqylqyYtY7dSPT43qAZqJlC+TBilIeovghYpQKTwtggiX0T9 X-Received: by 2002:a17:906:dd:b0:93e:22e6:e7d1 with SMTP id 29-20020a17090600dd00b0093e22e6e7d1mr3260216eji.3.1680208476398; Thu, 30 Mar 2023 13:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680208476; cv=none; d=google.com; s=arc-20160816; b=MnNm9jNVlGnXmdtXtVqH7sJwtSOrkdew0UszKPVGjIlezjKmaaGqZce7ic7I+WbQ0j TVAB/jm6XZ76S8I8h4wzahhS9v93aiiB2fzbqZVz//dAvfelsYAvrm6ZAZqG7dRhoFP9 A+lqBWIdeJbFQHyclDhBaEct0ri/844QGk6zM/bdQcRIYPXF6xjlAshMS+wg/yPn5u4M wr93+IKrxM3MKxbtidgfiJA+UsrFtHR2yEa5CkIVYsgtVI3/vSy38Dz3mnPNOKyB/8n+ 4HVlLlBcM7Dofkfurw7FAdk+VI1KUPOvsOiENM6S0XtO8nWhU/rAeFP/ooHzS/u+1cm5 w72g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=meOX4aPLT7ua2fm3pAcRz2CPeAaR40Mrt2950POSbpg=; b=Z1DDR7kSZI3LbGYDD3jPospOqk+0iY15WFTmISyspCcHXhz0ynV6jIyVkkURcgzNVF EERAHJFB9bu5xElm+hQmHSw1RCQ6AWhmkJps3xwVkWh6QWgtUncrpI4Qe0Uovp7e/ULp vj6bRBU2Zbnp5KEugnyke4WPnssPmx//6xfI/eeHLbsVT9Zvc0K2DCb0Z78eGY5uIXgZ nqIRPVf2O0VWaSDTj8rI/GLHcCwoGVubRmCIYxw3vbYOd3xeFQJvEKC0zbjR44mrJMK2 UC11zDdWk6cUlB3Ue3dxW4CxlBJIg1yytmY3ZWGG2KcucIx9jTj01sAqXHhPC74vgXCi cXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=qG7GNsMj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n13-20020a1709062bcd00b0093dc70f1709si392354ejg.779.2023.03.30.13.34.07; Thu, 30 Mar 2023 13:34:36 -0700 (PDT) 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=qG7GNsMj; 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 S229783AbjC3UWF (ORCPT + 99 others); Thu, 30 Mar 2023 16:22:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbjC3UWE (ORCPT ); Thu, 30 Mar 2023 16:22:04 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 638EA40D3; Thu, 30 Mar 2023 13:22:03 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id B62095FD0B; Thu, 30 Mar 2023 23:22:01 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1680207721; bh=meOX4aPLT7ua2fm3pAcRz2CPeAaR40Mrt2950POSbpg=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; b=qG7GNsMjtkXbQFcQ7fVw4vaA+go5me0j2pKq/X6PeOnJazC5MTLXr6oC63qaExTkv uzSLbsCTYnKYroneJ8IxfM0WJYPS1lhBNCEpXp+9faTSdOWf0XJGYdiD+8zwwV/Sc4 9nDIseWtAthUDHeAVAQMAHXE36ZGHQeXuZK8ilmhgK9rSPsQmYgBr5efnGGO4L/aa5 KR+lrAgME/LSuNM46TLhrfB1x46LwVOqJk4g0gy7OO4/jFPpwq1OKhdW2s3e+JC0ZF 53dnZ7uRnexDPUML9OEZI/217N3i8Ph+PjX2taUT3OqvPHNZRfTo2ctDBMhbNID0RW gYJ3AfzIYaapQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Thu, 30 Mar 2023 23:22:01 +0300 (MSK) Message-ID: <9fd06ca5-ace9-251d-34af-aca4db9c3ee0@sberdevices.ru> Date: Thu, 30 Mar 2023 23:18:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC PATCH v3 2/4] vsock/vmci: convert VMCI error code to -ENOMEM on receive Content-Language: en-US To: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bobby Eshleman , Bryan Tan , Vishnu Dasa CC: , , , , , , References: <4d34fac8-7170-5a3e-5043-42a9f7e4b5b3@sberdevices.ru> From: Arseniy Krasnov In-Reply-To: <4d34fac8-7170-5a3e-5043-42a9f7e4b5b3@sberdevices.ru> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) 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: 2023/03/30 18:07:00 #21069213 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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(