patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/qede: fix get link details
@ 2020-10-01 22:41 Rasesh Mody
  2020-10-02 19:59 ` [dpdk-stable] [PATCH v2] " Rasesh Mody
  2020-10-02 20:02 ` [dpdk-stable] [PATCH] " Rasesh Mody
  0 siblings, 2 replies; 4+ messages in thread
From: Rasesh Mody @ 2020-10-01 22:41 UTC (permalink / raw)
  To: Jerin Jacob, Ferruh Yigit, dev
  Cc: stable, Igor Russkikh, GR-Everest-DPDK-Dev, Rasesh Mody

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 <ferruh.yigit@intel.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com> 
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-04  8:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01 22:41 [dpdk-stable] [PATCH] net/qede: fix get link details Rasesh Mody
2020-10-02 19:59 ` [dpdk-stable] [PATCH v2] " Rasesh Mody
2020-10-04  8:37   ` Jerin Jacob
2020-10-02 20:02 ` [dpdk-stable] [PATCH] " Rasesh Mody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).