From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 841A13256 for ; Wed, 21 Jun 2017 16:33:17 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 305A620BBA; Wed, 21 Jun 2017 10:33:17 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 21 Jun 2017 10:33:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=wmlxbMpHvr5cIMs rFfR1W99X3GqCwXAdQrtLi0hpkS8=; b=XQ9EKMbsTmpsZaUrboBCEu1LorBNptv 8kCk+1euJh3UoG4VGVxcHh5UIIQrmhvDQ50SL9/l7ybF+0adQmsLMmz1serxhv5f K4fcdOOrRWr9QlkEjuHjiT3uGXu335AxRyCAk39fWSjg/KFU90Tb5x4rmJx7WEsk McJajuDQ2Xdc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=wmlxbMpHvr5cIMsrFfR1W99X3GqCwXAdQrtLi0hpkS8=; b=EVxeAwTE OBAdrRzEOGfOByXFWZlvqpB4gLMBEjmTPwYcu/PGWlFqGQBJZ0k76YgSmuIlUGsj VU+fJOTCcJ1r0qgFKBsV3ApyMmFEG+hBd/oPuJiVVLT4FnsPih0jzYR0/JXk/9H8 HJRYC4JTPGN6qf1npB+wx+QCN2rua3mHCYhARBcnMnDl/KaVxuf/2eFMiTVHkLT0 4LV+gxI0SkSAJeUv8gFR/5V9R68njdHVUg4CLiKlUl+ByxkQ8BG9fOSbbyP/8y3U rUr8wTVUlkCpCkYL7jkme6wUrA4Wbx+9BVdehiYvHb0xKf91lWFbW9Qw0A3lvQn5 MY5f3wqFBDgsUw== X-ME-Sender: X-Sasl-enc: LkLrlK5CnTfbJwPToXCRcYBLgh8j2xnScwKddnBd2/HJ 1498055596 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id DB6662466C; Wed, 21 Jun 2017 10:33:16 -0400 (EDT) From: Thomas Monjalon To: Gaetan Rivet Cc: dev@dpdk.org, Jan Blunck Date: Wed, 21 Jun 2017 16:33:16 +0200 Message-ID: <10054764.rOKzhrIDPz@xps> In-Reply-To: <03c66edf68830f0a2172692e4aa994551b610df8.1497999601.git.gaetan.rivet@6wind.com> References: <03c66edf68830f0a2172692e4aa994551b610df8.1497999601.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 9/9] ethdev: use embedded rte_device to detach driver 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: Wed, 21 Jun 2017 14:33:17 -0000 21/06/2017 01:29, Gaetan Rivet: > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -354,26 +354,14 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id) > static int > rte_eth_dev_is_detachable(uint8_t port_id) > { > - uint32_t dev_flags; > + struct rte_eth_dev *dev; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); > > - switch (rte_eth_devices[port_id].data->kdrv) { > - case RTE_KDRV_IGB_UIO: > - case RTE_KDRV_UIO_GENERIC: > - case RTE_KDRV_NIC_UIO: > - case RTE_KDRV_NONE: > - case RTE_KDRV_VFIO: > - break; > - default: > - return -ENOTSUP; > - } > - dev_flags = rte_eth_devices[port_id].data->dev_flags; > - if ((dev_flags & RTE_ETH_DEV_DETACHABLE) && > - (!(dev_flags & RTE_ETH_DEV_BONDED_SLAVE))) > + dev = &rte_eth_devices[port_id]; > + if (dev->data->dev_flags & RTE_ETH_DEV_BONDED_SLAVE) > return 0; > - else > - return 1; > + return !!dev->device->devargs->bus->unplug; > } The changes in rte_eth_dev_is_detachable() deserves a separate commit. Are you removing RTE_ETH_DEV_DETACHABLE flag? I think this change cannot be done before implementing unplug in PCI.