From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E8C8A00C3; Thu, 14 May 2020 06:09:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9BA791D626; Thu, 14 May 2020 06:09:10 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A913B1D5FF; Thu, 14 May 2020 06:09:08 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04E3xrcD012253; Wed, 13 May 2020 21:09:07 -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=pfpt0818; bh=51+kuWt+AmB1TNmAKerlVBiSqItWK+us9UGQVDAP8WA=; b=KVc0cCu2MYmuDyBH09YsrILHpMlI3rf8gejTzJms7wAspDS3EZ/YlF7xpa514tzDmutg 7ASWmAzOPP/hrleIvvCYN3M3MnbTu6EV5HHZX6PP7AMxEEQuIZ/trsUvvl+nlTdZm7Ah vk9zfZB+1P3ca2y8x3lEl2cvceaqkqFrzN6q9WrtXUtNKUKTiUgQ1FgmEXxTMBLGQPtk BohDkdlbKxabcFnBHmWCGfe/ujk+DUb7A6dnt4IfYZdmoZNDLfCGFjPgy/tKmPoX2397 j5Uu9SHPk9U8lb+kEQYv5brQsG2PzdKwgk+irm9pyraOLvTsCZSXy+M7AxkSTQEelrRB Zg== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3100xk0ekb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 13 May 2020 21:09:06 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 13 May 2020 21:09:04 -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, 13 May 2020 21:09:05 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 18AFA3F703F; Wed, 13 May 2020 21:09:05 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 04E494l7025406; Wed, 13 May 2020 21:09:04 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: , , CC: Rasesh Mody , , , Shahed Shaikh , Igor Russkikh Date: Wed, 13 May 2020 21:09:02 -0700 Message-ID: <20200514040902.25341-1-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200512004624.11114-1-rmody@marvell.com> References: <20200512004624.11114-1-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-13_09:2020-05-13, 2020-05-13 signatures=0 Subject: [dpdk-dev] [PATCH v2] net/qede: fix link state configuration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Move link state enable/disable to dev_start() and dev_stop() respectively. This will ensure when devices are stopped, link status will be appropriately shown as down. Fixes: dd28bc8c6ef4 ("net/qede: fix VF port creation sequence") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh Signed-off-by: Rasesh Mody Signed-off-by: Igor Russkikh --- drivers/net/qede/qede_ethdev.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index e71fa1e6a..0b1fca9ac 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1144,6 +1144,9 @@ static int qede_dev_start(struct rte_eth_dev *eth_dev) if (qede_activate_vport(eth_dev, true)) goto err; + /* Bring-up the link */ + qede_dev_set_link_state(eth_dev, true); + /* Update link status */ qede_link_update(eth_dev, 0); @@ -1166,6 +1169,12 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev) PMD_INIT_FUNC_TRACE(edev); + /* Bring the link down */ + qede_dev_set_link_state(eth_dev, false); + + /* Update link status */ + qede_link_update(eth_dev, 0); + /* Disable vport */ if (qede_activate_vport(eth_dev, false)) return; @@ -1550,8 +1559,6 @@ static void qede_dev_close(struct rte_eth_dev *eth_dev) eth_dev->data->nb_rx_queues = 0; eth_dev->data->nb_tx_queues = 0; - /* Bring the link down */ - qede_dev_set_link_state(eth_dev, false); qdev->ops->common->slowpath_stop(edev); qdev->ops->common->remove(edev); rte_intr_disable(&pci_dev->intr_handle); @@ -2672,9 +2679,6 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) eth_dev->dev_ops = (is_vf) ? &qede_eth_vf_dev_ops : &qede_eth_dev_ops; - /* Bring-up the link */ - qede_dev_set_link_state(eth_dev, true); - adapter->num_tx_queues = 0; adapter->num_rx_queues = 0; SLIST_INIT(&adapter->arfs_info.arfs_list_head); -- 2.18.0