From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id B264EA0AC5 for ; Mon, 27 May 2019 15:46:50 +0200 (CEST) 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 Content-Type: text/plain 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) { /* -- 2.12.1