summaryrefslogtreecommitdiff
path: root/net/rds
diff options
context:
space:
mode:
authorHans Westgaard Ry <hans.westgaard.ry@oracle.com>2020-01-15 14:43:40 +0200
committerLeon Romanovsky <leonro@mellanox.com>2020-01-18 11:48:19 +0200
commitb2dfc6765e45a3154800333234e4952b5412d792 (patch)
tree39e0f83ba33e8c1ed102df74397b3bc5db859e68 /net/rds
parent2eafa1746f17872483d1033b0116ec71435ea19d (diff)
net/rds: Use prefetch for On-Demand-Paging MR
Try prefetching pages when using On-Demand-Paging MR using ib_advise_mr. Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/ib_rdma.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
index ea4d7daec251..b34b24e237f8 100644
--- a/net/rds/ib_rdma.c
+++ b/net/rds/ib_rdma.c
@@ -575,6 +575,7 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents,
(IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_READ |
IB_ACCESS_REMOTE_WRITE | IB_ACCESS_REMOTE_ATOMIC |
IB_ACCESS_ON_DEMAND);
+ struct ib_sge sge = {};
struct ib_mr *ib_mr;
if (!rds_ibdev->odp_capable) {
@@ -602,6 +603,14 @@ void *rds_ib_get_mr(struct scatterlist *sg, unsigned long nents,
}
ibmr->u.mr = ib_mr;
ibmr->odp = 1;
+
+ sge.addr = virt_addr;
+ sge.length = length;
+ sge.lkey = ib_mr->lkey;
+
+ ib_advise_mr(rds_ibdev->pd,
+ IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE,
+ IB_UVERBS_ADVISE_MR_FLAG_FLUSH, &sge, 1);
return ibmr;
}