Commit 1020e1ef authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

net/smc: move testlink work to system work queue

The testlink work waits for a response to the testlink request and
blocks the single threaded llc_wq. This type of work does not have to be
serialized and can be moved to the system work queue.
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d854fcbf
...@@ -613,14 +613,15 @@ static void smc_llc_testlink_work(struct work_struct *work) ...@@ -613,14 +613,15 @@ static void smc_llc_testlink_work(struct work_struct *work)
/* receive TEST LINK response over RoCE fabric */ /* receive TEST LINK response over RoCE fabric */
rc = wait_for_completion_interruptible_timeout(&link->llc_testlink_resp, rc = wait_for_completion_interruptible_timeout(&link->llc_testlink_resp,
SMC_LLC_WAIT_TIME); SMC_LLC_WAIT_TIME);
if (link->state != SMC_LNK_ACTIVE)
return; /* link state changed */
if (rc <= 0) { if (rc <= 0) {
smc_lgr_terminate_sched(smc_get_lgr(link)); smc_lgr_terminate_sched(smc_get_lgr(link));
return; return;
} }
next_interval = link->llc_testlink_time; next_interval = link->llc_testlink_time;
out: out:
queue_delayed_work(link->llc_wq, &link->llc_testlink_wrk, schedule_delayed_work(&link->llc_testlink_wrk, next_interval);
next_interval);
} }
int smc_llc_link_init(struct smc_link *link) int smc_llc_link_init(struct smc_link *link)
...@@ -648,8 +649,8 @@ void smc_llc_link_active(struct smc_link *link, int testlink_time) ...@@ -648,8 +649,8 @@ void smc_llc_link_active(struct smc_link *link, int testlink_time)
link->state = SMC_LNK_ACTIVE; link->state = SMC_LNK_ACTIVE;
if (testlink_time) { if (testlink_time) {
link->llc_testlink_time = testlink_time * HZ; link->llc_testlink_time = testlink_time * HZ;
queue_delayed_work(link->llc_wq, &link->llc_testlink_wrk, schedule_delayed_work(&link->llc_testlink_wrk,
link->llc_testlink_time); link->llc_testlink_time);
} }
} }
...@@ -665,7 +666,7 @@ void smc_llc_link_inactive(struct smc_link *link) ...@@ -665,7 +666,7 @@ void smc_llc_link_inactive(struct smc_link *link)
if (link->state == SMC_LNK_INACTIVE) if (link->state == SMC_LNK_INACTIVE)
return; return;
link->state = SMC_LNK_INACTIVE; link->state = SMC_LNK_INACTIVE;
cancel_delayed_work(&link->llc_testlink_wrk); cancel_delayed_work_sync(&link->llc_testlink_wrk);
smc_wr_wakeup_reg_wait(link); smc_wr_wakeup_reg_wait(link);
smc_wr_wakeup_tx_wait(link); smc_wr_wakeup_tx_wait(link);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment