diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2014-10-01 07:02:12 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-10-09 03:06:07 -0400 |
commit | 6df5a128f0fde6315a44e80b30412997147f5efd (patch) | |
tree | b26b887f909b95f22ff9360d1180ef8321774783 /drivers/infiniband | |
parent | 6e6fe2fb1d61b4baef1cf350049c6877583681ee (diff) |
IB/iser: Suppress scsi command send completions
Singal completion of every 32 scsi commands and suppress all the rest.
We don't do anything upon getting the completion so no need to "just
consume" it. Cleanup of scsi command is done in cleanup_task callback.
Still keep dataout and control send completions as we may need to
cleanup there. This helps reducing the amount of interrupts/completions
in the IO path.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 5 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_initiator.c | 13 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 5 |
3 files changed, 16 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 6c3743b6860e..f4e9d621826e 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -101,7 +101,6 @@ | |||
101 | #define SHIFT_4K 12 | 101 | #define SHIFT_4K 12 |
102 | #define SIZE_4K (1ULL << SHIFT_4K) | 102 | #define SIZE_4K (1ULL << SHIFT_4K) |
103 | #define MASK_4K (~(SIZE_4K-1)) | 103 | #define MASK_4K (~(SIZE_4K-1)) |
104 | |||
105 | /* support up to 512KB in one RDMA */ | 104 | /* support up to 512KB in one RDMA */ |
106 | #define ISCSI_ISER_SG_TABLESIZE (0x80000 >> SHIFT_4K) | 105 | #define ISCSI_ISER_SG_TABLESIZE (0x80000 >> SHIFT_4K) |
107 | #define ISER_DEF_XMIT_CMDS_DEFAULT 512 | 106 | #define ISER_DEF_XMIT_CMDS_DEFAULT 512 |
@@ -146,6 +145,7 @@ | |||
146 | ISER_MAX_RX_MISC_PDUS) | 145 | ISER_MAX_RX_MISC_PDUS) |
147 | 146 | ||
148 | #define ISER_WC_BATCH_COUNT 16 | 147 | #define ISER_WC_BATCH_COUNT 16 |
148 | #define ISER_SIGNAL_CMD_COUNT 32 | ||
149 | 149 | ||
150 | #define ISER_VER 0x10 | 150 | #define ISER_VER 0x10 |
151 | #define ISER_WSV 0x08 | 151 | #define ISER_WSV 0x08 |
@@ -500,7 +500,8 @@ void iser_unreg_mem_fastreg(struct iscsi_iser_task *iser_task, | |||
500 | 500 | ||
501 | int iser_post_recvl(struct iser_conn *iser_conn); | 501 | int iser_post_recvl(struct iser_conn *iser_conn); |
502 | int iser_post_recvm(struct iser_conn *iser_conn, int count); | 502 | int iser_post_recvm(struct iser_conn *iser_conn, int count); |
503 | int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc); | 503 | int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc, |
504 | bool signal); | ||
504 | 505 | ||
505 | int iser_dma_map_task_data(struct iscsi_iser_task *iser_task, | 506 | int iser_dma_map_task_data(struct iscsi_iser_task *iser_task, |
506 | struct iser_data_buf *data, | 507 | struct iser_data_buf *data, |
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index ffbdf922587a..5a489ea63732 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
@@ -369,6 +369,11 @@ static int iser_post_rx_bufs(struct iscsi_conn *conn, struct iscsi_hdr *req) | |||
369 | return 0; | 369 | return 0; |
370 | } | 370 | } |
371 | 371 | ||
372 | static inline bool iser_signal_comp(int sig_count) | ||
373 | { | ||
374 | return ((sig_count % ISER_SIGNAL_CMD_COUNT) == 0); | ||
375 | } | ||
376 | |||
372 | /** | 377 | /** |
373 | * iser_send_command - send command PDU | 378 | * iser_send_command - send command PDU |
374 | */ | 379 | */ |
@@ -383,6 +388,7 @@ int iser_send_command(struct iscsi_conn *conn, | |||
383 | struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr; | 388 | struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr; |
384 | struct scsi_cmnd *sc = task->sc; | 389 | struct scsi_cmnd *sc = task->sc; |
385 | struct iser_tx_desc *tx_desc = &iser_task->desc; | 390 | struct iser_tx_desc *tx_desc = &iser_task->desc; |
391 | static unsigned sig_count; | ||
386 | 392 | ||
387 | edtl = ntohl(hdr->data_length); | 393 | edtl = ntohl(hdr->data_length); |
388 | 394 | ||
@@ -428,7 +434,8 @@ int iser_send_command(struct iscsi_conn *conn, | |||
428 | 434 | ||
429 | iser_task->status = ISER_TASK_STATUS_STARTED; | 435 | iser_task->status = ISER_TASK_STATUS_STARTED; |
430 | 436 | ||
431 | err = iser_post_send(&iser_conn->ib_conn, tx_desc); | 437 | err = iser_post_send(&iser_conn->ib_conn, tx_desc, |
438 | iser_signal_comp(++sig_count)); | ||
432 | if (!err) | 439 | if (!err) |
433 | return 0; | 440 | return 0; |
434 | 441 | ||
@@ -493,7 +500,7 @@ int iser_send_data_out(struct iscsi_conn *conn, | |||
493 | itt, buf_offset, data_seg_len); | 500 | itt, buf_offset, data_seg_len); |
494 | 501 | ||
495 | 502 | ||
496 | err = iser_post_send(&iser_conn->ib_conn, tx_desc); | 503 | err = iser_post_send(&iser_conn->ib_conn, tx_desc, true); |
497 | if (!err) | 504 | if (!err) |
498 | return 0; | 505 | return 0; |
499 | 506 | ||
@@ -555,7 +562,7 @@ int iser_send_control(struct iscsi_conn *conn, | |||
555 | goto send_control_error; | 562 | goto send_control_error; |
556 | } | 563 | } |
557 | 564 | ||
558 | err = iser_post_send(&iser_conn->ib_conn, mdesc); | 565 | err = iser_post_send(&iser_conn->ib_conn, mdesc, true); |
559 | if (!err) | 566 | if (!err) |
560 | return 0; | 567 | return 0; |
561 | 568 | ||
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 82bedbc260b2..67225bb82bb5 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -1099,7 +1099,8 @@ int iser_post_recvm(struct iser_conn *iser_conn, int count) | |||
1099 | * | 1099 | * |
1100 | * returns 0 on success, -1 on failure | 1100 | * returns 0 on success, -1 on failure |
1101 | */ | 1101 | */ |
1102 | int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc) | 1102 | int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc, |
1103 | bool signal) | ||
1103 | { | 1104 | { |
1104 | int ib_ret; | 1105 | int ib_ret; |
1105 | struct ib_send_wr send_wr, *send_wr_failed; | 1106 | struct ib_send_wr send_wr, *send_wr_failed; |
@@ -1113,7 +1114,7 @@ int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc) | |||
1113 | send_wr.sg_list = tx_desc->tx_sg; | 1114 | send_wr.sg_list = tx_desc->tx_sg; |
1114 | send_wr.num_sge = tx_desc->num_sge; | 1115 | send_wr.num_sge = tx_desc->num_sge; |
1115 | send_wr.opcode = IB_WR_SEND; | 1116 | send_wr.opcode = IB_WR_SEND; |
1116 | send_wr.send_flags = IB_SEND_SIGNALED; | 1117 | send_wr.send_flags = signal ? IB_SEND_SIGNALED : 0; |
1117 | 1118 | ||
1118 | ib_ret = ib_post_send(ib_conn->qp, &send_wr, &send_wr_failed); | 1119 | ib_ret = ib_post_send(ib_conn->qp, &send_wr, &send_wr_failed); |
1119 | if (ib_ret) | 1120 | if (ib_ret) |