From patchwork Thu Oct 18 00:19:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 47006 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 076905F51; Thu, 18 Oct 2018 02:20:23 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 8094D5F44 for ; Thu, 18 Oct 2018 02:20:21 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E8E5721B36; Wed, 17 Oct 2018 20:20:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 17 Oct 2018 20:20:20 -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=+o83ooeDZTzSUvUqvY2dg84 BvcFA0I6GjW7atqZYOKE=; b=plZ1w/3IV/fUbmqSRhT6wtwVoXx1t7U611ftOAJ OpwexCdoLo9ko0OsQNfKbVZ42oTqQ3XtwgUuZOVOzQH1c0ljGjNuGrKREy3NxMUy vMGi6sllmc5Qg4QXMQkbUbT0HFX1R01NrMOplSmHFTzmSl9bsd5rxqap8DiMHLDk rkXE= 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=+o83ooeDZTzSUvUqv Y2dg84BvcFA0I6GjW7atqZYOKE=; b=Ai9K8cCODh26ax3vCyEBOlPqqsIn59IvP Wclm3rzqTHu2vwdfeDa8kvQm5VUPCHd0Y8RNTOUVVbX8MqT5dIwYlmzYbO3f9IcE fOJDZBavXa/WlZtDq+ovrI91kjveEJ1DGDOcHiJ9FXKWE6LHDMamkRiYdA0l1BFJ oBa3650e+ZYe/qjCK7X/LUTpxRFlmz9oA+avTL1RNLaelMv62ahITTggSqGOTnp1 jwDoHTxYG3bv7YVebz3rBYtLmx6ltSiEaOY4CzUO6IVRlvjkNo2TsGpr10zo99vN /wHe4BdQsGbg0J7zGJ2uJ27UhA5fMIoKKOtQ7LbMAvlTpwiKMOOTw== 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 7AE5AE4680; Wed, 17 Oct 2018 20:20:19 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: gaetan.rivet@6wind.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, wisamm@mellanox.com, ophirmu@mellanox.com Date: Thu, 18 Oct 2018 02:19:49 +0200 Message-Id: <20181018001949.17443-1-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] devargs: fix freeing during device removal 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" After calling unplug function of a bus, the device is expected to be freed. It is too late for getting devargs to remove. Anyway, the buses which implement unplug are already freeing the devargs, except the PCI bus. So the call to rte_devargs_remove() is removed from EAL and added in PCI. Fixes: 2effa126fbd8 ("devargs: simplify parameters of removal function") Signed-off-by: Thomas Monjalon --- drivers/bus/pci/pci_common.c | 1 + lib/librte_eal/common/eal_common_dev.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 41f8fc27e..feb79803c 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -522,6 +522,7 @@ pci_unplug(struct rte_device *dev) ret = rte_pci_detach_dev(pdev); if (ret == 0) { rte_pci_remove_device(pdev); + rte_devargs_remove(dev->devargs); free(pdev); } return ret; diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index 0c873bfe0..8b0844af1 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -372,8 +372,6 @@ local_dev_remove(struct rte_device *dev) return ret; } - rte_devargs_remove(dev->devargs); - return 0; }