From e61e0beae602a4194d73d829c6deaddc47369e45 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 20 Mar 2014 15:19:05 +0000 Subject: [PATCH] ib_srpt: Sync information unit memory only once git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5351 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index e63f9bf2e..1b5f173b0 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1856,14 +1856,14 @@ srpt_handle_new_iu(struct srpt_rdma_ch *ch, BUG_ON(!ch); BUG_ON(!recv_ioctx); + if (unlikely(ch->state == CH_CONNECTING)) + goto push; + ib_dma_sync_single_for_cpu(ch->sport->sdev->device, recv_ioctx->ioctx.dma, srp_max_req_size, DMA_FROM_DEVICE); srp_cmd = recv_ioctx->ioctx.buf; - if (unlikely(ch->state == CH_CONNECTING)) - goto push; - if (srp_cmd->opcode == SRP_CMD || srp_cmd->opcode == SRP_TSK_MGMT) { send_ioctx = srpt_get_send_ioctx(ch); if (unlikely(!send_ioctx))