Commit f01b9f73 authored by Vu Pham's avatar Vu Pham Committed by Nicholas Bellinger

iser-target: Avoid using FRMR for single dma entry requests

This patch changes isert_reg_rdma_frwr() to not use FRMR for single
dma entry requests from small I/Os, in order to avoid the associated
memory registration overhead.

Using DMA MR is sufficient here for the single dma entry requests,
and addresses a >= v3.12 performance regression.
Signed-off-by: default avatarVu Pham <vu@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.12+
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 4863e525
...@@ -2297,18 +2297,26 @@ isert_reg_rdma_frwr(struct iscsi_conn *conn, struct iscsi_cmd *cmd, ...@@ -2297,18 +2297,26 @@ isert_reg_rdma_frwr(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
data_len = min(data_left, rdma_write_max); data_len = min(data_left, rdma_write_max);
wr->cur_rdma_length = data_len; wr->cur_rdma_length = data_len;
spin_lock_irqsave(&isert_conn->conn_lock, flags); /* if there is a single dma entry, dma mr is sufficient */
fr_desc = list_first_entry(&isert_conn->conn_frwr_pool, if (count == 1) {
struct fast_reg_descriptor, list); ib_sge->addr = ib_sg_dma_address(ib_dev, &sg_start[0]);
list_del(&fr_desc->list); ib_sge->length = ib_sg_dma_len(ib_dev, &sg_start[0]);
spin_unlock_irqrestore(&isert_conn->conn_lock, flags); ib_sge->lkey = isert_conn->conn_mr->lkey;
wr->fr_desc = fr_desc; wr->fr_desc = NULL;
} else {
ret = isert_fast_reg_mr(fr_desc, isert_cmd, isert_conn, spin_lock_irqsave(&isert_conn->conn_lock, flags);
ib_sge, offset, data_len); fr_desc = list_first_entry(&isert_conn->conn_frwr_pool,
if (ret) { struct fast_reg_descriptor, list);
list_add_tail(&fr_desc->list, &isert_conn->conn_frwr_pool); list_del(&fr_desc->list);
goto unmap_sg; spin_unlock_irqrestore(&isert_conn->conn_lock, flags);
wr->fr_desc = fr_desc;
ret = isert_fast_reg_mr(fr_desc, isert_cmd, isert_conn,
ib_sge, offset, data_len);
if (ret) {
list_add_tail(&fr_desc->list, &isert_conn->conn_frwr_pool);
goto unmap_sg;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment