From a8d02fbfca3def7a531135c30c7452b0170fc625 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 22 Jul 2010 05:54:55 +0000 Subject: [PATCH] Enabled rdy_to_xfer_atomic for mode thread=0. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1855 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 3a4b1c162..b016dfe7c 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1173,6 +1173,7 @@ static void srpt_abort_scst_cmd(struct srpt_ioctx *ioctx, * Do nothing - defer abort processing until * srpt_xmit_response() is invoked. */ + WARN_ON(!scst_cmd_aborted(scmnd)); break; case SRPT_STATE_NEED_DATA: /* RDMA read error or RDMA read timeout. */ @@ -3101,8 +3102,6 @@ static int srpt_xmit_response(struct scst_cmd *scmnd) int dir; int resp_len; - EXTRACHECKS_BUG_ON(scst_cmd_atomic(scmnd)); - ioctx = scst_cmd_get_tgt_priv(scmnd); BUG_ON(!ioctx); @@ -3115,6 +3114,11 @@ static int srpt_xmit_response(struct scst_cmd *scmnd) goto out; } + if (scst_cmd_atomic(scmnd) && srpt_must_wait_for_cred(ch, 2)) { + ret = SCST_TGT_RES_NEED_THREAD_CTX; + goto out; + } + srpt_wait_for_cred(ch, 2); new_state = srpt_set_cmd_state(ioctx, SRPT_STATE_CMD_RSP_SENT); @@ -3831,17 +3835,20 @@ static int __init srpt_init_module(void) /* IRQ context */ srpt_context = SCST_CONTEXT_TASKLET; srpt_template.rdy_to_xfer_atomic = true; + srpt_template.xmit_response_atomic = true; break; case MODE_SINGLE_THREADED: /* single kernel thread (created by ib_srpt) */ srpt_context = SCST_CONTEXT_DIRECT; srpt_template.rdy_to_xfer_atomic = false; + srpt_template.xmit_response_atomic = false; break; case MODE_MULTITHREADED: default: /* multiple kernel threads (created by the SCST core) */ srpt_context = SCST_CONTEXT_THREAD; srpt_template.rdy_to_xfer_atomic = false; + srpt_template.xmit_response_atomic = false; break; }