From patchwork Fri Jul 1 08:00:50 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: 113600 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 A2010A00C2; Fri, 1 Jul 2022 10:00:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90ACC40A7B; Fri, 1 Jul 2022 10:00:58 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id DA34A40150 for ; Fri, 1 Jul 2022 10:00:55 +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 2612APlr012714 for ; Fri, 1 Jul 2022 01:00:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=wUTcIIPHZ3oV3WRM7f1k1XiEihCzOdwSIYPSoAvmNA0=; b=UlGbofegZ//NC4ersZWuw95/1tt+3aqkjS2vwWOL3ht0ih6dE2+fcZcDUybQruQr/qAW B64JlN+4MHqs8AWxY25fmYAV7unOWLNR5U7gg3aZwYnA03Iz8m86QSFhu99KA2aejPlI 9RxbFLnztGuJ93nKVQNv84c/5WJOROZZ1Dri4z1vJr1tpfmKFGNlMtjVwKm4mnsl2Tkz 9TL1MAektZoSQNySkk+jwN61ZuTpQ6tt55FVLg5cjcpTFKwjEL153OWsXHMedMCnFr2c BcuQL1qQIJPvMvXnFBKd/i4c2UiH8Vtp/I4+DxR5ZMcZEpJy+eOG42vSIMGIvFmIVKsD 8Q== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3h1akbmmaq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 01 Jul 2022 01:00:54 -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.18; Fri, 1 Jul 2022 01:00:53 -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; Fri, 1 Jul 2022 01:00:53 -0700 Received: from setup-1.caveonetworks.com (unknown [10.106.27.161]) by maili.marvell.com (Postfix) with ESMTP id 480C73F705A; Fri, 1 Jul 2022 01:00:53 -0700 (PDT) From: Sathesh Edara To: , , , "Nalla Pradeep" , Radha Mohan Chintakuntla , Veerasenareddy Burru CC: Subject: [PATCH 2/2] net/octeontx_ep: support link status Date: Fri, 1 Jul 2022 01:00:50 -0700 Message-ID: <20220701080050.148189-1-sedara@marvell.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Proofpoint-GUID: zIrrs0SxTU40kEWw7NNykmcLr7UgljmC X-Proofpoint-ORIG-GUID: zIrrs0SxTU40kEWw7NNykmcLr7UgljmC 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-01_05,2022-06-28_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/octeontx_ep.ini | 1 + drivers/net/octeontx_ep/otx_ep_ethdev.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/guides/nics/features/octeontx_ep.ini b/doc/guides/nics/features/octeontx_ep.ini index e0c469676e..1423963adc 100644 --- a/doc/guides/nics/features/octeontx_ep.ini +++ b/doc/guides/nics/features/octeontx_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/octeontx_ep/otx_ep_ethdev.c b/drivers/net/octeontx_ep/otx_ep_ethdev.c index cb45bd7a8a..a44c8f5217 100644 --- a/drivers/net/octeontx_ep/otx_ep_ethdev.c +++ b/drivers/net/octeontx_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_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_link_update, }; static int