From patchwork Wed Jul 27 09:21:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sathesh B Edara X-Patchwork-Id: 114268 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 707ACA00C4; Wed, 27 Jul 2022 11:24:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55D6840141; Wed, 27 Jul 2022 11:24:28 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 1C349400D7 for ; Wed, 27 Jul 2022 11:24:26 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26R99q5p003401; Wed, 27 Jul 2022 02:22:22 -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=ZTW2u8Wpjcj71zMAFj/L6l7M4z5f8UdMdm3bv50F6Zo=; b=FwwL5Z7oTLKopWs1JzIeJ7B9YIpIrWk4Ndstuvf52QyIE2uZybIkLuACnfmsZDU2WZlv ZwL868UdCQ9FC8yjZd0XL/qp0c7BfNEdobRT4bsk+NQg1NpNcdKkTswnWypFyG+2zO36 sARBiW0g1WT4Nplzn8ikRUqdmW+hn5RmqHbLT79zmdJTZ2VKWzLK9NOBr8JXW1A6jaDr wgqVjRsBL4NmMCP5hj0EDCnztQJnUpRGaCuDL/5rPQcqqA/p/PZlsqPS5Xw+JNLDZvRJ B3+3j1SGL1uWcNBT4FkKhfG7EvDk1rTQJ8YHJky78F4UFQrZirEMwHdyCUTKT0PJ6a/u cQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hk2fy80uc-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 27 Jul 2022 02:22:21 -0700 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.18; Wed, 27 Jul 2022 02:21:41 -0700 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.18 via Frontend Transport; Wed, 27 Jul 2022 02:21:41 -0700 Received: from setup-1.caveonetworks.com (unknown [10.106.27.161]) by maili.marvell.com (Postfix) with ESMTP id 165573F7051; Wed, 27 Jul 2022 02:21:41 -0700 (PDT) From: Sathesh Edara To: , , , "Thomas Monjalon" , Radha Mohan Chintakuntla , Veerasenareddy Burru , Ray Kinsella CC: Subject: [PATCH v2 1/3] net: rename octeon ep PMD Date: Wed, 27 Jul 2022 02:21:32 -0700 Message-ID: <20220727092134.141530-2-sedara@marvell.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220727092134.141530-1-sedara@marvell.com> References: <20220727092134.141530-1-sedara@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: KuPVEUIm_Y6MMRpY4hfhpgcd3fapFOsv X-Proofpoint-GUID: KuPVEUIm_Y6MMRpY4hfhpgcd3fapFOsv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-26_07,2022-07-26_01,2022-06-22_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 renames octeon end point driver from octeontx_ep to octeon_ep to enable single unified driver to support current OcteonTx and future Octeon PCI endpoint NICs to reflect common driver for all Octeon based PCI endpoint NICs. Signed-off-by: Sathesh Edara --- MAINTAINERS | 6 +++--- doc/guides/nics/features/{octeontx_ep.ini => octeon_ep.ini} | 2 +- doc/guides/nics/index.rst | 2 +- doc/guides/nics/{octeontx_ep.rst => octeon_ep.rst} | 4 ++-- drivers/net/meson.build | 2 +- drivers/net/{octeontx_ep => octeon_ep}/meson.build | 0 drivers/net/{octeontx_ep => octeon_ep}/otx2_ep_vf.c | 0 drivers/net/{octeontx_ep => octeon_ep}/otx2_ep_vf.h | 0 drivers/net/{octeontx_ep => octeon_ep}/otx_ep_common.h | 0 drivers/net/{octeontx_ep => octeon_ep}/otx_ep_ethdev.c | 0 drivers/net/{octeontx_ep => octeon_ep}/otx_ep_rxtx.c | 0 drivers/net/{octeontx_ep => octeon_ep}/otx_ep_rxtx.h | 0 drivers/net/{octeontx_ep => octeon_ep}/otx_ep_vf.c | 0 drivers/net/{octeontx_ep => octeon_ep}/otx_ep_vf.h | 0 drivers/net/{octeontx_ep => octeon_ep}/version.map | 0 15 files changed, 8 insertions(+), 8 deletions(-) rename doc/guides/nics/features/{octeontx_ep.ini => octeon_ep.ini} (75%) rename doc/guides/nics/{octeontx_ep.rst => octeon_ep.rst} (87%) rename drivers/net/{octeontx_ep => octeon_ep}/meson.build (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx2_ep_vf.c (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx2_ep_vf.h (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx_ep_common.h (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx_ep_ethdev.c (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx_ep_rxtx.c (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx_ep_rxtx.h (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx_ep_vf.c (100%) rename drivers/net/{octeontx_ep => octeon_ep}/otx_ep_vf.h (100%) rename drivers/net/{octeontx_ep => octeon_ep}/version.map (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 32ffdd1a61..d7c7fa4cdf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -812,9 +812,9 @@ M: Radha Mohan Chintakuntla M: Veerasenareddy Burru M: Sathesh Edara T: git://dpdk.org/next/dpdk-next-net-mrvl -F: drivers/net/octeontx_ep/ -F: doc/guides/nics/features/octeontx_ep.ini -F: doc/guides/nics/octeontx_ep.rst +F: drivers/net/octeon_ep/ +F: doc/guides/nics/features/octeon_ep.ini +F: doc/guides/nics/octeon_ep.rst Mellanox mlx4 M: Matan Azrad diff --git a/doc/guides/nics/features/octeontx_ep.ini b/doc/guides/nics/features/octeon_ep.ini similarity index 75% rename from doc/guides/nics/features/octeontx_ep.ini rename to doc/guides/nics/features/octeon_ep.ini index d1453f5bee..141d918466 100644 --- a/doc/guides/nics/features/octeontx_ep.ini +++ b/doc/guides/nics/features/octeon_ep.ini @@ -1,5 +1,5 @@ ; -; Supported features of the 'octeontx_ep' network poll mode driver. +; Supported features of the 'octeon_ep' network poll mode driver. ; ; Refer to default.ini for the full list of available PMD features. ; diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst index f48e9f815c..f80906a97d 100644 --- a/doc/guides/nics/index.rst +++ b/doc/guides/nics/index.rst @@ -52,7 +52,7 @@ Network Interface Controller Drivers ngbe null octeontx - octeontx_ep + octeon_ep pfe qede sfc_efx diff --git a/doc/guides/nics/octeontx_ep.rst b/doc/guides/nics/octeon_ep.rst similarity index 87% rename from doc/guides/nics/octeontx_ep.rst rename to doc/guides/nics/octeon_ep.rst index 2ec8a034b5..b5040aeee2 100644 --- a/doc/guides/nics/octeontx_ep.rst +++ b/doc/guides/nics/octeon_ep.rst @@ -4,9 +4,9 @@ OCTEON TX EP Poll Mode driver ============================= -The OCTEON TX EP ETHDEV PMD (**librte_pmd_octeontx_ep**) provides poll mode +The OCTEON TX EP ETHDEV PMD (**librte_pmd_octeon_ep**) provides poll mode ethdev driver support for the virtual functions (VF) of **Marvell OCTEON 9** -and **Cavium OCTEON TX** families of adapters in SR-IOV context. +and **Cavium OCTEON** families of adapters in SR-IOV context. More information can be found at `Marvell Official Website `_. diff --git a/drivers/net/meson.build b/drivers/net/meson.build index e35652fe63..37919eaf8b 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -45,7 +45,7 @@ drivers = [ 'ngbe', 'null', 'octeontx', - 'octeontx_ep', + 'octeon_ep', 'pcap', 'pfe', 'qede', diff --git a/drivers/net/octeontx_ep/meson.build b/drivers/net/octeon_ep/meson.build similarity index 100% rename from drivers/net/octeontx_ep/meson.build rename to drivers/net/octeon_ep/meson.build diff --git a/drivers/net/octeontx_ep/otx2_ep_vf.c b/drivers/net/octeon_ep/otx2_ep_vf.c similarity index 100% rename from drivers/net/octeontx_ep/otx2_ep_vf.c rename to drivers/net/octeon_ep/otx2_ep_vf.c diff --git a/drivers/net/octeontx_ep/otx2_ep_vf.h b/drivers/net/octeon_ep/otx2_ep_vf.h similarity index 100% rename from drivers/net/octeontx_ep/otx2_ep_vf.h rename to drivers/net/octeon_ep/otx2_ep_vf.h diff --git a/drivers/net/octeontx_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h similarity index 100% rename from drivers/net/octeontx_ep/otx_ep_common.h rename to drivers/net/octeon_ep/otx_ep_common.h diff --git a/drivers/net/octeontx_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c similarity index 100% rename from drivers/net/octeontx_ep/otx_ep_ethdev.c rename to drivers/net/octeon_ep/otx_ep_ethdev.c diff --git a/drivers/net/octeontx_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c similarity index 100% rename from drivers/net/octeontx_ep/otx_ep_rxtx.c rename to drivers/net/octeon_ep/otx_ep_rxtx.c diff --git a/drivers/net/octeontx_ep/otx_ep_rxtx.h b/drivers/net/octeon_ep/otx_ep_rxtx.h similarity index 100% rename from drivers/net/octeontx_ep/otx_ep_rxtx.h rename to drivers/net/octeon_ep/otx_ep_rxtx.h diff --git a/drivers/net/octeontx_ep/otx_ep_vf.c b/drivers/net/octeon_ep/otx_ep_vf.c similarity index 100% rename from drivers/net/octeontx_ep/otx_ep_vf.c rename to drivers/net/octeon_ep/otx_ep_vf.c diff --git a/drivers/net/octeontx_ep/otx_ep_vf.h b/drivers/net/octeon_ep/otx_ep_vf.h similarity index 100% rename from drivers/net/octeontx_ep/otx_ep_vf.h rename to drivers/net/octeon_ep/otx_ep_vf.h diff --git a/drivers/net/octeontx_ep/version.map b/drivers/net/octeon_ep/version.map similarity index 100% rename from drivers/net/octeontx_ep/version.map rename to drivers/net/octeon_ep/version.map From patchwork Wed Jul 27 09:21:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sathesh B Edara X-Patchwork-Id: 114265 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C46EA00C4; Wed, 27 Jul 2022 11:22:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3472840141; Wed, 27 Jul 2022 11:22:12 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 96034400D7 for ; Wed, 27 Jul 2022 11:22:10 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26R99qAC003411 for ; Wed, 27 Jul 2022 02:22:09 -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=QdOBoV1jTz55oU2vLu9PRqpU5SnIicv/iYeMMT88QCs=; b=Y1a/bIhmbgVmM+fXWchQLAXgPiS3nQXnVYoPS0OYLiS9zvb1DYeVG1H4eD7AasK6Bslm WzOjl3ArsTXDSKMurMdNzRPINJiNON/Pd2EFP/RXuBuCKCxxo5N0CI0pRqTVzkFsnwmD YsHnLvUnF1R/+B9ah4Y36K9sqLPafaUu/A5+o64baz4eNVVNQUZk/+nzH3K4BdOsu/La 2qOjaJR0Yr44sTvpL58uB8cryE5RgVgk666vA2hwsQxL3pCDBRLFVZT1KM7C62BjlxfV JKq5eTxnLEc0cASeOZtk0ycaIwYEF/ktuoqCPS/GssDys801ofN/KT43rSIf16qY8O9q Dg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hk2fy80uj-12 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 27 Jul 2022 02:22:09 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 27 Jul 2022 02:21:41 -0700 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.18 via Frontend Transport; Wed, 27 Jul 2022 02:21:41 -0700 Received: from setup-1.caveonetworks.com (unknown [10.106.27.161]) by maili.marvell.com (Postfix) with ESMTP id 6F44E3F707E; Wed, 27 Jul 2022 02:21:41 -0700 (PDT) From: Sathesh Edara To: , , , "Radha Mohan Chintakuntla" , Veerasenareddy Burru CC: Subject: [PATCH v2 2/3] net/octeon_ep: support basic stats Date: Wed, 27 Jul 2022 02:21:33 -0700 Message-ID: <20220727092134.141530-3-sedara@marvell.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220727092134.141530-1-sedara@marvell.com> References: <20220727092134.141530-1-sedara@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: XdpdI0XohfWcfPmpd7KnRBOwz-bZUp1m X-Proofpoint-GUID: XdpdI0XohfWcfPmpd7KnRBOwz-bZUp1m X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-26_07,2022-07-26_01,2022-06-22_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 functionality to fetch and reset ethdev stats. Signed-off-by: Sathesh Edara --- doc/guides/nics/features/octeon_ep.ini | 1 + drivers/net/octeon_ep/otx_ep_ethdev.c | 52 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/doc/guides/nics/features/octeon_ep.ini b/doc/guides/nics/features/octeon_ep.ini index 141d918466..b304ff8877 100644 --- a/doc/guides/nics/features/octeon_ep.ini +++ b/doc/guides/nics/features/octeon_ep.ini @@ -8,4 +8,5 @@ Speed capabilities = P SR-IOV = Y Linux = Y x86-64 = Y +Basic stats = Y Usage doc = Y diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c index 806add246b..cb45bd7a8a 100644 --- a/drivers/net/octeon_ep/otx_ep_ethdev.c +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c @@ -337,6 +337,56 @@ otx_ep_tx_queue_release(struct rte_eth_dev *dev, uint16_t q_no) otx_ep_delete_iqs(tq->otx_ep_dev, tq->q_no); } +static int +otx_ep_dev_stats_reset(struct rte_eth_dev *dev) +{ + struct otx_ep_device *otx_epvf = OTX_EP_DEV(dev); + uint32_t i; + + for (i = 0; i < otx_epvf->nb_tx_queues; i++) + memset(&otx_epvf->instr_queue[i]->stats, 0, + sizeof(struct otx_ep_iq_stats)); + + for (i = 0; i < otx_epvf->nb_rx_queues; i++) + memset(&otx_epvf->droq[i]->stats, 0, + sizeof(struct otx_ep_droq_stats)); + + return 0; +} + +static int +otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev, + struct rte_eth_stats *stats) +{ + struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev); + struct otx_ep_iq_stats *ostats; + struct otx_ep_droq_stats *istats; + uint32_t i; + + memset(stats, 0, sizeof(struct rte_eth_stats)); + + for (i = 0; i < otx_epvf->nb_tx_queues; i++) { + ostats = &otx_epvf->instr_queue[i]->stats; + stats->q_opackets[i] = ostats->tx_pkts; + stats->q_obytes[i] = ostats->tx_bytes; + stats->opackets += ostats->tx_pkts; + stats->obytes += ostats->tx_bytes; + stats->oerrors += ostats->instr_dropped; + } + for (i = 0; i < otx_epvf->nb_rx_queues; i++) { + istats = &otx_epvf->droq[i]->stats; + stats->q_ipackets[i] = istats->pkts_received; + stats->q_ibytes[i] = istats->bytes_received; + stats->q_errors[i] = istats->rx_err; + stats->ipackets += istats->pkts_received; + stats->ibytes += istats->bytes_received; + stats->imissed += istats->rx_alloc_failure; + stats->ierrors += istats->rx_err; + stats->rx_nombuf += istats->rx_alloc_failure; + } + return 0; +} + /* Define our ethernet definitions */ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .dev_configure = otx_ep_dev_configure, @@ -347,6 +397,8 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .tx_queue_setup = otx_ep_tx_queue_setup, .tx_queue_release = otx_ep_tx_queue_release, .dev_infos_get = otx_ep_dev_info_get, + .stats_get = otx_ep_dev_stats_get, + .stats_reset = otx_ep_dev_stats_reset, }; static int From patchwork Wed Jul 27 09:21:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sathesh B Edara X-Patchwork-Id: 114266 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6D5DA00C4; Wed, 27 Jul 2022 11:22:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1021A40F19; Wed, 27 Jul 2022 11:22:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B683B40141 for ; Wed, 27 Jul 2022 11:22:10 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26R99qAD003411 for ; Wed, 27 Jul 2022 02:22:09 -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=eTAultiqxc9MS+0NncT+hYjf9z3Zk4VPmrHocEZLliY=; b=WFY84AYrOD9PxeJZYIxELqor+Hpd4PKkSdVqsVgJtQ4EgsYWJy7KVvU3nU21LhXdtPPm RL5E44uliGg+o/GE0RRtJPl5CK+nf/su95yaqtWPUQV3hJzLkgLEBPLDunwFOSmYxpqK DWpphXnOWBlo9/NUnv/zcHlkMjrJ6/I8iRkCDotT/EcPV1Qh0Mbh8GFdLYVImHkjG4Uf +NG3K2M448rmxhH5i+XHlDYTjIjfmOPmU2QU6/+0NZugyCoOLGI1PxaUUZPpicvhuroa XyakHWPrdLGgQJACizfPWGKYWgqkapWObYcc/aRTydJnmbshEfcgC5uPnOCFEy4x0O6D tg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hk2fy80uj-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 27 Jul 2022 02:22:09 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 27 Jul 2022 02:21:42 -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; Wed, 27 Jul 2022 02:21:41 -0700 Received: from setup-1.caveonetworks.com (unknown [10.106.27.161]) by maili.marvell.com (Postfix) with ESMTP id BC7CC3F70A8; Wed, 27 Jul 2022 02:21:41 -0700 (PDT) From: Sathesh Edara To: , , , "Radha Mohan Chintakuntla" , Veerasenareddy Burru CC: Subject: [PATCH v2 3/3] net/octeon_ep: support link status Date: Wed, 27 Jul 2022 02:21:34 -0700 Message-ID: <20220727092134.141530-4-sedara@marvell.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220727092134.141530-1-sedara@marvell.com> References: <20220727092134.141530-1-sedara@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: NlfQ0TJst5uD-qLu5LwyBfmWCieWZp15 X-Proofpoint-GUID: NlfQ0TJst5uD-qLu5LwyBfmWCieWZp15 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-26_07,2022-07-26_01,2022-06-22_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 functionality to update link speed, duplex mode and link state. Signed-off-by: Sathesh Edara --- doc/guides/nics/features/octeon_ep.ini | 1 + drivers/net/octeon_ep/otx_ep_ethdev.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/guides/nics/features/octeon_ep.ini b/doc/guides/nics/features/octeon_ep.ini index b304ff8877..305e219262 100644 --- a/doc/guides/nics/features/octeon_ep.ini +++ b/doc/guides/nics/features/octeon_ep.ini @@ -9,4 +9,5 @@ SR-IOV = Y Linux = Y x86-64 = Y Basic stats = Y +Link status = Y Usage doc = Y diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c index cb45bd7a8a..77def6daa1 100644 --- a/drivers/net/octeon_ep/otx_ep_ethdev.c +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c @@ -387,6 +387,22 @@ otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev, return 0; } +static int +otx_ep_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete) +{ + RTE_SET_USED(wait_to_complete); + + if (!eth_dev->data->dev_started) + return 0; + struct rte_eth_link link; + + memset(&link, 0, sizeof(link)); + link.link_status = RTE_ETH_LINK_UP; + link.link_speed = RTE_ETH_SPEED_NUM_10G; + link.link_duplex = RTE_ETH_LINK_FULL_DUPLEX; + return rte_eth_linkstatus_set(eth_dev, &link); +} + /* Define our ethernet definitions */ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .dev_configure = otx_ep_dev_configure, @@ -399,6 +415,7 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = { .dev_infos_get = otx_ep_dev_info_get, .stats_get = otx_ep_dev_stats_get, .stats_reset = otx_ep_dev_stats_reset, + .link_update = otx_ep_dev_link_update, }; static int