From patchwork Mon Jul 22 12:35:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 56872 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 890E91BF5B; Mon, 22 Jul 2019 14:35:55 +0200 (CEST) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by dpdk.org (Postfix) with ESMTP id 418191BF54 for ; Mon, 22 Jul 2019 14:35:53 +0200 (CEST) Received: by mail-qt1-f193.google.com with SMTP id r6so34074757qtt.0 for ; Mon, 22 Jul 2019 05:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2tXhOK9qeKfxThegcspNANFYKIVC5SCRHvMbFiPigS8=; b=QSebjI9lYyVc7Dyr2kRRA+cpH7VKQPYJeDYnDGe9k9VbygSkU4EhWGMGebGbBs7HR8 mMaDaVV4Vo84DOP3PUcjguwhYPlCcjno82euXRH8ohTppRHgO+ruUaVyomsb219L3ypk U2y66Ii6QsZZWFeoqd4QA9oqTRsWdVtveGLxKS0TQcn802fXyygbbG3VQ3jRHpoDm/Bh UznpFJIGP0LsxNCPhI2OjPgzoQuvwnhhij+/koJIo0to5QrOOI/6LVyp5hgqD93l3zCf tQUotgEB6VAnQtm1v7O5k8ibOegwzRf5ZqsSgBcKwq/GzjSgWRiryiyKmacz1gXlxxa+ pAwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2tXhOK9qeKfxThegcspNANFYKIVC5SCRHvMbFiPigS8=; b=QA1B4u75jR1Kn7OwSSX83cIxcrMhw7Zd5budWuhjZNojy0uQ6GXO59DDY1RHJWdRCD brrkfLzK6vTD+SPMQhZk9T+wVp66+9lbHOkxVlunIh25jdHnk3q5kNwk5id0qoRGuJe+ AKryJ9SLDV8TyzGUg7y0L/7PjWNBQJEfUOE+TMucqDOnZbfnCBJCaOT2+n4PJaLcrF49 sUkoS8JfGC0YaojG51/qeI7uM89HCZLGdx0hBqzSE1M47uM0B4HHKTrhflX1Oo41QiNL n/aG0tNtYn5b/9OfofwszFI+NwmnlYSgIyOtFw/LyUFw+ZnG4s6PigcEwxrOucBejugl cnag== X-Gm-Message-State: APjAAAXYdnVerBc6UVF1cz+NS5MXwOzKxFixswjCF5WPCGlFnsOoMe7i xGZvo75Kh3z/p3ijhS+J8FZ/rWiUXBI= X-Google-Smtp-Source: APXvYqylk9RFiYg3hkv2qPy4we7HOGyjTGCmfiN+Fco/bDKCSpreC5ZLLSY5qniBoxS/+thS9Mw11A== X-Received: by 2002:aed:355d:: with SMTP id b29mr49576400qte.12.1563798952382; Mon, 22 Jul 2019 05:35:52 -0700 (PDT) Received: from localhost.localdomain (pool-173-48-129-93.bstnma.fios.verizon.net. [173.48.129.93]) by smtp.gmail.com with ESMTPSA id h18sm16107725qkj.134.2019.07.22.05.35.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jul 2019 05:35:51 -0700 (PDT) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@intel.com Cc: shepard.siegel@atomicrules.com, john.miller@atomicrules.com, Ed Czeck Date: Mon, 22 Jul 2019 08:35:41 -0400 Message-Id: <1563798941-11225-2-git-send-email-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563798941-11225-1-git-send-email-ed.czeck@atomicrules.com> References: <1563312861-26219-1-git-send-email-ed.czeck@atomicrules.com> <1563798941-11225-1-git-send-email-ed.czeck@atomicrules.com> Subject: [dpdk-dev] [PATCH 2/2] net/ark: remove resources when port is 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" Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so all the resources for the port can be freed by rte_eth_dev_close() Signed-off-by: Ed Czeck --- drivers/net/ark/ark_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 86e500e..3435728 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -261,6 +261,8 @@ eth_ark_dev_init(struct rte_eth_dev *dev) /* Use dummy function until setup */ dev->rx_pkt_burst = ð_ark_recv_pkts_noop; dev->tx_pkt_burst = ð_ark_xmit_pkts_noop; + /* Let rte_eth_dev_close() release the port resources */ + dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; ark->bar0 = (uint8_t *)pci_dev->mem_resource[0].addr; ark->a_bar = (uint8_t *)pci_dev->mem_resource[2].addr; @@ -706,6 +708,9 @@ eth_ark_dev_close(struct rte_eth_dev *dev) eth_ark_dev_rx_queue_release(dev->data->rx_queues[i]); dev->data->rx_queues[i] = 0; } + + rte_free(dev->data->mac_addrs); + dev->data->mac_addrs = 0; } static void