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 DA40BA04C0; Mon, 28 Sep 2020 01:46:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BD561D62C; Mon, 28 Sep 2020 01:43:42 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 7C3291D61F for ; Mon, 28 Sep 2020 01:43:30 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 2F86A5C00FD; Sun, 27 Sep 2020 19:43:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 27 Sep 2020 19:43:29 -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=5cxgRRPYTImW9 uS5WE2n6jx+FpnspQToNrc1Zm3Ur7k=; b=F3RSWtoPLWZXBpCXeEKsMNE06Wey7 cs67cUuwJE0mXXR4ifYRZaoU2IWqjhl9FEzFFkkwn0uY4lQFpO/jcxvHUzCAVnkL 7TC4hxxtY5DBZa4siyqwjLdWgmINpi5LJDQyIZldFAEkBuxcDbNLZ6vdMr20g0on Y1Y5MaZ6K3CZ8MxX9cLuS7/M0SmdWjAIAdbztjuf7+mfKxWBFUsI3MnXxso+cAyL +rDc/Qk5+jCPzI5FT7erjEbulAEeRAL/h72uA9QlNDhgxWPRIuWBTBfaA/Ej24Hm QuFejlZLvhVC1+XuLs0IoA1AXbwmRqt/DCAY5PhRFaGdoMMGBgqdOJqCQ== 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=5cxgRRPYTImW9uS5WE2n6jx+FpnspQToNrc1Zm3Ur7k=; b=oSnwOdQj AhMDq3BoHlvHPgYWqjOsjmDr3qn2DVz+Tr3918EIjzxjy0bAqjqviYYvWrwUpMqH 4wNJO3jca2PB/7nwjddwNt2TlBoKuRQyuIW+RkPgP4Wesqs1wagUzSJqHiAu45rS 3Mj08UoaaYMGwRnOXkQgWhT4BiOuzaMiw1ygtBaFj/yCt18uivrQkLmDHIwhGoR/ 946cjiYD5hxQHrp/BJzIc740ysBw6d9qMbiU4S+vzf0RPDPe06vIaXP9OQ3cHBpp 9f2EydTgfR6A3D3ygaWE9L6lD4NFdQUIXs9ZB9maDk9WjKxMxfi5xHBzMNkOb/YC XkMez7pS4Cu17A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehgddvhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepuddtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 613603280060; Sun, 27 Sep 2020 19:43:28 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, arybchenko@solarflare.com, Matan Azrad , Shahaf Shuler Date: Mon, 28 Sep 2020 01:42:33 +0200 Message-Id: <20200927234249.3198780-10-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200927234249.3198780-1-thomas@monjalon.net> References: <20200913220711.3768597-1-thomas@monjalon.net> <20200927234249.3198780-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 09/25] net/mlx4: 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" The flag RTE_ETH_DEV_CLOSE_REMOVE is set so all port resources can be freed by rte_eth_dev_close(). Signed-off-by: Thomas Monjalon --- drivers/net/mlx4/mlx4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index df59314b66..ad7c805d67 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -400,6 +400,8 @@ mlx4_dev_close(struct rte_eth_dev *dev) MLX4_ASSERT(priv->ctx == NULL); mlx4_intr_uninstall(priv); memset(priv, 0, sizeof(*priv)); + /* mac_addrs must not be freed because part of dev_private */ + dev->data->mac_addrs = NULL; return 0; } @@ -1025,6 +1027,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) ERROR("can not allocate rte ethdev"); goto port_error; } + eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; eth_dev->data->dev_private = priv; eth_dev->data->mac_addrs = priv->mac; eth_dev->device = &pci_dev->device; -- 2.28.0