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>
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);
}