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 7D0DCA04C0; Tue, 29 Sep 2020 01:20:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4C8801D9E3; Tue, 29 Sep 2020 01:15:52 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id DA28B1D906 for ; Tue, 29 Sep 2020 01:15:17 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 828FD5C00E5; Mon, 28 Sep 2020 19:15:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 28 Sep 2020 19:15:17 -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=ZGdyV2Ze+nG77fOvBjtneRpr7PQuf mwX5kBdqv9w7Mbvh6A3nXzT1kb9XT3rEbMsr/xrigaEqrcDFzEjBNvQWWUqGE8+v hH9uoTcw2bdJukAGXYJzfMtnU3qRR+Z1SfFdSP1coVpWxP5CzkzZTVaZfva6Rli7 x8kddXic39loMvqyOxF+y0YWsB/dP1rL62b+1rrX9TWqH66DxxGPqhA+w+rk+Kdu jwBESoxp0qkFS3vXovIxPQGJc20gVSmC37ERKN/ZKFctqagvyJy6Z0niXhA6S8vV MJA0Vc/kok9SqZ8mPdrbO1Yk2uP527Jy03sV7KcgctD+LSWvN3t+3jMBw== 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=p7YSzrLo iSP3+FE6n1Y0f1bVi7MY3y1zaiySD/hVi40DIc/66Mx+Z9A/KhFCBdARoMqa5wB1 Hq0r7Gv5utMVB1mL6CHLBHGyCqfnAkt5wZvcROr+AORQXiWOs8WesnwrQZHDRAiq yrK4sMBi/BNwAxVD46SeMWolcQOc9GsjQcmHV0R7jNyHxEnWgcGeq/2JPJJsxqeQ DkQ8Zu/0Sqcbdv6/4dY/qIPRZCnt12QQo9b6V9bLjkUWT8dBL65G0cxJap2CnVO4 tQ+XW6QAPsOwBEJasg+JjiZYWYGqVh1T5LssetGkD+Ty0w/YksuQE0iDMjfcHWxG /E8iPjN2/zBKBg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdejgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepudefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 925EA3064682; Mon, 28 Sep 2020 19:15:16 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, arybchenko@solarflare.com, Matan Azrad , Shahaf Shuler Date: Tue, 29 Sep 2020 01:14:20 +0200 Message-Id: <20200928231437.414489-13-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 12/29] 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