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 17FE2A04A2 for ; Tue, 12 May 2020 02:46:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E9BF71C0CD; Tue, 12 May 2020 02:46:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 378661C07E; Tue, 12 May 2020 02:46:30 +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 04C0jtWF027544; Mon, 11 May 2020 17:46:29 -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=pfpt0818; bh=2zY2FN8XFlRE9fZ2V6wQP/7lgh0oMl3vgnLM3KEA4UA=; b=amYjFF71R89js2lTeL1ok/FUOmShFa7vHXFHU8ewQsGTWfeBpnzaVbWnMnKTx4pM4E3/ 7qF0YNAwiVIi9r1sU73ZVupCox55RZYSnGScpxfO5YWnygtErBjxFXQO4xt4lnYa8rwT RhL6YQ+6K0dBKFvWUSZhvfC/zlxTik1/VacK+eHjmeW+hFaGtLRehFrgS/JYcjzODjeZ 6M0BxsUiQ6C8ICi0z0kKlqflWyTURoJ4dd2xzyAcARzIVPbo1ggL2Gzd4/4CiDg6QBtB DvLlkx3hkHR5//ZZPQWlD7X8y0ymiSzGqT7BG+k9S3fJMNcseQ7agn7Rr9Ra54xcfixU jg== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 30wv1n8x9r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 11 May 2020 17:46:29 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 May 2020 17:46:27 -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.2 via Frontend Transport; Mon, 11 May 2020 17:46:27 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 1FC0D3F703F; Mon, 11 May 2020 17:46:27 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 04C0kQa6011164; Mon, 11 May 2020 17:46:26 -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: Mon, 11 May 2020 17:46:24 -0700 Message-ID: <20200512004624.11114-1-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 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-11_11:2020-05-11, 2020-05-11 signatures=0 Subject: [dpdk-stable] [PATCH] net/qede: fix link state configuration X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 bcd8252d9..9a5847076 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1150,6 +1150,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); @@ -1179,6 +1182,12 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev) */ qede_assign_rxtx_handlers(eth_dev, true); + /* 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; @@ -1563,8 +1572,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); @@ -2671,9 +2678,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