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 8FE23428D4; Wed, 5 Apr 2023 16:27:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9C0242D5F; Wed, 5 Apr 2023 16:26:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C45FA42D31 for ; Wed, 5 Apr 2023 16:25:58 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3357OL6H006996; Wed, 5 Apr 2023 07:25:58 -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-transfer-encoding : content-type; s=pfpt0220; bh=eBY2lP7ntHdXrt3Capn9Nly8pECR0wS9OC3Ol0bphk0=; b=gyT4fZfQY9xODcbPUsHHTxsRFgzAmWpZd7K/f3SYU/bQ7P2XGi9692UD3sUq1mUokhsB 5AHh2Ob8fseVBMash6GwNQRACdNtycQKAKzot/6YcHYVie07JFyoHRNUaxbjCDQyJ5em HbVJJX9llgQG6jPPfKb2lE5FpTyuJvXhwFYGcbnWjTW3GFyiNcGp+6cplR0uqkTs28uv GNvenE+5pN6O/yVJVYtPolLS1gPzxotqrxoSP/SEoD30LIdGQ6Go/iNXT7nCcau3mFW5 sFRmusyyvZZ92QM7FkZaUTUa8lGXajiUyhi9h2uTYKGGycbFIf64k4NeHg+aNgLrYP/f vg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3ps4jpjbjh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 05 Apr 2023 07:25:57 -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.48; Wed, 5 Apr 2023 07:25:56 -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.48 via Frontend Transport; Wed, 5 Apr 2023 07:25:56 -0700 Received: from localhost.marvell.com (unknown [10.106.27.249]) by maili.marvell.com (Postfix) with ESMTP id 1CD983F7050; Wed, 5 Apr 2023 07:25:56 -0700 (PDT) From: Sathesh Edara To: , , , "Radha Mohan Chintakuntla" , Veerasenareddy Burru , Anatoly Burakov CC: Subject: [PATCH v2 10/10] net/octeon_ep: set secondary process dev ops Date: Wed, 5 Apr 2023 07:25:36 -0700 Message-ID: <20230405142537.1899973-11-sedara@marvell.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230405142537.1899973-1-sedara@marvell.com> References: <20230404141855.1025625-2-sedara@marvell.com> <20230405142537.1899973-1-sedara@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: kHIQbol9ABkuKHimkwgClNb9MC_Bo8_1 X-Proofpoint-ORIG-GUID: kHIQbol9ABkuKHimkwgClNb9MC_Bo8_1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-05_09,2023-04-05_01,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 This patch sets the dev ops and transmit/receive callbacks for secondary process. Signed-off-by: Sathesh Edara --- drivers/net/octeon_ep/otx_ep_ethdev.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c index 885fbb475f..a9868909f8 100644 --- a/drivers/net/octeon_ep/otx_ep_ethdev.c +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c @@ -527,9 +527,17 @@ otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev, static int otx_ep_dev_close(struct rte_eth_dev *eth_dev) { - struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev); + struct otx_ep_device *otx_epvf; uint32_t num_queues, q_no; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + eth_dev->dev_ops = NULL; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; + return 0; + } + + otx_epvf = OTX_EP_DEV(eth_dev); otx_ep_mbox_send_dev_exit(eth_dev); otx_epvf->fn_list.disable_io_queues(otx_epvf); num_queues = otx_epvf->nb_rx_queues; @@ -593,8 +601,12 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = { static int otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev) { - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + eth_dev->dev_ops = NULL; + eth_dev->rx_pkt_burst = NULL; + eth_dev->tx_pkt_burst = NULL; return 0; + } eth_dev->dev_ops = NULL; eth_dev->rx_pkt_burst = NULL; @@ -642,8 +654,12 @@ otx_ep_eth_dev_init(struct rte_eth_dev *eth_dev) struct rte_ether_addr vf_mac_addr; /* Single process support */ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + eth_dev->dev_ops = &otx_ep_eth_dev_ops; + eth_dev->rx_pkt_burst = &otx_ep_recv_pkts; + eth_dev->tx_pkt_burst = &otx2_ep_xmit_pkts; return 0; + } rte_eth_copy_pci_info(eth_dev, pdev); otx_epvf->eth_dev = eth_dev; -- 2.31.1