From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40053.outbound.protection.outlook.com [40.107.4.53]) by dpdk.org (Postfix) with ESMTP id EB0513DC for ; Sun, 26 Aug 2018 09:49:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RltxyW1JkeQkb9ubYmDi0meYRtND/lKQR7FPMlrHgwU=; b=vKEc44hzigjAXsR1bWhX8kgnSCjAUEW/KVQFIB9iSFk9lBvCI49z8/5AQkeUjfFSZfJahr5u56qhc67k/0/LOT5/7C0Z/79avKVJYGQ3CZ2w0iE8h2H4C/UQ/Z+s/N+dDQZI1+J/aOosWjjBcbcjTakDR8POWU0xJBHb6RvaAG0= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.41.11) by AM0PR0502MB3922.eurprd05.prod.outlook.com (52.133.48.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Sun, 26 Aug 2018 07:49:53 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::88fa:4498:85a5:9e5a]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::88fa:4498:85a5:9e5a%3]) with mapi id 15.20.1080.015; Sun, 26 Aug 2018 07:49:53 +0000 From: Matan Azrad To: Stephen Hemminger CC: "dev@dpdk.org" , Stephen Hemminger Thread-Topic: [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool Thread-Index: AQHUNbKq3SjE2Sv8E0Sncjc15GRqW6TKAXNwgABUTACAAArOAIAALmeAgAcnmyA= Date: Sun, 26 Aug 2018 07:49:53 +0000 Message-ID: References: <20180814001926.19630-1-stephen@networkplumber.org> <20180816224409.5719-1-stephen@networkplumber.org> <20180816224409.5719-3-stephen@networkplumber.org> <20180821080644.306bba69@xeon-e3> <20180821113129.6e7e680e@xeon-e3> In-Reply-To: <20180821113129.6e7e680e@xeon-e3> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB3922; 6:8ATif0835zN+oobAQaRIZI8EWgP1erSWgom2jQZmDwpu8u6me1DlloM371AcRaWi/Y+1KS/GcASOqf0OV26mMTFyC8FykRDXl1uHUT5NKQxNry6FPqy7f607xO1tOO4ykKIkxXRVPdnYGdX6KhDmoXMXUgbSsXbAUMOJvsE+AitZF7fEAFNGT9ayfUh1bEeFWVvOLwjvlTMSXi79RbLxey9q4Oc3rRkedjj7RAAQgWewXreiU3RMAUpDQ6+XaJgSCBP64LhQ5KzOHXlM+axJL/HWssuW7bKyCdckpbofa3wVZDIIyuS5tUFk2FeoF5XQ3SvM0Yk1oOL81Mdt8AcThyYBaWAbwwQnGJMMGGk0iiFZ76KJYkRl3Ornp9oQbj/Yt0m1M6Rj0I2Dvje+8qr1MS/hXU9mrO+jLpzXelDJGldy2oYhhtEvvrYtK57Xraf2Y5hOB8NPBCPOiM7LD1Oo2A==; 5:rd44UOQmh6aQanJOurzcgXua8ISFbE38k2x/0wr/HiN0aASdEmedCC2Ima7sFHWAKygFfH95J+9BqU9bGDCvPbTwCTEFLkBjDFzVRvbxostrn+l2o/2hMIOly5iWGL06tMvp/gt26li2vGRazdXO2JJzGXPGbQMRfslsC5h4g2M=; 7:a2/U8Dn1zxOc5uUy+mppiBqkQJ3BNN18gBXTxJdJjYvA4pJCcTaqtJD4ZeTVH2GyPqy+tY52Tb3dOoh/+lnFHsLMnd+vMX2VrQBeoZjhpDzCQvDc/yl5sD7MAGUbtICTAihOb66NE07Z20MNaBWm/5dR+Mi+BKbCBTT2l48UZxnsm+gPetD1r3mIPwpMauLoqUJrwWEDeukES+uBgz4pYZWraZxUsnK//I4xumY+aMScX6dz99YOA++8SEZwpha+ x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: b001a5b1-bb61-4cb1-848d-08d60b2882a1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3922; x-ms-traffictypediagnostic: AM0PR0502MB3922: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM0PR0502MB3922; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3922; x-forefront-prvs: 0776C39A48 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(366004)(136003)(376002)(396003)(189003)(199004)(7736002)(55016002)(86362001)(66066001)(9686003)(476003)(478600001)(5250100002)(76176011)(6116002)(6246003)(316002)(33656002)(3846002)(8936002)(105586002)(2900100001)(106356001)(446003)(53936002)(102836004)(97736004)(6506007)(11346002)(6436002)(81156014)(256004)(6916009)(486006)(99286004)(93886005)(305945005)(26005)(2906002)(74316002)(229853002)(68736007)(81166006)(54906003)(8676002)(186003)(14454004)(5660300001)(4326008)(25786009)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3922; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: hulGQUsN/BKxk772wRjPG5U/VChIk7N5ClxGhirOKVghKHay5ZsRWkoq67iXOgLtNF8gfo2OPD0NRVHiYjIqME7CVQOeZr8mZddiX1ZzNrGyfi9dM6xoF+p92wxhJ6kFlpnZJchyJgMpLZ3AyVSy+LurAamkx1OGd/2vetTy779z3djIDy+6b3NfuTtALsmktGaV1I8/mqnkkIrR9aFqCF58P3g6rS0MynJFE0Ugyq123jS0Igt9tVuwgZ6/ts9q6En0n+NvKiEB/1XBSWtbvIvRFyi3b0NjDIh4k6tdK6GKdOw0H+FN3ZHgoi9SnAt0YDL55gm5YyXlx+pUUeKsO2i1k0VIUOgFfJjqBDuMjkw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b001a5b1-bb61-4cb1-848d-08d60b2882a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2018 07:49:53.6943 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3922 Subject: Re: [dpdk-dev] [PATCH 2/2] ethdev: make rte_eth_is_valid_owner_id return bool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2018 07:49:55 -0000 From: Stephen Hemminger=20 > On Tue, 21 Aug 2018 15:48:19 +0000 > Matan Azrad wrote: >=20 > > Hi > > > > From: Stephen Hemminger > > > On Tue, 21 Aug 2018 10:20:43 +0000 > > > Matan Azrad wrote: > > > > > > > From: Stephen Hemminger > > > > > Function is boolean so use that. > > > > > > > > Ethdev is not using bool type, see also: > > > > rte_eth_dev_is_valid_port > > > > rte_eth_dev_is_removed > > > > rte_eth_dev_pool_ops_supported > > > > > > > > I think it should be a full solution to all. > > > > > > > > > Signed-off-by: Stephen Hemminger > > > > > > I didn't want change type of visible (exported by ABI) functions. > > > > > Since ethdev now is not using bool type I think it's better not to chan= ge it > only for this API. >=20 > I hate to pick nits but there is already a bool usage in internal functio= n (static) > in ethdev. >=20 >=20 > static bool > is_allocated(const struct rte_eth_dev *ethdev) { > return ethdev->data->name[0] !=3D '\0'; > } >=20 > Using bool functions doesn't really generate different code. It is is mor= e > about using modern C conventions. Agree, but I think it should be the same API at least as rte_eth_dev_is_va= lid_port, just for ethdev convention. Let's give to the maintainer the decision.