Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp217821rwl; Thu, 30 Mar 2023 14:55:03 -0700 (PDT) X-Google-Smtp-Source: AK7set//9YBCmmrf3dE50ZkLHT8dKaCpc0hV9MQ5BF6qLfz1SMP1TWb3w+zt+n333LnKqh47ou1Z X-Received: by 2002:a05:6a20:5499:b0:db:7789:237e with SMTP id i25-20020a056a20549900b000db7789237emr28525679pzk.4.1680213303141; Thu, 30 Mar 2023 14:55:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1680213303; cv=pass; d=google.com; s=arc-20160816; b=hUUFTxuu6pdDUFSrv7hN2ikv47DYibJl/tNlS8894UcwPlAs/+Won20Yr+tfYpLEA5 tq81/CaYx+BrSXUmLLPfwIUpsNm0un//E5VvVdxYeTINCqHqJWlQWqIGEMTmxhctMF38 OG1/BYh9/DNNDEANBsARXpXO1fWEs0CbZnkTfSGqk+Ma4TsFHXJzGi8FCdfoAR4wr5jX g2pxOt0AYQsP58krFo7hK/ahP/0yOFqjSivj6I2436+6vhhn1nHxOxHV8nOUobw/j92j oK3j1okLCFSUnLq+BCZbKsYbxX4W+gBY2N4vtvY+2zOArwzkPyaeBO48atHI/lTJwFm/ bivw== ARC-Message-Signature: i=2; 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:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=YzSfgg5QiGHaZ4BhMDOAFKS8HSIAVGmIcVRIO5rctVE=; b=dG3RNUGVq65SmRiOSXflSjoRFwwZ0Pa0YtRjEIYIqZ+ljM156/nogVxMNdwQyj526X 5FpoJ+DG8PO2IoZickccBHqd2As0VLIxZs+X+t6KHnuzBUFhexIHyblOCY9CrYb3hbv3 lXiC35VWDZrcPCWcccntR7og83dLTEMMCSpa8sD5gLpzj39OhVggTbWRgaqrBOnQjJV1 L3sAUF9GdRTXPdLtxoOFVJWkhPmPkqO1M1lUTH0E/urTgJWknuO9kmcaZXv23D6P8VnN 4JtJ3t/JgJjXDRzvoNEflSBa0bQj9NMd9ltqgehxuWuxERxxL2RlMvyCuuDiKMiEMF6T 3V+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=1gNZPNzg; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); 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=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a654207000000b0050ab982ea06si118305pgq.291.2023.03.30.14.54.51; Thu, 30 Mar 2023 14:55:03 -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=@vmware.com header.s=selector2 header.b=1gNZPNzg; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); 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=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbjC3VtU (ORCPT + 99 others); Thu, 30 Mar 2023 17:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjC3VtS (ORCPT ); Thu, 30 Mar 2023 17:49:18 -0400 Received: from MW2PR02CU001-vft-obe.outbound.protection.outlook.com (mail-westus2azon11012008.outbound.protection.outlook.com [52.101.48.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4625C173; Thu, 30 Mar 2023 14:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mVETcXAx5qbI4AlRsB5QdmJ7uE55on40p+z9LvU/FToCI/EkBu7dQ/K7atJE+rYp3a670CjAbY322qJ787y7mO7MjXha7ZWH+wRPco0z470/4WgA/A1Ke9q65pIRh72HgrbOrVfLuZfE3ZFyU4PZwQDc5Zv8KWfD5iqLSDaG/5mU95F/94n3BFPa/zA6Y0f2caihFkVkDbV/s3tPkPloAw1myg7pOyVdY0KGBrDTfnp7zIYglLQAPZUXdf4ahQpxKJRcaS9CwmhDUITJFzKkcUtOWPx6lQcMOgSjjkHYS8FWLgB4NfWOplE9gh8fBp4Xtk5BzF1WK4QxaptHLXyJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YzSfgg5QiGHaZ4BhMDOAFKS8HSIAVGmIcVRIO5rctVE=; b=mBvkCf845lzsPShNzvysLGg9tphvYddVPk2BgAWHSNDhCfWqQZUgY5rztcPR+xH5Eyqao6yQQzz5R9cFcn0Yk85U4olKaUIpAaj87kmZZ3N/EQq4bENxLq6W9gxEj/Jaq9xUbgHfjlXPaMkVGZ7/ve1YErWLCqBrUG4FdoFXT8hSF1iDmZCZRhO7ixV4nVfO1ZE5xGTYySB2EOH4l3H8J0jVX7/1woVeJluwPh+E571cD2rlFvzGl53bT2p6D6j8vA9uV2cULhk6rz6CIrKnttgDpbA0vvW4oSu/F841yIF+s8O6XTL9UlP50nTxr8RmvT5qj7ajPDvQAgCifnLZTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YzSfgg5QiGHaZ4BhMDOAFKS8HSIAVGmIcVRIO5rctVE=; b=1gNZPNzgWhvLQutMTJrFMrBroYuZ/hW7bEjtiJ3kr0Iqztdb+buxEE18w3siiNlZ1BQKTt/G+hIApovn8TFeSC3JJTIGyyo5bD5U1rQ8rPx1LvRD9aUfgwsNlrWIAkCz5kFN0SQ9MJVSR0rWlG5JkCSPE3CdDVhGrYHseRKj1Ns= Received: from BYAPR05MB3960.namprd05.prod.outlook.com (2603:10b6:a02:88::12) by SN4PR0501MB3885.namprd05.prod.outlook.com (2603:10b6:803:44::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.33; Thu, 30 Mar 2023 21:49:12 +0000 Received: from BYAPR05MB3960.namprd05.prod.outlook.com ([fe80::8cb8:9578:d0c0:83d3]) by BYAPR05MB3960.namprd05.prod.outlook.com ([fe80::8cb8:9578:d0c0:83d3%7]) with mapi id 15.20.6222.035; Thu, 30 Mar 2023 21:49:12 +0000 From: Vishnu Dasa To: Arseniy Krasnov CC: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bobby Eshleman , Bryan Tan , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel@sberdevices.ru" , "oxffffaa@gmail.com" , Pv-drivers Subject: Re: [RFC PATCH v3 2/4] vsock/vmci: convert VMCI error code to -ENOMEM on receive Thread-Topic: [RFC PATCH v3 2/4] vsock/vmci: convert VMCI error code to -ENOMEM on receive Thread-Index: AQHZY0Sj2XCJ41BR6k66SiCaGaLi868TwxQAgAAZQ4A= Date: Thu, 30 Mar 2023 21:49:12 +0000 Message-ID: References: <4d34fac8-7170-5a3e-5043-42a9f7e4b5b3@sberdevices.ru> <9fd06ca5-ace9-251d-34af-aca4db9c3ee0@sberdevices.ru> In-Reply-To: <9fd06ca5-ace9-251d-34af-aca4db9c3ee0@sberdevices.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR05MB3960:EE_|SN4PR0501MB3885:EE_ x-ms-office365-filtering-correlation-id: 0241472e-c164-496a-9c6f-08db3168997e x-ld-processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 307uygRGKp1UaJZOZHfe0vRRwBgqf/mpIgRtOfd7W0yS34kpcU+trxBl4N3hV+7TPY0YAgzkhQlRTDIDh39ivtP/9vfteSWFzwaEbG3H3fVnTy7liykM6/6LwhII0BL+oh5WpRgEJWMm1hktNpCjLooeEGQOxXSxxKdeJWdUck8WB8K5mjCbt/d2VzjgZebCRsHf8h9J55gA9aq/8fGEWOah1nUjDzA8lLwIXdXZzRP+dl8ckhslqQsnF56sP5m5x8OXmI5oIdmCGvnap/FiTKjWRSCZMG6ingkmdpf4SCc7wA370Ut4uzPYbrqxxpvbsZDwmkmQoXJFtMy6BFS3ou6xm0VxNMRO5SUkDUjrCS91xbr/QfMQtdJwcZKhBx2dgDNBuVkLMlVCU5+Nn+S1AwuELOhWlQKQ0WNTnQ1Z5gFTcyHCGfAxL7vER/832Xrd3Cwl6J+kqaqqr68/BBZ0Y3OpTgI6N8FrmreGH//HweQ03/9m0QX1SgjNk3RRpY7p2drLwY4E0YFG64VH7V+Pi3snFAS9yRzWbGzR3+RgHgEx+BmkMMySMKG8TGwxu560x2awGImOIuyyFkKUUvc/EeDppD/Pmc5JCaqOtLy4cRWYkaNtCrkBon5F2I2cu/ByAQUg0b5H6vu+nfWzd1/xhA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR05MB3960.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(136003)(366004)(396003)(451199021)(38070700005)(86362001)(7416002)(36756003)(83380400001)(53546011)(33656002)(2616005)(5660300002)(186003)(122000001)(8936002)(2906002)(6512007)(107886003)(6506007)(6486002)(71200400001)(41300700001)(4326008)(6916009)(66946007)(38100700002)(54906003)(316002)(76116006)(64756008)(8676002)(66446008)(478600001)(66476007)(66556008)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hff6RxoN0jvfRuPk1WS8cm3OL2lU1TAD0V1/yiiNJysj418BkL3AlmxIl8WG?= =?us-ascii?Q?VuVUWFluuU/QtP4fPfHAj7D5xs1gmg5k7LMpPr0nM6a/Sq37pNyZqv4cJjel?= =?us-ascii?Q?IGcactGidOCkLuNV1JeONUAloBFXsuR8M9buWWrErYL2s3BI9EG+NdgK4w+j?= =?us-ascii?Q?gO/u0rmkFSKpYpfdqR22qeMg5U4HxON8WPMw3BYI/2mQMcQ6v/p36z4iRPGt?= =?us-ascii?Q?Wn7OkSfgvDeJpXZr7Dr3VFx0Fo8UwYDyHuO2fqMDf+DiucIU2PBseGlJKYJQ?= =?us-ascii?Q?ndghNbK5/nKO8wNevUtNKtx1/MXpPKSvAMatDnfXK9fnsxIQrL2Im43jBtdf?= =?us-ascii?Q?zSD8gx3ky1lXlOZ6H8hQqykEIhpSQjfi2xhx/lBp0ytnXR1lQqIE5fWGV483?= =?us-ascii?Q?+5HdRh3tv2arEno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Kx5jgfFe?= =?us-ascii?Q?2OePr9/XU3721mxtP6+ANR0dWS15vyi65y2u6HlxiQA3YuqngFWwW4jYR/8Z?= =?us-ascii?Q?aT9EragZzHbIALf15zH0eNdg2dtUWldK171lE1SsaGekvwRqOJmGQb3iHDEO?= =?us-ascii?Q?cJwe6waGUtJb7UDHSlTsKlST1A19DJ9DPK6Cdj4Fes7qxEsHg+jCoBt8wo4W?= =?us-ascii?Q?HmGX04Yx9EA0F/GWvclEVd9/pscN4vhWnsdmq8Q6RymtkIFeQTl8yM7H7Rbx?= =?us-ascii?Q?D1bgolC+F/ERzYcLoM9ruCD7Yn2IBOBw8Or9fJU/FgKi7kihV3dEmNifN/GC?= =?us-ascii?Q?b+2+C3SCqB6j/7/7454II4mPkh4nmggTLTFfxN3jTYxL?= Content-Type: text/plain; charset="us-ascii" Content-ID: <498EA72511E78B44B30020065927A9BB@namprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB3960.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0241472e-c164-496a-9c6f-08db3168997e X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2023 21:49:12.4038 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CUfRSDBZBBWNAFJurx6q5xdoUA6SMr4KAyop6RR+uhLqVBFui+C1RmIKgBsk72Kmb+99pNzqLeL3QBhldx0kfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0501MB3885 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE 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 Mar 30, 2023, at 1:18 PM, Arseniy Krasnov w= rote: >=20 > !! External Email >=20 > 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. >=20 > @Stefano, I have some doubts about this commit message, as it says "... a= f_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 patche= s > are in a single patchset? >=20 > For patch 1 I think it is ok, as it fixes current implementation. >=20 > Thanks, Arseniy >=20 >>=20 >> Signed-off-by: Arseniy Krasnov Code change looks good to me. Will let you figure out the commit message with Stefano. Thanks! Reviewed-by: Vishnu Dasa >> --- >> net/vmw_vsock/vmci_transport.c | 11 +++++++++-- >> 1 file changed, 9 insertions(+), 2 deletions(-) >>=20 >> diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transpo= rt.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 =3D vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg, len,= 0); >> else >> - return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len,= 0); >> + err =3D vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg, len= , 0); >> + >> + if (err < 0) >> + err =3D -ENOMEM; >> + >> + return err; >> } >>=20 >> static ssize_t vmci_transport_stream_enqueue( >=20 > !! External Email: This email originated from outside of the organization= . Do not click links or open attachments unless you recognize the sender.