From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 219F0400C9; Tue, 21 Feb 2023 15:37:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BBF43431DE; Tue, 21 Feb 2023 15:37:12 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 3CBEB40E0F for ; Tue, 21 Feb 2023 15:37:11 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31LD5StM032553 for ; Tue, 21 Feb 2023 06:37:10 -0800 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-transfer-encoding : content-type; s=pfpt0220; bh=f+4dYayG/SunnWQ+0m85UQDvQsrG8TyoJsnLv045SkI=; b=QWJRbQNGRCK/4Ll27dGmgzgvwDql8IntzNJVNjFecFoNwaIkHMFSLCr+YBz25dbfqfYD rXWYWhhpOM1n+j6s+06pqubKl1iWJJMxzpuM3mWRwPKaOlgE/+4O5ZTn7zQQ8sxppoMu KCXLf0dMfUWyga7lRiOezS0EXBZwnZ2ny68mD0SMejendgvqHSVaaaLdtlB+XI48QrZ0 Tk7E3Pb6Lz1YpzTfxU0ofj+Yn5JmLrQs1YXk6jqLV7t2bkKsO7TcSSDf7UGBBENSTq7V Oo/krr9uTDRYdnwQ6TGkHKs8IcmPlIqIfpNr4Cu0Yj9vjIivk+hMhBw3/i7L2aRAwieg 7g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nty304n0h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 21 Feb 2023 06:37:10 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 21 Feb 2023 06:37:06 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 21 Feb 2023 06:37:06 -0800 Received: from localhost.com (unknown [10.106.27.249]) by maili.marvell.com (Postfix) with ESMTP id 3869E3F7075; Tue, 21 Feb 2023 06:37:06 -0800 (PST) From: Sathesh Edara To: , , , "Radha Mohan Chintakuntla" , Veerasenareddy Burru CC: Subject: [PATCH v1 1/2] net/octeon_ep: support device close Date: Tue, 21 Feb 2023 06:36:25 -0800 Message-ID: <20230221143627.219917-2-sedara@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230221143627.219917-1-sedara@marvell.com> References: <20230221143627.219917-1-sedara@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: nVg6V75FoEwElUYCfaM9oqRnO5Sp3a6f X-Proofpoint-ORIG-GUID: nVg6V75FoEwElUYCfaM9oqRnO5Sp3a6f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-21_08,2023-02-20_02,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added dev close functionality in the ethdev ops and moves input and output queue deletion functionality into it from otx_epdev_exit() routine. Signed-off-by: Sathesh Edara --- drivers/net/octeon_ep/otx_ep_ethdev.c | 63 ++++++++++++--------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c index c8f4abe4ca..0930efedce 100644 --- a/drivers/net/octeon_ep/otx_ep_ethdev.c +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c @@ -395,6 +395,34 @@ otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev, return 0; } +static int +otx_ep_dev_close(struct rte_eth_dev *eth_dev) +{ + struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev); + uint32_t num_queues, q_no; + + otx_epvf->fn_list.disable_io_queues(otx_epvf); + num_queues = otx_epvf->nb_rx_queues; + for (q_no = 0; q_no < num_queues; q_no++) { + if (otx_ep_delete_oqs(otx_epvf, q_no)) { + otx_ep_err("Failed to delete OQ:%d\n", q_no); + return -EINVAL; + } + } + otx_ep_dbg("Num OQs:%d freed\n", otx_epvf->nb_rx_queues); + + num_queues = otx_epvf->nb_tx_queues; + for (q_no = 0; q_no < num_queues; q_no++) { + if (otx_ep_delete_iqs(otx_epvf, q_no)) { + otx_ep_err("Failed to delete IQ:%d\n", q_no); + return -EINVAL; + } + } + otx_ep_dbg("Num IQs:%d freed\n", otx_epvf->nb_tx_queues); + + return 0; +} + static int otx_ep_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete) { @@ -424,47 +452,14 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .stats_get = otx_ep_dev_stats_get, .stats_reset = otx_ep_dev_stats_reset, .link_update = otx_ep_dev_link_update, + .dev_close = otx_ep_dev_close, }; -static int -otx_epdev_exit(struct rte_eth_dev *eth_dev) -{ - struct otx_ep_device *otx_epvf; - uint32_t num_queues, q; - - otx_ep_info("%s:\n", __func__); - - otx_epvf = OTX_EP_DEV(eth_dev); - - otx_epvf->fn_list.disable_io_queues(otx_epvf); - - num_queues = otx_epvf->nb_rx_queues; - for (q = 0; q < num_queues; q++) { - if (otx_ep_delete_oqs(otx_epvf, q)) { - otx_ep_err("Failed to delete OQ:%d\n", q); - return -EINVAL; - } - } - otx_ep_info("Num OQs:%d freed\n", otx_epvf->nb_rx_queues); - - num_queues = otx_epvf->nb_tx_queues; - for (q = 0; q < num_queues; q++) { - if (otx_ep_delete_iqs(otx_epvf, q)) { - otx_ep_err("Failed to delete IQ:%d\n", q); - return -EINVAL; - } - } - otx_ep_dbg("Num IQs:%d freed\n", otx_epvf->nb_tx_queues); - - return 0; -} - static int otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev) { if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - otx_epdev_exit(eth_dev); eth_dev->dev_ops = NULL; eth_dev->rx_pkt_burst = NULL; -- 2.31.1