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 A44AEA04C9; Mon, 14 Sep 2020 00:08:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F18A1C10F; Mon, 14 Sep 2020 00:08:06 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 8C2901C11A for ; Mon, 14 Sep 2020 00:08:04 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 3E3FC5C0143; Sun, 13 Sep 2020 18:08:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sun, 13 Sep 2020 18:08:04 -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=MyXS9M7zivPh4SWj8Dg37IK3SLJCa bHjzqVtbST6Ayx9SrBANvSaVzYZtjQQ/IrsTN/2EJudsRC+G1i0NOu0B5GIoaq4z NCe7+4sl2SRTPkFQfGA3TXuA7kZW2Wn3CNkzl06R3TppjQ6ZB1hVe6u4k8OJdcIS DWsPajnPDkMt4N4A+QdtW9O4Ft50hMDWUFKixg5CvdT3A3TjOrHFg0t0rEwMFsgk ugJgyA8bzWAqOjwYTdzZIZA/vFkaFTs75ctO0nzLq3BqIiylCCM7FVQ5G8+Tu2Pc X4HhbgJlT0v0KBd0GRn/YIPaQXmCoAIHm4EP0GqGhgqOef/j75MuMRNDg== 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=KCGYBFMj LXI5WNChs0y98NClFAv0kplKuQCXJLCfacLg+L5UefNo310zx+gyKSms1+iLwCTs zHtgz3iHtyz4FR//6hgXzXq3JDHeS6rQ+kb924kAEsIfxnXXKgFxjLOn+Fx10ZVM yTU6ZIZg3zd57n74FCFSKA/37vyBaFxpnqDQhsYYFnoibl0Qtrsdev2pfAIyBF8Q yErvjJKedHtziqFBcXkUwf2oXy39OlhEnG3hDeRO4yq60i+5w2I38G2MIkfTKvaZ k9Dw3+E8nGsdBkvaW9f5hxaSegAGDN8bRSvml7MRjnbptZMnAkpiqoBNO5tdv3lG R6PlLhNYDYhqUw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudeihedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeeknecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 5439F3064674; Sun, 13 Sep 2020 18:08:03 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, arybchenko@solarflare.com, Matan Azrad , Shahaf Shuler Date: Mon, 14 Sep 2020 00:07:00 +0200 Message-Id: <20200913220711.3768597-10-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200913220711.3768597-1-thomas@monjalon.net> References: <20200913220711.3768597-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 09/20] 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