aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-07-08 15:58:43 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-07-16 20:35:18 -0400
commite672a47fd99b47589dfe2f85759e4c8de526196b (patch)
tree9fce33779b7adfef449c5524a97300789c93a8dd /drivers/infiniband
parent67441b68fa73af1c578ccc1d85671b163a7adc13 (diff)
srpt: use target_execute_cmd for WRITEs in srpt_handle_rdma_comp
srpt_handle_rdma_comp is called from kthread context and thus can execute target_execute_cmd directly. srpt_abort_cmd sets the CMD_T_LUN_STOP flag directly, and thus the abuse of transport_generic_handle_data can be replaced with an opencoded variant of that code path. I'm still not happy about a fabric driver poking into target core internals like this, but let's defer the bigger architecture changes for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/srpt/ib_srpt.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 5f6b7f63cdef..7a0ce8d42887 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1377,10 +1377,14 @@ static int srpt_abort_cmd(struct srpt_send_ioctx *ioctx)
1377 break; 1377 break;
1378 case SRPT_STATE_NEED_DATA: 1378 case SRPT_STATE_NEED_DATA:
1379 /* DMA_TO_DEVICE (write) - RDMA read error. */ 1379 /* DMA_TO_DEVICE (write) - RDMA read error. */
1380
1381 /* XXX(hch): this is a horrible layering violation.. */
1380 spin_lock_irqsave(&ioctx->cmd.t_state_lock, flags); 1382 spin_lock_irqsave(&ioctx->cmd.t_state_lock, flags);
1381 ioctx->cmd.transport_state |= CMD_T_LUN_STOP; 1383 ioctx->cmd.transport_state |= CMD_T_LUN_STOP;
1384 ioctx->cmd.transport_state &= ~CMD_T_ACTIVE;
1382 spin_unlock_irqrestore(&ioctx->cmd.t_state_lock, flags); 1385 spin_unlock_irqrestore(&ioctx->cmd.t_state_lock, flags);
1383 transport_generic_handle_data(&ioctx->cmd); 1386
1387 complete(&ioctx->cmd.transport_lun_stop_comp);
1384 break; 1388 break;
1385 case SRPT_STATE_CMD_RSP_SENT: 1389 case SRPT_STATE_CMD_RSP_SENT:
1386 /* 1390 /*
@@ -1463,9 +1467,10 @@ static void srpt_handle_send_comp(struct srpt_rdma_ch *ch,
1463/** 1467/**
1464 * srpt_handle_rdma_comp() - Process an IB RDMA completion notification. 1468 * srpt_handle_rdma_comp() - Process an IB RDMA completion notification.
1465 * 1469 *
1466 * Note: transport_generic_handle_data() is asynchronous so unmapping the 1470 * XXX: what is now target_execute_cmd used to be asynchronous, and unmapping
1467 * data that has been transferred via IB RDMA must be postponed until the 1471 * the data that has been transferred via IB RDMA had to be postponed until the
1468 * check_stop_free() callback. 1472 * check_stop_free() callback. None of this is nessecary anymore and needs to
1473 * be cleaned up.
1469 */ 1474 */
1470static void srpt_handle_rdma_comp(struct srpt_rdma_ch *ch, 1475static void srpt_handle_rdma_comp(struct srpt_rdma_ch *ch,
1471 struct srpt_send_ioctx *ioctx, 1476 struct srpt_send_ioctx *ioctx,
@@ -1477,7 +1482,7 @@ static void srpt_handle_rdma_comp(struct srpt_rdma_ch *ch,
1477 if (opcode == SRPT_RDMA_READ_LAST) { 1482 if (opcode == SRPT_RDMA_READ_LAST) {
1478 if (srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA, 1483 if (srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA,
1479 SRPT_STATE_DATA_IN)) 1484 SRPT_STATE_DATA_IN))
1480 transport_generic_handle_data(&ioctx->cmd); 1485 target_execute_cmd(&ioctx->cmd);
1481 else 1486 else
1482 printk(KERN_ERR "%s[%d]: wrong state = %d\n", __func__, 1487 printk(KERN_ERR "%s[%d]: wrong state = %d\n", __func__,
1483 __LINE__, srpt_get_cmd_state(ioctx)); 1488 __LINE__, srpt_get_cmd_state(ioctx));