From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9AF21A0548; Thu, 2 Dec 2021 14:01:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 552B440692; Thu, 2 Dec 2021 14:01:32 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id D64EA4067B; Thu, 2 Dec 2021 14:01:30 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10185"; a="223933769" X-IronPort-AV: E=Sophos;i="5.87,282,1631602800"; d="scan'208";a="223933769" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2021 05:01:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,282,1631602800"; d="scan'208";a="609968107" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga004.jf.intel.com with ESMTP; 02 Dec 2021 05:01:29 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 2 Dec 2021 05:01:29 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 2 Dec 2021 05:01:29 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.109) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 2 Dec 2021 05:01:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IlgCXbrUDBXJBVqUOigwvQMh4712slpd+S1WVeBuOtJSL91xNZXzPVpc77MQGyLZWFLx3PExCQs5xNqRETnt9RRcVQ+htPmGTvcL5HbpcSjrPRY9zCEIk+fL4TnfhIX0hd2xbNO+xjlwmGCd8mrBuItUh3i3C7EImgoKFZWw/ncJpnm+juPpP8x6tb91Q4NToq4j1iq2cWzOvoZyl//zOD1L2/G4X7FrmRJApsSnt7zBekZ6y1NQhp6k5KtIFo/tW11AxD8Jm86XFpXtDTumrJZbyb783voqq5wGgZH26FM8+uuVNAjvSNngtSjfb9kfJ+zpdsNgx67YaxBewb8c2Q== 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=oGL20SjGWToCqdB4XTWJK1/xD/oQtkOhRYTL811rZqI=; b=bqUE5QLW/iplyhcW9ddDS3vPzAwYdzWlnQdzMCqGruAgfphjPSny6V8BJDXofY7SOYQ8lh3O9imowMoRyGzbSUal9CRIUtmEg0c8hqlRPLPNMA5puDPESXzC9K6et7WrzGxsaNjw81qIFOwzRi2WQRq3ZK+u7QpMpAGUg0nhsQTndX1DXgXsCkUEWxqLaCHWp8+g1U9DXx6HFdOpB/IAUViAf2dyhwwFdP1SBgZRJ+YP+PmNw6RL/YegvpmKl/XosY8UzKLhiGDUaH6web9dNAzVKjN5H5EFsNqDFQ54EoCvljMbtHqgokPpyJmIXxf1yRlOu7DFV8EzGj8MFYrskQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oGL20SjGWToCqdB4XTWJK1/xD/oQtkOhRYTL811rZqI=; b=om/qz9Rn+de4sjsjlepsXS6pjQi1Joj8XiGFTYFoBWEUZVFe55x09gQ9F0NotPPYu0Iw13FZpxMQbCVOtYy2W9apadXeFe6JVQ+6/JYGKV5EZwRjQCCSwQGL3gN5wOqMw4NM5CLWOLomGMgMkN2Wh+jHu013aO2fyd1ILgF13Xk= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3129.namprd11.prod.outlook.com (2603:10b6:5:65::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.24; Thu, 2 Dec 2021 13:01:26 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::58c3:2c1c:6922:306e]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::58c3:2c1c:6922:306e%3]) with mapi id 15.20.4755.016; Thu, 2 Dec 2021 13:01:26 +0000 From: "Ananyev, Konstantin" To: =?iso-8859-1?Q?Morten_Br=F8rup?= , "Thomas Monjalon" , Tyler Retzlaff , "Richardson, Bruce" CC: "techboard@dpdk.org" , "dev@dpdk.org" , Andrew Rybchenko , David Marchand , "Yigit, Ferruh" Subject: RE: [PATCH v1] gpudev: return EINVAL if invalid input pointer for free and unregister Thread-Topic: [PATCH v1] gpudev: return EINVAL if invalid input pointer for free and unregister Thread-Index: AQHX3G4EdhDcLThKtEqIWzyJTUtRGqwJulSAgADeAwCAAAZHAIAIWNsAgAALPgCACzvMgIAAolgAgABYBICAAAcRYA== Date: Thu, 2 Dec 2021 13:01:26 +0000 Message-ID: References: <20211118192802.23955-1-eagostini@nvidia.com> <20211201213749.GA5097@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <3625450.hdfAi7Kttb@thomas> <98CBD80474FA8B44BF855DF32C47DC35D86D33@smartserver.smartshare.dk> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D86D33@smartserver.smartshare.dk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 94e16dc7-f61e-4618-04df-08d9b593d995 x-ms-traffictypediagnostic: DM6PR11MB3129: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 32NehGDOpH4lW+kVu7mNAVhMihrYCwcGuQMLqkyO1o//hxk8Zr1DBoZBgmdqjuIaMEsfx7s0HvbWZXrZ9i9vmFUHG22xxuddb/Uv66CahP5ko4g0gJ7rEEY/J+7VBwwQiXDo7DRWzXdiC4qP3PhaGe715Z9fXtW3rPCZeYun+vaodjJMxlymFXfW3/kWlwINsuvSiV/BJ/rqyi0U6mpwJVI1eMefvguc0/Sqh4PY+ZXYL8+dNfAbBunFpXbPkiWdAGT0RK0FRicOB8++Fv/pUGD8UR0g0d0CAvsuSqwMNeyMcVnBvEgjrfq/bvP06oQoxS/KYLK8hDPdPf9No2zs4eKp/KoyJ7DXjN8TieC7qfIQNpobz5rc0XCUIFYqUVJDq9+d37qEyOryAjDw6VZHl+Foh4UAGefvUkZIEjJWzUGFuxftRa+Gr3x/xB3FKtVW/A+kF5kAv6RydBoQbnJ+G8r6j2dp+PLAP3q24HXUqp9++3mgwZSVhsJFDnBxzlB/xuEXwrMr9w0KFXlJ47ijiS20Vg4f0ETRWAUwzDO5+bGiz2B1/uIL6u+PeCXwvS7NMxwOdt/mk3iWll7/+x6fT/tjcrgow8kGwwIQ03t5h41edUcHTOliZfhkDVrLLarT9qPCXih4GF7izl7oBtQuDKU7lRBZ/AYYfwuZJMjhpCYJQEa4DpAr3N0KXVoGJVN1wmxVeEC9Z3ozh0mOO0ehANVs3voFkZwVlnz8/U5QzPg= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(71200400001)(122000001)(8936002)(38070700005)(55016003)(83380400001)(6636002)(55236004)(186003)(508600001)(82960400001)(107886003)(26005)(86362001)(2906002)(33656002)(4744005)(7696005)(66946007)(76116006)(5660300002)(66556008)(66476007)(9686003)(64756008)(66446008)(6506007)(4326008)(8676002)(52536014)(316002)(110136005)(38100700002)(54906003)(4533004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?30nQVGcTndwPan+QHCGMGr/N0CjVWbVAY1PwgyLyO82zZG7/ECTnjc7PSe?= =?iso-8859-1?Q?odMvt2VcbGWiAlsTmZvkN9f+h542Rxp1F0xCqSM17tnMWkA8IfNkrgLBOq?= =?iso-8859-1?Q?ruxRWCXEFZK1T4sIC+nN+37crQ6kZCn34LIYybmWj8mq2e+X5OoFFJIc/M?= =?iso-8859-1?Q?FbySD7pvV3ZGqtKDfM54T3kxFxN5W8E41VIjwwBNYVoJ99mhZ6GdW5k2Ms?= =?iso-8859-1?Q?yarBmV3fWR3eJU78NhaA3Oer6oV9WQogd+I/wVeahqDFmzerbdmkSI9WG/?= =?iso-8859-1?Q?WTXXClvtHuwK8TO8DVIRcpqODII1mKvsAEyTCu6x6vdqN5YMR77id+NRnH?= =?iso-8859-1?Q?plJUXNKrDL8KZEErKQ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BqAy6dsZyE1Ln?= =?iso-8859-1?Q?EVT0yR+c6brCTQ+SxlAy03xkZ4zvCQi1zecAIyPn412d6b226fVE4HxFVl?= =?iso-8859-1?Q?Itb653AVPfcg1CyWbJyv6cZznkARdttgdVLBt8kgHChoRK/5TFQQTX/TC/?= =?iso-8859-1?Q?RZ0mjjGTXeETBfNn/UMtXGwfE6zsIovZWhUrSCI849Wqw1uVrHfNIUILGW?= =?iso-8859-1?Q?5Y93CX8Gk9V/gXKkApyerWJi81atlQpRXmUZ/Wx4/pCrxh4n5cv9o5xqDu?= =?iso-8859-1?Q?OTjTYk8CayE4IfmzV4iE0qbA+IOOsXTvGt15Y5l+noWaAYcfEX/mW+0AkS?= =?iso-8859-1?Q?nKh4I2/fbIHvorYMGD/qDpsaqB3InIFTtYR8IsIfSFlpFOipmnY/Mzbjjt?= =?iso-8859-1?Q?iNUB3cQZE0aUf7bPJhHbVQPVc6NEEilNXnAAukKBel/RLgs9zAChN4OAnU?= =?iso-8859-1?Q?j99/kTBaVRDECjsO5/lxT8llL1jRMzxbOdJZ4gBAlATCPoDGxWyB/JL1Ou?= =?iso-8859-1?Q?cXNA=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94e16dc7-f61e-4618-04df-08d9b593d995 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2021 13:01:26.3248 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +n6/adqtrMqUXVDlJgfl7C4OAodMrqafMoaT49t3jLLvFM+aQ+AL4t5DBA3JJqAbU7ZAz1gY6ih1DIvRtnkFzCeRG7ysMyYk1xIZCVnEQIU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3129 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Thursday, 2 December 2021 08.19 > > > > 01/12/2021 22:37, Tyler Retzlaff: > > > On Wed, Nov 24, 2021 at 06:04:56PM +0000, Bruce Richardson wrote: > > > > if (ret < 0 && rte_errno =3D=3D EAGAIN) > > > > > > i only urge that this be explicit as opposed to a range i.e. ret =3D= =3D - > > 1 > > > preferred over ret < 0 > > > > I don't understand why you think it is important to limit return value > > to -1. > > Why "if (ret =3D=3D -1)" is better than "if (ret < 0)" ? >=20 > Speaking for myself: >=20 > For clarity. It leaves no doubt that "it failed" is represented by the re= turn value -1, and that the function does not return errno values such as > -EINVAL. >=20 But why '< 0' gives you less clarity? Negative value means failure - seems perfectly clear to me.