From: Rasesh Mody Date: Fri, 2 Oct 2020 19:59:45 +0000 (-0700) Subject: net/qede: fix getting link details X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=effb1d0b9527815a7cd5422bce5defbc0884cea0;p=dpdk.git net/qede: fix getting link details 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 --- diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index 0d3cea6e42..caa9d1d4f6 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -587,13 +587,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); }