Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
@@ -2297,6 +2297,13 @@ isert_reg_rdma_frwr(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
	data_len = min(data_left, rdma_write_max);
	wr->cur_rdma_length = data_len;

	/* if there is a single dma entry, dma mr is sufficient */
	if (count == 1) {
		ib_sge->addr = ib_sg_dma_address(ib_dev, &sg_start[0]);
		ib_sge->length = ib_sg_dma_len(ib_dev, &sg_start[0]);
		ib_sge->lkey = isert_conn->conn_mr->lkey;
		wr->fr_desc = NULL;
	} else {
		spin_lock_irqsave(&isert_conn->conn_lock, flags);
		fr_desc = list_first_entry(&isert_conn->conn_frwr_pool,
					   struct fast_reg_descriptor, list);
@@ -2310,6 +2317,7 @@ isert_reg_rdma_frwr(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
			list_add_tail(&fr_desc->list, &isert_conn->conn_frwr_pool);
			goto unmap_sg;
		}
	}

	return 0;