From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) by dpdk.org (Postfix) with ESMTP id E22881B293 for ; Mon, 10 Dec 2018 19:29:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1576; q=dns/txt; s=iport; t=1544466561; x=1545676161; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hmjfDIdMybLUsuDl/7u6da788RHPcybMwaA/K6YuGN8=; b=joUVidO6+PFLHt8COdYKP+Cfe+4zNyd3stmDUepOLtkpKFv5fwwGT/oN ca1mnUZmJgOpaSRAP4NsJyfof9Kylg+jJhnod3rrycsA/nhlLdy52pu6Q Ooykk/PyZvI6tNhhoooMlOJzeUrWzmKjWBHbzqljJP/q72LGsiN6FjBHo A=; X-IronPort-AV: E=Sophos;i="5.56,339,1539648000"; d="scan'208";a="497052810" Received: from alln-core-11.cisco.com ([173.36.13.133]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 18:29:20 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-11.cisco.com (8.15.2/8.15.2) with ESMTP id wBAITKnJ032211; Mon, 10 Dec 2018 18:29:20 GMT Received: by cisco.com (Postfix, from userid 508933) id 657EB20F2001; Mon, 10 Dec 2018 10:29:20 -0800 (PST) From: Hyong Youb Kim To: Ferruh Yigit Cc: dev@dpdk.org, John Daley , Hyong Youb Kim Date: Mon, 10 Dec 2018 10:28:53 -0800 Message-Id: <20181210182857.13043-2-hyonkim@cisco.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20181210182857.13043-1-hyonkim@cisco.com> References: <20181210182857.13043-1-hyonkim@cisco.com> X-Outbound-SMTP-Client: 10.193.184.48, savbu-usnic-a.cisco.com X-Outbound-Node: alln-core-11.cisco.com Subject: [dpdk-dev] [PATCH 1/4] net/enic: release port upon 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: , X-List-Received-Date: Mon, 10 Dec 2018 18:29:22 -0000 Set RTE_ETH_DEV_CLOSE_REMOVE upon probe so rte_eth_dev_close() can later free port resources including mac_addrs. Signed-off-by: Hyong Youb Kim Reviewed-by: John Daley --- drivers/net/enic/enic_ethdev.c | 2 ++ drivers/net/enic/enic_main.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 996bb5542..ed8dda568 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -1048,6 +1048,8 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst = &enic_recv_pkts; eth_dev->tx_pkt_burst = &enic_xmit_pkts; eth_dev->tx_pkt_prepare = &enic_prep_pkts; + /* Let rte_eth_dev_close() release the port resources */ + eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; pdev = RTE_ETH_DEV_TO_PCI(eth_dev); rte_eth_copy_pci_info(eth_dev, pdev); diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index c3869de36..f45717374 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1379,12 +1379,10 @@ int enic_get_link_status(struct enic *enic) static void enic_dev_deinit(struct enic *enic) { - struct rte_eth_dev *eth_dev = enic->rte_dev; - /* stop link status checking */ vnic_dev_notify_unset(enic->vdev); - rte_free(eth_dev->data->mac_addrs); + /* mac_addrs is freed by rte_eth_dev_release_port() */ rte_free(enic->cq); rte_free(enic->intr); rte_free(enic->rq); -- 2.16.2