From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH] ethdev: filter destroy event before probed Date: Wed, 24 Oct 2018 15:12:32 +0200 Message-ID: <20181024131232.6146-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org To: Ferruh Yigit , Andrew Rybchenko 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) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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