From patchwork Fri Sep 25 04:17:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasesh Mody X-Patchwork-Id: 78780 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ECE2BA04C0; Fri, 25 Sep 2020 06:18:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7DEDC1E4B6; Fri, 25 Sep 2020 06:18:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 577231E4AD for ; Fri, 25 Sep 2020 06:18:18 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08P4FYJI016967; Thu, 24 Sep 2020 21:18:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=SZxc5CVAyZP1w313NSrGvqJhEgEJjJ+yiOC5o2NpL/4=; b=iOP7pagFkwGetjFZak58ELGLxRighEA4rVct5bddCk0f67TqKlUQzkyZPnJeIw2C1GCQ qnZUQOkjGyQeca9vERYsemm3I/vsbOCvnTTeYbBDf7OV3COvmSO+xEalnOdvS9XJcUBa 2DpdCYdhMqCynOuEYgRnlXFknOtazo48VlQtJhl3QPZnIJvh/nmeY5P35uqRS2yqPZlE DasEo6bVCtXw5xyqqvbgC8nBMvwGRD+eFIUjSuHp3OFrFytu2rocr/uOOGNkLjlcaS7l yM9NhyA/LT/qQp5DAIneZL+M0/mFUzi9NihfGMmQRV19rR6pLW7ZiXBxPGTKBXT8CVXb vQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 33nhgnrc39-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 24 Sep 2020 21:18:17 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 24 Sep 2020 21:18:17 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 24 Sep 2020 21:18:16 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 24 Sep 2020 21:18:16 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id C8C073F7044; Thu, 24 Sep 2020 21:18:15 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 08P4IFE1017771; Thu, 24 Sep 2020 21:18:15 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: , CC: , , , "Rasesh Mody" Date: Thu, 24 Sep 2020 21:17:44 -0700 Message-ID: <20200925041744.17688-2-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200925041744.17688-1-rmody@marvell.com> References: <20200925041744.17688-1-rmody@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-25_01:2020-09-24, 2020-09-25 signatures=0 Subject: [dpdk-dev] [PATCH] net/qede: enhance old ethdev close behavior 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 private resources for the port can be freed by rte_eth_dev_close(). With this change the private port resources are released in the .dev_close callback. Signed-off-by: Rasesh Mody --- drivers/net/qede/qede_ethdev.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index 59f1746ee..86a0ea26f 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1586,6 +1586,10 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) if (ECORE_IS_CMT(edev)) rte_eal_alarm_cancel(qede_poll_sp_sb_cb, (void *)eth_dev); + + eth_dev->dev_ops = NULL; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; } static int @@ -2701,6 +2705,11 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) adapter->ipgre.enable = false; } + /* Pass the information to the rte_eth_dev_close() that it should also + * release the private port resources. + */ + eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE; + DP_INFO(edev, "MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n", adapter->primary_mac.addr_bytes[0], adapter->primary_mac.addr_bytes[1], @@ -2745,10 +2754,6 @@ static int qede_dev_common_uninit(struct rte_eth_dev *eth_dev) /* safe to close dev here */ qede_dev_close(eth_dev); - eth_dev->dev_ops = NULL; - eth_dev->rx_pkt_burst = NULL; - eth_dev->tx_pkt_burst = NULL; - return 0; }