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 30657A0C4B; Wed, 7 Jul 2021 18:49:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E58D2413DB; Wed, 7 Jul 2021 18:49:49 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 689F3413B6 for ; Wed, 7 Jul 2021 18:49:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167GkjOG029236 for ; Wed, 7 Jul 2021 09:49:48 -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-type; s=pfpt0220; bh=p29IEBmjJarPjSwbLenngK0DVuLnv0fOdx5+KdtRenI=; b=eZcFmurpn4c/evWUdD7t1AMu+UFDXYfu3dW2/KNLiIFIeInT2iMlSPzxgJzDsTJu1Zd3 aN362Z8kPN74Lb3nMWVZkILB2+dAYZQYqlARG1hHSGheC0zR+HM1Z5fuZUOoghAzrdjI 7HP90wUs1z/MlrsI1iiqOCDXjnnFuN+KIA9wtl40PhQRKdX2ZrinIylpAxyT9rF+cIAn 7Go+MycYZ+dPwLGo8KrKZ/4haDoZq2FYqqFcQAxT2ZfUW88GdKbU4n63ZGpwr/gCZMxt Ia8AAh1dGK5OxoTSW9o0TPULvsDbrru3CSAgwUZovom+d1Mfnv8X1RfYpU+eleUX5sfa lg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 39nfapr7g5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 07 Jul 2021 09:49:48 -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, 7 Jul 2021 09:49:46 -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, 7 Jul 2021 09:49:46 -0700 Received: from cavium.marvell.com (cavium.marvell.com [10.28.34.244]) by maili.marvell.com (Postfix) with ESMTP id 051C73F707D; Wed, 7 Jul 2021 09:49:44 -0700 (PDT) From: To: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K CC: , Satha Rao Date: Wed, 7 Jul 2021 12:49:15 -0400 Message-ID: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: zYPXDz2gJb1prbpNWLG70YeI1zgdHSDQ X-Proofpoint-GUID: zYPXDz2gJb1prbpNWLG70YeI1zgdHSDQ X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-07_08:2021-07-06, 2021-07-07 signatures=0 Subject: [dpdk-dev] [PATCH 1/3] net/octeontx2: handle link status when device stopped 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 Sender: "dev" From: Satha Rao Set link status to down and don't fetch link status from kernel when device in stopped state. Signed-off-by: Satha Rao --- drivers/net/octeontx2/otx2_ethdev.c | 5 +++++ drivers/net/octeontx2/otx2_link.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index 84225f4..ac53d8c 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -2171,6 +2171,7 @@ struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); struct rte_mbuf *rx_pkts[32]; struct otx2_eth_rxq *rxq; + struct rte_eth_link link; int count, i, j, rc; nix_lf_switch_header_type_enable(dev, false); @@ -2196,6 +2197,10 @@ for (i = 0; i < eth_dev->data->nb_tx_queues; i++) otx2_nix_tx_queue_stop(eth_dev, i); + /* Bring down link status internally */ + memset(&link, 0, sizeof(link)); + rte_eth_linkstatus_set(eth_dev, &link); + return 0; } diff --git a/drivers/net/octeontx2/otx2_link.c b/drivers/net/octeontx2/otx2_link.c index 5378e5c..81dd624 100644 --- a/drivers/net/octeontx2/otx2_link.c +++ b/drivers/net/octeontx2/otx2_link.c @@ -148,7 +148,7 @@ RTE_SET_USED(wait_to_complete); memset(&link, 0, sizeof(struct rte_eth_link)); - if (otx2_dev_is_sdp(dev)) + if (!eth_dev->data->dev_started || otx2_dev_is_sdp(dev)) return 0; if (otx2_dev_is_lbk(dev)) -- 1.8.3.1