From 6944885268d996c618bc1d596c9590fc6470764b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 26 Mar 2014 11:59:37 +0000 Subject: [PATCH] ib_srpt: Suppress superfluous error messages Only complain about a missing completion for I/O contexts that are in a state where the ib_srpt driver is waiting for the HCA. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5392 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index ee4ae232c..0e300a436 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1404,10 +1404,27 @@ void srpt_on_abort_cmd(struct scst_cmd *cmd) struct srpt_rdma_ch *ch = ioctx->ch; if (ch->state >= CH_DISCONNECTED) { - PRINT_ERROR("Cmd %p: IB completion for idx %u has not" - " been received in time (SRPT command state %d)", - cmd, ioctx->ioctx.index, ioctx->state); - srpt_abort_cmd(ioctx, SCST_CONTEXT_THREAD); + switch (ioctx->state) { + case SRPT_STATE_NEW: + case SRPT_STATE_DATA_IN: + case SRPT_STATE_MGMT: + case SRPT_STATE_DONE: + /* + * An SCST command thread is busy processing the + * command associated with the I/O context, so wait + * until that processing has finished. + */ + break; + case SRPT_STATE_NEED_DATA: + case SRPT_STATE_CMD_RSP_SENT: + case SRPT_STATE_MGMT_RSP_SENT: + PRINT_ERROR("Cmd %p: IB completion for idx %u has not" + " been received in time (SRPT command state" + " %d)", cmd, ioctx->ioctx.index, + ioctx->state); + srpt_abort_cmd(ioctx, SCST_CONTEXT_THREAD); + break; + } } }