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 50E1FA0C4B; Wed, 7 Jul 2021 18:50:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34730413EE; Wed, 7 Jul 2021 18:50:09 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 82606413B6 for ; Wed, 7 Jul 2021 18:50:07 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167GihVc026528 for ; Wed, 7 Jul 2021 09:50:06 -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-type; s=pfpt0220; bh=nCOj6wWvA7ziwl/l4P1KUVzWGuAMgLJBL+QJxmnVLB0=; b=Z3v3YVYYHQmb1bVyBeOqMLc3qXZRlbr3FcngRddUkdvHFYqF+h+jPlATPKx8YSSrT/vY iXa64B583HjCPpInI2TGFOfSJkQqMWbFWLf1ao/b5esxBPfMqQ5qBUyBm0BvEG/g5crf CKwJk343Aa/IlqrFIkY+kV6Oqp2E7yMG7V2MapPDbguPM2VkPPplsFKbrf8/G5eE3zjo LSf9gRKbEavAmYOekSO7RMUs+BG2URdVgQiTxh+1Pf1IWVm1KfedEs+innezrdTEcn0h y1aIRNDjqisTTkaJ16C7VwDgb1vFRIrUE0Md+sr38OY6UzU5AGQYVWCSTn7zCH/apan9 xA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 39n5tg2s4j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 07 Jul 2021 09:50:06 -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:50:05 -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:50:05 -0700 Received: from cavium.marvell.com (cavium.marvell.com [10.28.34.244]) by maili.marvell.com (Postfix) with ESMTP id 96D943F70CF; Wed, 7 Jul 2021 09:50:01 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: Date: Wed, 7 Jul 2021 12:49:17 -0400 Message-ID: <1625676557-2269-3-git-send-email-skoteshwar@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> References: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: XX_WzqtlgzpGaPtiqwf_VpoxvpghyAPj X-Proofpoint-ORIG-GUID: XX_WzqtlgzpGaPtiqwf_VpoxvpghyAPj 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 3/3] net/cnxk: update 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/cnxk/cnxk_ethdev.c | 5 +++++ drivers/net/cnxk/cnxk_link.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 7adab46..0e3652e 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1096,6 +1096,7 @@ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); const struct eth_dev_ops *dev_ops = eth_dev->dev_ops; struct rte_mbuf *rx_pkts[32]; + struct rte_eth_link link; int count, i, j, rc; void *rxq; @@ -1128,6 +1129,10 @@ for (i = 0; i < eth_dev->data->nb_tx_queues; i++) dev_ops->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/cnxk/cnxk_link.c b/drivers/net/cnxk/cnxk_link.c index caf35ee..3fdbdba 100644 --- a/drivers/net/cnxk/cnxk_link.c +++ b/drivers/net/cnxk/cnxk_link.c @@ -90,7 +90,7 @@ RTE_SET_USED(wait_to_complete); memset(&link, 0, sizeof(struct rte_eth_link)); - if (roc_nix_is_sdp(&dev->nix)) + if (!eth_dev->data->dev_started || roc_nix_is_sdp(&dev->nix)) return 0; if (roc_nix_is_lbk(&dev->nix)) { -- 1.8.3.1