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 18215A04BC for ; Fri, 2 Oct 2020 00:41:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF9491D5CC; Fri, 2 Oct 2020 00:41:42 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id B148F1D5B1; Fri, 2 Oct 2020 00:41:38 +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 091MdxUI020123; Thu, 1 Oct 2020 15:41:36 -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=c225od9c6zSsODCAbKnOWqAiqnR/r9PUQsHxgjigtus=; b=dUZaBWiwSc0QYrLJM6UqWkXKp2ROmgjUFIWVWqtzFedS8GhGps/Zdh4KCdcdC7HuzS5c Sp27n4EHUIC1z58YRdKej00RoYGZhcn1DKIT9G4WE3UqEBeaAfDjnIXGXcr/8ouy/RIt sVJUsUR4N1FhIiF3Dm/kgpXvxhac+OskFu1DiwDdPRZRvgn9agGSNo+w2MfAF0ucBUZ0 DUmaBEMEZU6/LRhgKYKr5GMYrKG3VeuDOjHNUirY+QsyPaEaR4feRIeYD6AMs9cvzL1A Ek7q/+CUONhb9Wm1DCpDtCuinZ7uUDeai4j4fg62D9S4CCJt0ti7nCK1UmKeqt0SF0mH Ow== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 33t55pgb99-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 01 Oct 2020 15:41:36 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 1 Oct 2020 15:41:34 -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; Thu, 1 Oct 2020 15:41:35 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 0A5E23F7040; Thu, 1 Oct 2020 15:41:35 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 091MfYrF015266; Thu, 1 Oct 2020 15:41:34 -0700 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: Jerin Jacob , Ferruh Yigit , CC: , Igor Russkikh , GR-Everest-DPDK-Dev , Rasesh Mody Date: Thu, 1 Oct 2020 15:41:28 -0700 Message-ID: <20201001224128.15222-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.235, 18.0.687 definitions=2020-10-01_10:2020-10-01, 2020-10-01 signatures=0 Subject: [dpdk-stable] [PATCH] net/qede: fix get link details 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" This patch fixes get current link details, without this change the link details can be inaccurate if proper lock is not acquired. Fixes: 739a5b2f2b49 ("net/qede/base: use passed ptt handler") Cc: stable@dpdk.org Reported-by: Ferruh Yigit Signed-off-by: Rasesh Mody Signed-off-by: Igor Russkikh --- drivers/net/qede/qede_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index aecb98261..f0ca3373f 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -584,13 +584,12 @@ qed_get_current_link(struct ecore_dev *edev, struct qed_link_output *if_link) hwfn = &edev->hwfns[0]; if (IS_PF(edev)) { ptt = ecore_ptt_acquire(hwfn); - if (!ptt) - DP_NOTICE(hwfn, true, "Failed to fill link; No PTT\n"); - + if (ptt) { qed_fill_link(hwfn, ptt, if_link); - - if (ptt) ecore_ptt_release(hwfn, ptt); + } else { + DP_NOTICE(hwfn, "Failed to fill link; No PTT\n"); + } } else { qed_fill_link(hwfn, NULL, if_link); } -- 2.18.1