From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 183B5C04AB3 for ; Mon, 27 May 2019 13:46:51 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id C2AD720859 for ; Mon, 27 May 2019 13:46:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2AD720859 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@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 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