[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200324141348.7897-3-ybason@marvell.com>
Date: Tue, 24 Mar 2020 16:13:47 +0200
From: Yuval Basson <ybason@...vell.com>
To: <davem@...emloft.net>, <netdev@...r.kernel.org>
CC: Yuval Basson <ybason@...vell.com>,
Denis Bolotin <dbolotin@...vell.com>
Subject: [PATCH net-next 2/3] qed: Add a flag for rescheduling the slowpath task
Rechedule delayed work in case ptt_acquire failed.
Since it is the same task don't reset task's flags.
Signed-off-by: Yuval Basson <ybason@...vell.com>
Signed-off-by: Denis Bolotin <dbolotin@...vell.com>
---
drivers/net/ethernet/qlogic/qed/qed.h | 1 +
drivers/net/ethernet/qlogic/qed/qed_main.c | 15 +++++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed.h b/drivers/net/ethernet/qlogic/qed/qed.h
index ca866c2..e3b238e 100644
--- a/drivers/net/ethernet/qlogic/qed/qed.h
+++ b/drivers/net/ethernet/qlogic/qed/qed.h
@@ -566,6 +566,7 @@ enum qed_slowpath_wq_flag {
QED_SLOWPATH_MFW_TLV_REQ,
QED_SLOWPATH_PERIODIC_DB_REC,
QED_SLOWPATH_ACTIVE,
+ QED_SLOWPATH_RESCHEDULE,
};
struct qed_hwfn {
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 016d658..fb13863 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -1098,10 +1098,13 @@ static int qed_slowpath_delayed_work(struct qed_hwfn *hwfn,
if (!test_bit(QED_SLOWPATH_ACTIVE, &hwfn->slowpath_task_flags))
return -EINVAL;
- /* Memory barrier for setting atomic bit */
- smp_mb__before_atomic();
- set_bit(wq_flag, &hwfn->slowpath_task_flags);
- smp_mb__after_atomic();
+ if (wq_flag != QED_SLOWPATH_RESCHEDULE) {
+ /* Memory barrier for setting atomic bit */
+ smp_mb__before_atomic();
+ set_bit(wq_flag, &hwfn->slowpath_task_flags);
+ smp_mb__after_atomic();
+ }
+
queue_delayed_work(hwfn->slowpath_wq, &hwfn->slowpath_task, delay);
return 0;
@@ -1155,8 +1158,8 @@ static void qed_slowpath_task(struct work_struct *work)
if (!ptt) {
if (test_bit(QED_SLOWPATH_ACTIVE, &hwfn->slowpath_task_flags))
- queue_delayed_work(hwfn->slowpath_wq,
- &hwfn->slowpath_task, 0);
+ qed_slowpath_delayed_work(hwfn,
+ QED_SLOWPATH_RESCHEDULE, 0);
return;
}
--
1.8.3.1
Powered by blists - more mailing lists