diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2015-07-30 19:22:26 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-08-30 18:12:36 -0400 |
commit | e5580242aa8fab292579a1661463f7479275f7ff (patch) | |
tree | 2616a0aa9c3db96deec740b61f4b31acae0c47b9 /net | |
parent | 2f31fa881fbe70808b945a6d23cae1ca8eadf1b3 (diff) |
rds/ib: Remove ib_get_dma_mr calls
The pd now has a local_dma_lkey member which completely replaces
ib_get_dma_mr, use it instead.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/rds/ib.c | 8 | ||||
-rw-r--r-- | net/rds/ib.h | 2 | ||||
-rw-r--r-- | net/rds/ib_cm.c | 4 | ||||
-rw-r--r-- | net/rds/ib_recv.c | 6 | ||||
-rw-r--r-- | net/rds/ib_send.c | 8 |
5 files changed, 8 insertions, 20 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c index 348ac37c1161..c6f95b9494ae 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c | |||
@@ -99,8 +99,6 @@ static void rds_ib_dev_free(struct work_struct *work) | |||
99 | 99 | ||
100 | if (rds_ibdev->mr_pool) | 100 | if (rds_ibdev->mr_pool) |
101 | rds_ib_destroy_mr_pool(rds_ibdev->mr_pool); | 101 | rds_ib_destroy_mr_pool(rds_ibdev->mr_pool); |
102 | if (rds_ibdev->mr) | ||
103 | ib_dereg_mr(rds_ibdev->mr); | ||
104 | if (rds_ibdev->pd) | 102 | if (rds_ibdev->pd) |
105 | ib_dealloc_pd(rds_ibdev->pd); | 103 | ib_dealloc_pd(rds_ibdev->pd); |
106 | 104 | ||
@@ -164,12 +162,6 @@ static void rds_ib_add_one(struct ib_device *device) | |||
164 | goto put_dev; | 162 | goto put_dev; |
165 | } | 163 | } |
166 | 164 | ||
167 | rds_ibdev->mr = ib_get_dma_mr(rds_ibdev->pd, IB_ACCESS_LOCAL_WRITE); | ||
168 | if (IS_ERR(rds_ibdev->mr)) { | ||
169 | rds_ibdev->mr = NULL; | ||
170 | goto put_dev; | ||
171 | } | ||
172 | |||
173 | rds_ibdev->mr_pool = rds_ib_create_mr_pool(rds_ibdev); | 165 | rds_ibdev->mr_pool = rds_ib_create_mr_pool(rds_ibdev); |
174 | if (IS_ERR(rds_ibdev->mr_pool)) { | 166 | if (IS_ERR(rds_ibdev->mr_pool)) { |
175 | rds_ibdev->mr_pool = NULL; | 167 | rds_ibdev->mr_pool = NULL; |
diff --git a/net/rds/ib.h b/net/rds/ib.h index 86d88ec5d556..36f7d808ffaa 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h | |||
@@ -100,7 +100,6 @@ struct rds_ib_connection { | |||
100 | /* alphabet soup, IBTA style */ | 100 | /* alphabet soup, IBTA style */ |
101 | struct rdma_cm_id *i_cm_id; | 101 | struct rdma_cm_id *i_cm_id; |
102 | struct ib_pd *i_pd; | 102 | struct ib_pd *i_pd; |
103 | struct ib_mr *i_mr; | ||
104 | struct ib_cq *i_send_cq; | 103 | struct ib_cq *i_send_cq; |
105 | struct ib_cq *i_recv_cq; | 104 | struct ib_cq *i_recv_cq; |
106 | 105 | ||
@@ -173,7 +172,6 @@ struct rds_ib_device { | |||
173 | struct list_head conn_list; | 172 | struct list_head conn_list; |
174 | struct ib_device *dev; | 173 | struct ib_device *dev; |
175 | struct ib_pd *pd; | 174 | struct ib_pd *pd; |
176 | struct ib_mr *mr; | ||
177 | struct rds_ib_mr_pool *mr_pool; | 175 | struct rds_ib_mr_pool *mr_pool; |
178 | unsigned int fmr_max_remaps; | 176 | unsigned int fmr_max_remaps; |
179 | unsigned int max_fmrs; | 177 | unsigned int max_fmrs; |
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 0da2a45b33bd..a75e8832bc23 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
@@ -269,7 +269,6 @@ static int rds_ib_setup_qp(struct rds_connection *conn) | |||
269 | 269 | ||
270 | /* Protection domain and memory range */ | 270 | /* Protection domain and memory range */ |
271 | ic->i_pd = rds_ibdev->pd; | 271 | ic->i_pd = rds_ibdev->pd; |
272 | ic->i_mr = rds_ibdev->mr; | ||
273 | 272 | ||
274 | cq_attr.cqe = ic->i_send_ring.w_nr + 1; | 273 | cq_attr.cqe = ic->i_send_ring.w_nr + 1; |
275 | ic->i_send_cq = ib_create_cq(dev, rds_ib_send_cq_comp_handler, | 274 | ic->i_send_cq = ib_create_cq(dev, rds_ib_send_cq_comp_handler, |
@@ -375,7 +374,7 @@ static int rds_ib_setup_qp(struct rds_connection *conn) | |||
375 | 374 | ||
376 | rds_ib_recv_init_ack(ic); | 375 | rds_ib_recv_init_ack(ic); |
377 | 376 | ||
378 | rdsdebug("conn %p pd %p mr %p cq %p %p\n", conn, ic->i_pd, ic->i_mr, | 377 | rdsdebug("conn %p pd %p cq %p %p\n", conn, ic->i_pd, |
379 | ic->i_send_cq, ic->i_recv_cq); | 378 | ic->i_send_cq, ic->i_recv_cq); |
380 | 379 | ||
381 | out: | 380 | out: |
@@ -678,7 +677,6 @@ void rds_ib_conn_shutdown(struct rds_connection *conn) | |||
678 | 677 | ||
679 | ic->i_cm_id = NULL; | 678 | ic->i_cm_id = NULL; |
680 | ic->i_pd = NULL; | 679 | ic->i_pd = NULL; |
681 | ic->i_mr = NULL; | ||
682 | ic->i_send_cq = NULL; | 680 | ic->i_send_cq = NULL; |
683 | ic->i_recv_cq = NULL; | 681 | ic->i_recv_cq = NULL; |
684 | ic->i_send_hdrs = NULL; | 682 | ic->i_send_hdrs = NULL; |
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index cac5b4506ee3..0ceb4c60d2a3 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c | |||
@@ -62,12 +62,12 @@ void rds_ib_recv_init_ring(struct rds_ib_connection *ic) | |||
62 | sge = &recv->r_sge[0]; | 62 | sge = &recv->r_sge[0]; |
63 | sge->addr = ic->i_recv_hdrs_dma + (i * sizeof(struct rds_header)); | 63 | sge->addr = ic->i_recv_hdrs_dma + (i * sizeof(struct rds_header)); |
64 | sge->length = sizeof(struct rds_header); | 64 | sge->length = sizeof(struct rds_header); |
65 | sge->lkey = ic->i_mr->lkey; | 65 | sge->lkey = ic->i_pd->local_dma_lkey; |
66 | 66 | ||
67 | sge = &recv->r_sge[1]; | 67 | sge = &recv->r_sge[1]; |
68 | sge->addr = 0; | 68 | sge->addr = 0; |
69 | sge->length = RDS_FRAG_SIZE; | 69 | sge->length = RDS_FRAG_SIZE; |
70 | sge->lkey = ic->i_mr->lkey; | 70 | sge->lkey = ic->i_pd->local_dma_lkey; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | 73 | ||
@@ -520,7 +520,7 @@ void rds_ib_recv_init_ack(struct rds_ib_connection *ic) | |||
520 | 520 | ||
521 | sge->addr = ic->i_ack_dma; | 521 | sge->addr = ic->i_ack_dma; |
522 | sge->length = sizeof(struct rds_header); | 522 | sge->length = sizeof(struct rds_header); |
523 | sge->lkey = ic->i_mr->lkey; | 523 | sge->lkey = ic->i_pd->local_dma_lkey; |
524 | 524 | ||
525 | wr->sg_list = sge; | 525 | wr->sg_list = sge; |
526 | wr->num_sge = 1; | 526 | wr->num_sge = 1; |
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 5d0a704fa039..f6c829d43373 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c | |||
@@ -202,9 +202,9 @@ void rds_ib_send_init_ring(struct rds_ib_connection *ic) | |||
202 | sge = &send->s_sge[0]; | 202 | sge = &send->s_sge[0]; |
203 | sge->addr = ic->i_send_hdrs_dma + (i * sizeof(struct rds_header)); | 203 | sge->addr = ic->i_send_hdrs_dma + (i * sizeof(struct rds_header)); |
204 | sge->length = sizeof(struct rds_header); | 204 | sge->length = sizeof(struct rds_header); |
205 | sge->lkey = ic->i_mr->lkey; | 205 | sge->lkey = ic->i_pd->local_dma_lkey; |
206 | 206 | ||
207 | send->s_sge[1].lkey = ic->i_mr->lkey; | 207 | send->s_sge[1].lkey = ic->i_pd->local_dma_lkey; |
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
@@ -813,7 +813,7 @@ int rds_ib_xmit_atomic(struct rds_connection *conn, struct rm_atomic_op *op) | |||
813 | /* Convert our struct scatterlist to struct ib_sge */ | 813 | /* Convert our struct scatterlist to struct ib_sge */ |
814 | send->s_sge[0].addr = ib_sg_dma_address(ic->i_cm_id->device, op->op_sg); | 814 | send->s_sge[0].addr = ib_sg_dma_address(ic->i_cm_id->device, op->op_sg); |
815 | send->s_sge[0].length = ib_sg_dma_len(ic->i_cm_id->device, op->op_sg); | 815 | send->s_sge[0].length = ib_sg_dma_len(ic->i_cm_id->device, op->op_sg); |
816 | send->s_sge[0].lkey = ic->i_mr->lkey; | 816 | send->s_sge[0].lkey = ic->i_pd->local_dma_lkey; |
817 | 817 | ||
818 | rdsdebug("rva %Lx rpa %Lx len %u\n", op->op_remote_addr, | 818 | rdsdebug("rva %Lx rpa %Lx len %u\n", op->op_remote_addr, |
819 | send->s_sge[0].addr, send->s_sge[0].length); | 819 | send->s_sge[0].addr, send->s_sge[0].length); |
@@ -927,7 +927,7 @@ int rds_ib_xmit_rdma(struct rds_connection *conn, struct rm_rdma_op *op) | |||
927 | send->s_sge[j].addr = | 927 | send->s_sge[j].addr = |
928 | ib_sg_dma_address(ic->i_cm_id->device, scat); | 928 | ib_sg_dma_address(ic->i_cm_id->device, scat); |
929 | send->s_sge[j].length = len; | 929 | send->s_sge[j].length = len; |
930 | send->s_sge[j].lkey = ic->i_mr->lkey; | 930 | send->s_sge[j].lkey = ic->i_pd->local_dma_lkey; |
931 | 931 | ||
932 | sent += len; | 932 | sent += len; |
933 | rdsdebug("ic %p sent %d remote_addr %llu\n", ic, sent, remote_addr); | 933 | rdsdebug("ic %p sent %d remote_addr %llu\n", ic, sent, remote_addr); |