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 69773A0471 for ; Fri, 19 Jul 2019 15:08:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CEDDC7CBC; Fri, 19 Jul 2019 15:07:58 +0200 (CEST) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by dpdk.org (Postfix) with ESMTP id 59D14325F for ; Fri, 19 Jul 2019 15:07:55 +0200 (CEST) Received: by mail-qk1-f196.google.com with SMTP id s145so23150462qke.7 for ; Fri, 19 Jul 2019 06:07:55 -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=sojrG2tbTYepFDa+01y5XTnpbSgPG9ZW0tvUSIBUiE6zMJBxAMwtfd0cnvlPWqFZQT iK2svnR4MuMu1nBH/D1K0oTbnTm5tTjR3czhSnfnmjOmGRVoO2eZLrDAeqAsAeylyxdM LSSbWlMgdnNiSrQe2M69jjVh/uD9yxcXd3Lj6nRPDpyXxDuCyGJrJ8Jw5+3fkq6m0sae q056eSYKWNefhHLOvfBYNNHWo5ibjJxRWRtqTlTP8uExWrq+7sCFvTc1wa2iuwvXCTFB TTdeGwvQTTROfTJh1j/Fuyp1zrvuSQ5ZE05W5znp99zAOHjAAdDuSdBU+Tmu6Do7klwP KsIA== 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=MqGo9e8jIfy36+82aOFofI/X74OzBo8FxztK/EoYeAn6jPseWWGUko/jaM+rmTpLQT ph0vNZk4Be5j7JBDHQVsOyZ6G0TYilWPKuX8ffbGOVYARYj0oSybjHmnHYTQrsa8R6aU 4pMBezWb6ktd7lmJTs/37KzHwxzdGuY08N3j6JSYnvkte1z6FksDT6BeMPrvO8g9peRD ScvpCFW0LVt9z7vvgiGDRfjq1vxdi2K1gRrrXh8/Wz3n84IGPKTdopwZGGyan6o8vPS4 mKtTAxx/2IWOadk5BUyPD8zW7zaGOPOdqU3epoNYdtbdGp962Wir73k3iztUjranaBNF tEmw== X-Gm-Message-State: APjAAAWGGa5TSmmKj+MQ0lefecFo4IPIuw4Zzes/+/PbIGlwSC94qEq4 c37yY+AaDuJmlF930ppRDBgp5o98YNQ= X-Google-Smtp-Source: APXvYqzKkMA0vKHAd9mja+L3WAJdcmEn3uBV0peRrt3NzADI40bGXOJIXQqBPjiLKR9tTv5yl9GE5g== X-Received: by 2002:a37:a44a:: with SMTP id n71mr33578410qke.393.1563541674238; Fri, 19 Jul 2019 06:07:54 -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 r26sm13567080qkm.57.2019.07.19.06.07.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jul 2019 06:07:53 -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: Fri, 19 Jul 2019 09:07:43 -0400 Message-Id: <1563541663-10797-2-git-send-email-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1563541663-10797-1-git-send-email-ed.czeck@atomicrules.com> References: <1563312861-26219-1-git-send-email-ed.czeck@atomicrules.com> <1563541663-10797-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 -- 2.7.4