From patchwork Mon May 27 13:46:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allain Legacy X-Patchwork-Id: 53709 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 D34E1F94; Mon, 27 May 2019 15:46:48 +0200 (CEST) Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by dpdk.org (Postfix) with ESMTP id 02BFB3DC for ; Mon, 27 May 2019 15:46:46 +0200 (CEST) Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id x4RDkfrb029621 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 27 May 2019 06:46:41 -0700 (PDT) Received: from yow-alegacy-vm3.wrs.com (128.224.140.250) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 May 2019 06:46:40 -0700 From: Allain Legacy To: CC: , , Matt Peters Date: Mon, 27 May 2019 08:46:31 -0500 Message-ID: <20190527134631.24427-1-allain.legacy@windriver.com> X-Mailer: git-send-email 2.12.1 MIME-Version: 1.0 X-Originating-IP: [128.224.140.250] Subject: [dpdk-dev] [PATCH] net/avp: remove resources when port is closed 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 rte_eth_dev_close() function now handles freeing resources for devices (e.g., mac_addrs). There is no change in behaviour for AVP devices since they do not currently free their dynamic memory; which was a bug. To conform with the new close() behaviour we are asserting the RTE_ETH_DEV_CLOSE_REMOVE flag so that rte_eth_dev_close() releases all device related dynamic memory. Cc: Matt Peters Signed-off-by: Allain Legacy --- drivers/net/avp/avp_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 09388d05f..7c37f4c8a 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -959,6 +959,8 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev) eth_dev->dev_ops = &avp_eth_dev_ops; eth_dev->rx_pkt_burst = &avp_recv_pkts; eth_dev->tx_pkt_burst = &avp_xmit_pkts; + /* Let rte_eth_dev_close() release the port resources */ + eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; if (rte_eal_process_type() != RTE_PROC_PRIMARY) { /*