From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0049.outbound.protection.outlook.com [104.47.0.49]) by dpdk.org (Postfix) with ESMTP id CAE321B018 for ; Tue, 19 Dec 2017 18:24:36 +0100 (CET) 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; bh=Gxwe1nfcEDxLjEtTpEmezQ84HFu9Ob08DypnzoV9SrI=; b=sDHWTKXfqZSOgL0LkCuyd7jSiompV1LpDuL5NSeuQhtWBuWWW7sz7NMiM9lPPelJpnO5VAUn1dAWoI8cf8PYshDaELD7UjVLnZxcxSYlG65ff1i3Vn8pvIzaykkzi7dLx2YBizJvNLD0NL+yniZQT7h3K00Yn9JfRTTD5KLaxbA= Received: from HE1PR0502MB3659.eurprd05.prod.outlook.com (10.167.127.17) by HE1PR0502MB3659.eurprd05.prod.outlook.com (10.167.127.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 17:24:34 +0000 Received: from HE1PR0502MB3659.eurprd05.prod.outlook.com ([fe80::982e:2dce:9449:6891]) by HE1PR0502MB3659.eurprd05.prod.outlook.com ([fe80::982e:2dce:9449:6891%13]) with mapi id 15.20.0323.018; Tue, 19 Dec 2017 17:24:34 +0000 From: Matan Azrad To: Stephen Hemminger CC: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 1/6] ethdev: add devop to check removal status Thread-Index: AQHTeOxa+4DzZLX6/kqsmyHoz/yjVKNK6W6AgAAAfmA= Date: Tue, 19 Dec 2017 17:24:34 +0000 Message-ID: References: <1513175370-16583-1-git-send-email-matan@mellanox.com> <1513703415-29145-1-git-send-email-matan@mellanox.com> <1513703415-29145-2-git-send-email-matan@mellanox.com> <20171219092017.532d596f@xeon-e3> In-Reply-To: <20171219092017.532d596f@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; HE1PR0502MB3659; 6:4vVNA6XleUuoJWy8sejzJNqWUi2k+2MCo7tnP3/ACBEIuGPfE8/inf3L2hZriQ9sL4rtEnHYJFdIHaBRjpF4T8IVmhxGicGRsvGV7Qomkem3KmONSzAK/T5ybq9qpf+qD3lBhmTNkdqROqvZ7NXcWCaDLbgAHD1Q62TcROgL/GNFVzcc/F1JqK/EdBaCy0WlsjncWiKWvjlhufPCP3SzUIrWT40o1QGsw0APpEUvmxMFl1nvbD3aEGFw8T0Viw/3WoyhGnGSP66G20P5Fxd3KTKNzax7o6oTMM+oahttfY4ebPlBXrer8FSBT2YpYPyDsNG5Od45OOm7peRF0sn3sfGamAAWG/tXZnX6c3RDGM0=; 5:2TvF/tRQnrHJXmIZJOCiX7ZvU+oBaoJc/Zuz0zsTZc06l00UGCA2pM4fm3HV3G/4TqVokLU7JeVbxcuOfl4R27CCdMu2WKh6FW0MJTWzivTl/PWa1vhP+9UZ6noFjfrN8VtxRxxj64WHMcAO9CAJhGJkCKlg0YnFoOvGE+upppg=; 24:eTZ/gB8Wxo8TtaFUTSaDmTqHJPxeuSyerLEnbgxnoYmJM+tYdUS4x+IKq1PnR7QVLL9hknQ0wwhqTU1RfcAlJeTXivX4applzv80rh8twpo=; 7:KDpu4rP+V9WbaoFfbvnVaxDfazOHNGDzy7K8+xY5JHTE1wT1KiMo5yo1RXPLhRfXJVt/ct1jTdFvFfMB0pqvYZ18hG8KdT2yuDbwtRfjlc+0PSVK+F/Ku0U2MGjnbhy48ZUqdVC0YgDSnKkVKDfPaFcKlXXEw/G+KsuGErXK3FXY+j6WF3n/43w2L3npne0uaNgVsHv+Uy/VbJKXdlIyuAWkQksoxtNRHnjGKKen2rdr3QOVFHeMXVilGrOqlqPo x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 8f7f241c-acbd-49cf-426e-08d547055f8c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:HE1PR0502MB3659; x-ms-traffictypediagnostic: HE1PR0502MB3659: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR0502MB3659; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3659; x-forefront-prvs: 052670E5A4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(346002)(39860400002)(376002)(76104003)(13464003)(189003)(199004)(24454002)(53936002)(6246003)(2900100001)(76176011)(7696005)(86362001)(33656002)(106356001)(81156014)(81166006)(8676002)(105586002)(2950100002)(6436002)(66066001)(55016002)(9686003)(229853002)(6916009)(4326008)(305945005)(14454004)(99286004)(5660300001)(7736002)(6116002)(102836003)(3846002)(74316002)(5250100002)(97736004)(478600001)(316002)(3280700002)(3660700001)(8936002)(2906002)(53546011)(6506007)(25786009)(54906003)(93886005)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3659; H:HE1PR0502MB3659.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) 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: 8f7f241c-acbd-49cf-426e-08d547055f8c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2017 17:24:34.5604 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3659 Subject: Re: [dpdk-dev] [PATCH v3 1/6] ethdev: add devop to check removal status 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: Tue, 19 Dec 2017 17:24:37 -0000 HI > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Tuesday, December 19, 2017 7:20 PM > To: Matan Azrad > Cc: Adrien Mazarguil ; Thomas Monjalon > ; Gaetan Rivet ; > dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 1/6] ethdev: add devop to check removal > status >=20 > On Tue, 19 Dec 2017 17:10:10 +0000 > Matan Azrad wrote: >=20 > > int > > +rte_eth_dev_is_removed(uint16_t port_id) { > > + struct rte_eth_dev *dev; > > + int ret; > > + > > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0); > > + > > + dev =3D &rte_eth_devices[port_id]; > > + > > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->is_removed, 0); > > + > > + if (dev->state =3D=3D RTE_ETH_DEV_REMOVED) > > + return 1; > > + > > + ret =3D dev->dev_ops->is_removed(dev); > > + if (ret !=3D 0) > > + dev->state =3D RTE_ETH_DEV_REMOVED; > > + > > + return ret; > > +} > > + >=20 > This looks good. > May be a candidate to use bool instead of int for return value? Yes, I thought about it but didn't see any precedence for bool usage in eth= dev APIs. Guys, what do you think?