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 15A5BA04B6 for ; Fri, 2 Oct 2020 22:00:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3ECD1D583; Fri, 2 Oct 2020 22:00:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C0A921D502; Fri, 2 Oct 2020 22:00:17 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 092JjtMZ021318; Fri, 2 Oct 2020 13:00:15 -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=/1YdS3B/J/bhgzvdle77/fczXqxUk6GoDCs+DxnDAKc=; b=Fsy9VDIJhJMjQG/orTPnhGtIelC15yJwl+LKhzI392d/QFvDSMpbGKcm4UGzu/F8LoJz C+TjrHErRH+OwPinJW6cWC5aLKXQFHtch+tUbMTUqTUEqOGsbM3W30tEIvloj0qRoQ9s mXjqHmBceTOtIMxh+I+PLFkUuJPME2Ui6KvBKVXbgUzZ04RoRDW+oTC/8OEg8ezwg6Re onzGozy5Or3yNAm/GCln56aP2J+MzmVTWnzgkZDZI5iGfcEu4V5WxxsokY3YkNYDqfSz TbKnEtc8Bf3zwv28McvxJ1Hw10DNWYLVg0uDJwWjfn8TynOwhzdoyitSMfB/KUKGQ6kb Aw== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 33wjds46yg-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 02 Oct 2020 13:00:15 -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; Fri, 2 Oct 2020 13:00:14 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 2 Oct 2020 13:00:13 -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; Fri, 2 Oct 2020 13:00:13 -0700 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id 6EF503F704E; Fri, 2 Oct 2020 13:00:13 -0700 (PDT) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id 092K0D40020412; Fri, 2 Oct 2020 13:00:13 -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: Fri, 2 Oct 2020 12:59:45 -0700 Message-ID: <20201002195945.20343-1-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20201001224128.15222-1-rmody@marvell.com> References: <20201001224128.15222-1-rmody@marvell.com> 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-02_14:2020-10-02, 2020-10-02 signatures=0 Subject: [dpdk-stable] [PATCH v2] 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..1ae10d99d 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, true, "Failed to fill link; No PTT\n"); + } } else { qed_fill_link(hwfn, NULL, if_link); } -- 2.18.1