diff options
author | Vu Pham <vu@mellanox.com> | 2013-11-11 12:04:29 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-12 16:07:52 -0500 |
commit | f01b9f73392b48c6cda7c2c66594c73137c776da (patch) | |
tree | e673d3361ccb1a79de47609dc36d9760411084c9 | |
parent | 4863e525659abbc903aacc67fd916f12914f6c1d (diff) |
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: Vu Pham <vu@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.12+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 27708c3430d5..bbd86e82e042 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -2297,18 +2297,26 @@ isert_reg_rdma_frwr(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
2297 | data_len = min(data_left, rdma_write_max); | 2297 | data_len = min(data_left, rdma_write_max); |
2298 | wr->cur_rdma_length = data_len; | 2298 | wr->cur_rdma_length = data_len; |
2299 | 2299 | ||
2300 | spin_lock_irqsave(&isert_conn->conn_lock, flags); | 2300 | /* if there is a single dma entry, dma mr is sufficient */ |
2301 | fr_desc = list_first_entry(&isert_conn->conn_frwr_pool, | 2301 | if (count == 1) { |
2302 | struct fast_reg_descriptor, list); | 2302 | ib_sge->addr = ib_sg_dma_address(ib_dev, &sg_start[0]); |
2303 | list_del(&fr_desc->list); | 2303 | ib_sge->length = ib_sg_dma_len(ib_dev, &sg_start[0]); |
2304 | spin_unlock_irqrestore(&isert_conn->conn_lock, flags); | 2304 | ib_sge->lkey = isert_conn->conn_mr->lkey; |
2305 | wr->fr_desc = fr_desc; | 2305 | wr->fr_desc = NULL; |
2306 | 2306 | } else { | |
2307 | ret = isert_fast_reg_mr(fr_desc, isert_cmd, isert_conn, | 2307 | spin_lock_irqsave(&isert_conn->conn_lock, flags); |
2308 | ib_sge, offset, data_len); | 2308 | fr_desc = list_first_entry(&isert_conn->conn_frwr_pool, |
2309 | if (ret) { | 2309 | struct fast_reg_descriptor, list); |
2310 | list_add_tail(&fr_desc->list, &isert_conn->conn_frwr_pool); | 2310 | list_del(&fr_desc->list); |
2311 | goto unmap_sg; | 2311 | spin_unlock_irqrestore(&isert_conn->conn_lock, flags); |
2312 | wr->fr_desc = fr_desc; | ||
2313 | |||
2314 | ret = isert_fast_reg_mr(fr_desc, isert_cmd, isert_conn, | ||
2315 | ib_sge, offset, data_len); | ||
2316 | if (ret) { | ||
2317 | list_add_tail(&fr_desc->list, &isert_conn->conn_frwr_pool); | ||
2318 | goto unmap_sg; | ||
2319 | } | ||
2312 | } | 2320 | } |
2313 | 2321 | ||
2314 | return 0; | 2322 | return 0; |