From d07bd65ba131e684f9fce2c66a70989d26296687 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 24 Oct 2010 11:58:34 +0000 Subject: [PATCH] ib_srpt: Moved a source code comment. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2458 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 7941fc7e3..7b5ca1d10 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1754,6 +1754,21 @@ static void srpt_process_rcv_completion(struct ib_cq *cq, } } +/** + * srpt_process_send_completion() - Process an IB send completion. + * + * Note: Although this has not yet been observed during tests, at least in + * theory it is possible that the srpt_get_send_ioctx() call invoked by + * srpt_handle_new_iu() fails. This is possible because the req_lim_delta + * value in each response is set to one, and it is possible that this response + * makes the initiator send a new request before the send completion for that + * response has been processed. This could e.g. happen if the call to + * srpt_put_send_iotcx() is delayed because of a higher priority interrupt or + * if IB retransmission causes generation of the send completion to be + * delayed. Incoming information units for which srpt_get_send_ioctx() fails + * are queued on cmd_wait_list. The code below processes these delayed + * requests one at a time. + */ static void srpt_process_send_completion(struct ib_cq *cq, struct srpt_rdma_ch *ch, enum scst_exec_context context, @@ -1788,22 +1803,6 @@ static void srpt_process_send_completion(struct ib_cq *cq, } } - /* - * Although this has not yet been observed during tests, at least in - * theory it is possible that the srpt_get_send_ioctx() call invoked - * by srpt_handle_new_iu() fails. This is possible because the - * req_lim_delta value in each response is set to one, and it is - * possible that this response makes the initiator send a new request - * before the send completion for that response has been - * processed. This could e.g. happen if the call to - * srpt_put_send_iotcx() is delayed because of a higher priority - * interrupt or if IB retransmission causes generation of the send - * completion to be delayed. Incoming information units for which - * srpt_get_send_ioctx() fails are queued on cmd_wait_list. The code - * below processes these delayed requests one at a time. The code - * below has been tested by setting the req_lim_delta value in the - * SRP_LOGIN_RSP response to a higher value than ch->req_lim. - */ while (unlikely(opcode == IB_WC_SEND && !list_empty(&ch->cmd_wait_list) && atomic_read(&ch->state) == RDMA_CHANNEL_LIVE