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 48B8D91 for ; Wed, 24 Oct 2018 15:12:42 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9CDEB21F60; Wed, 24 Oct 2018 09:12:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 24 Oct 2018 09:12:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=mesmtp; bh=hb2KvF7nhQrhtymXkYYpGV1 eZJ4+Vmu3PnmezaK8jp8=; b=jcIJF1JF5dBZ0tGmzHkMa5ICoEyV0zlaGYNX5rb uFoUHrDEc1kQp4LXeCIsrJy9tObHZ3UD0mxz/vG8nE2Iraex1iGZ7KF36MSE0laN dRdoEo7sXBD8S5SgbCXxqPKNEyQ7sglVXMHbX7D5KN07Gc0MVyTcb13Il6ToROoT xQkk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hb2KvF7nhQrhtymXk YYpGV1eZJ4+Vmu3PnmezaK8jp8=; b=gxggsS70LgDVsXw7h7I8JMDOZSon6C9uS 7a0InRpBiw/IgVRwLcnbKldwJpRux6ph+oTn4o6+onyYXhB6Mcri+21yyA0KQ2GC DtkPhyEcrbuTqeLqomna/806tlvTAMDVbFwuJCAwEm6ovC8CFXt3c3acB6uAXmfU IgCo22KZvp94ejRJp00vu62jV8TNOufpcINSauCsdh/vMUTYla/5sHJX1xTMHu16 riS//2USh8IOiKUB3oGDe1Gbz6xsgY4e2qQ+z9rZfoXR3c2itJJWVs5xPxrzXAPe xvOKbsi3wxw+IDfvRZktp6zqdVG+kNtq4J7We6DdSrYcdJACVFofQ== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 80D80102FC; Wed, 24 Oct 2018 09:12:40 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit , Andrew Rybchenko Cc: dev@dpdk.org Date: Wed, 24 Oct 2018 15:12:32 +0200 Message-Id: <20181024131232.6146-1-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] ethdev: filter destroy event before probed 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, 24 Oct 2018 13:12:42 -0000 If a port is being created and rollbacked because of an error, the event RTE_ETH_EVENT_DESTROY should not be sent. It makes no sense to receive a destroy event for a port which was not yet announced via RTE_ETH_EVENT_NEW. Signed-off-by: Thomas Monjalon --- lib/librte_ethdev/rte_ethdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 1c04f95ea..9c7d82575 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -512,7 +512,9 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev) rte_eth_dev_shared_data_prepare(); - _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL); + if (eth_dev->state != RTE_ETH_DEV_UNUSED) + _rte_eth_dev_callback_process(eth_dev, + RTE_ETH_EVENT_DESTROY, NULL); rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock); -- 2.19.0