From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v6 4/6] ethdev: adjust APIs removal error report Date: Sat, 20 Jan 2018 21:28:33 +0100 Message-ID: <1624152.X7h7I9Omfq@xps> References: <1516220357-13013-1-git-send-email-matan@mellanox.com> <3230393.d19WHEAjBn@xps> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Ferruh Yigit , "Ananyev, Konstantin" , "dev@dpdk.org" , Adrien Mazarguil , Gaetan Rivet , Andrew Rybchenko , Alejandro Lucero , Jerin Jacob , Hemant Agrawal , Shahaf Shuler , Olivier MATZ , "Zhang, Helin" To: Matan Azrad Return-path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 710182904 for ; Sat, 20 Jan 2018 21:29:09 +0100 (CET) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 20/01/2018 20:04, Matan Azrad: > Konstantin wrote in another thread: > >+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0); > >+ > >+ dev = &rte_eth_devices[port_id]; > >+ > >+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->is_removed, 0); > > > I'd says these 2 checks have to be swapped. > > Konstantin, Please explain why. I think he was talking about these 2 tests: + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->is_removed, 0); + if (dev->state == RTE_ETH_DEV_REMOVED) + return 1;