From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 53A72A04C0; Tue, 29 Sep 2020 01:18:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 834FA1D937; Tue, 29 Sep 2020 01:15:25 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 6C9731D8FE for ; Tue, 29 Sep 2020 01:15:10 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 153505C01AC; Mon, 28 Sep 2020 19:15:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 28 Sep 2020 19:15:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=tgfyEpqxf7xkx 8+QlqiquTWGj25qKshckzjIyRLN0hU=; b=dhh+6j0BhBwwLzftYjFt6XpvPHyqV t3B1gT/M6WMu9Zb2+tFZxQ5YHBblMtB/Ku6wzmJ1yiCj4uxuawbT4zStpdRSHTZx Z+fOLdh92bHS4JARWcQLRkivhehaSNuoL/+nsOO/kSjcKyBU9CobT2owbboFvdWd e/6g35dsRWHkoaz25/CqXqm5O1AKimZQF6SWrJCB8ha23sCD8ZNgnnJtW7qcBdNa Y2/FFhaeGlPfafCr18UsS65+KNl77lNcoJj1TnSHDL7dsGeW/Ilpiz+QygkRfGVF jSsUegYLuwAWSVvYarrmi+kpVF5zIr+MJVnXOB6OlG344X1lIIS5BpIwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=tgfyEpqxf7xkx8+QlqiquTWGj25qKshckzjIyRLN0hU=; b=vbKTDQII wmA+gapTG7MZn/3zwG6BYAsZUcd4KrXAd4yyzt6gTQub154CrZEmOs1qxKGQ2lSh x7D/R9VIkJKj89cuHvDgaAxMgeGZiE0+EfMTmZ2c3e3EoBvArP74NcYoWBx9lMhk 37FZCY8Tphiz3P5ANEBLLrpRTm3uupU/qaGOpUtB+nnCXPK8mkzOLOL1opyaX+An dUpQjWqapimOM8x2iW1OXei7EIk7nMth8tohyTfr854U7Zznk+RHJprYNbUPdbPX q1SeFXgLpXOODmwS9CVDBqi5vGVIc6yh6Qm8OWf/rQ3iAexCYPm8oRXb34m/biKu kbOBKKYqP1RW1A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdejgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepkeenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth 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 1ACE13064684; Mon, 28 Sep 2020 19:15:09 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, arybchenko@solarflare.com, Sachin Saxena , Gagandeep Singh Date: Tue, 29 Sep 2020 01:14:18 +0200 Message-Id: <20200928231437.414489-11-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928231437.414489-1-thomas@monjalon.net> References: <20200913220711.3768597-1-thomas@monjalon.net> <20200928231437.414489-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 10/29] net/enetc: release port upon close 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" From: Sachin Saxena With removal of old close behavior, the private port resources must be released in the .dev_close callback. Freeing of port private resources is moved from the ".remove(device)" to the ".dev_close(port)" operation Signed-off-by: Sachin Saxena --- drivers/net/enetc/enetc_ethdev.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index bdb32762ce..afb658df3d 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -565,6 +565,9 @@ enetc_dev_close(struct rte_eth_dev *dev) } dev->data->nb_tx_queues = 0; + if (rte_eal_iova_mode() == RTE_IOVA_PA) + dpaax_iova_table_depopulate(); + return 0; } @@ -874,6 +877,7 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) eth_dev->dev_ops = &enetc_ops; eth_dev->rx_pkt_burst = &enetc_recv_pkts; eth_dev->tx_pkt_burst = &enetc_xmit_pkts; + eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; /* Retrieving and storing the HW base address of device */ hw->hw.reg = (void *)pci_dev->mem_resource[0].addr; @@ -916,14 +920,11 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) } static int -enetc_dev_uninit(struct rte_eth_dev *eth_dev __rte_unused) +enetc_dev_uninit(struct rte_eth_dev *eth_dev) { PMD_INIT_FUNC_TRACE(); - if (rte_eal_iova_mode() == RTE_IOVA_PA) - dpaax_iova_table_depopulate(); - - return 0; + return enetc_dev_close(eth_dev); } static int -- 2.28.0