aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-09-09 11:33:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-09 11:33:31 -0400
commit26d2177e977c912863ac04f6c1a967e793ca3a56 (patch)
tree48da04fb0b947cfa404747690d7081b657e33221 /net/rds
parenta794b4f3292160bb3fd0f1f90ec8df454e3b17b3 (diff)
parentd1178cbcdcf91900ccf10a177350d7945703c151 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull inifiniband/rdma updates from Doug Ledford: "This is a fairly sizeable set of changes. I've put them through a decent amount of testing prior to sending the pull request due to that. There are still a few fixups that I know are coming, but I wanted to go ahead and get the big, sizable chunk into your hands sooner rather than waiting for those last few fixups. Of note is the fact that this creates what is intended to be a temporary area in the drivers/staging tree specifically for some cleanups and additions that are coming for the RDMA stack. We deprecated two drivers (ipath and amso1100) and are waiting to hear back if we can deprecate another one (ehca). We also put Intel's new hfi1 driver into this area because it needs to be refactored and a transfer library created out of the factored out code, and then it and the qib driver and the soft-roce driver should all be modified to use that library. I expect drivers/staging/rdma to be around for three or four kernel releases and then to go away as all of the work is completed and final deletions of deprecated drivers are done. Summary of changes for 4.3: - Create drivers/staging/rdma - Move amso1100 driver to staging/rdma and schedule for deletion - Move ipath driver to staging/rdma and schedule for deletion - Add hfi1 driver to staging/rdma and set TODO for move to regular tree - Initial support for namespaces to be used on RDMA devices - Add RoCE GID table handling to the RDMA core caching code - Infrastructure to support handling of devices with differing read and write scatter gather capabilities - Various iSER updates - Kill off unsafe usage of global mr registrations - Update SRP driver - Misc mlx4 driver updates - Support for the mr_alloc verb - Support for a netlink interface between kernel and user space cache daemon to speed path record queries and route resolution - Ininitial support for safe hot removal of verbs devices" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (136 commits) IB/ipoib: Suppress warning for send only join failures IB/ipoib: Clean up send-only multicast joins IB/srp: Fix possible protection fault IB/core: Move SM class defines from ib_mad.h to ib_smi.h IB/core: Remove unnecessary defines from ib_mad.h IB/hfi1: Add PSM2 user space header to header_install IB/hfi1: Add CSRs for CONFIG_SDMA_VERBOSITY mlx5: Fix incorrect wc pkey_index assignment for GSI messages IB/mlx5: avoid destroying a NULL mr in reg_user_mr error flow IB/uverbs: reject invalid or unknown opcodes IB/cxgb4: Fix if statement in pick_local_ip6adddrs IB/sa: Fix rdma netlink message flags IB/ucma: HW Device hot-removal support IB/mlx4_ib: Disassociate support IB/uverbs: Enable device removal when there are active user space applications IB/uverbs: Explicitly pass ib_dev to uverbs commands IB/uverbs: Fix race between ib_uverbs_open and remove_one IB/uverbs: Fix reference counting usage of event files IB/core: Make ib_dealloc_pd return void IB/srp: Create an insecure all physical rkey only if needed ...
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/ib.c13
-rw-r--r--net/rds/ib.h2
-rw-r--r--net/rds/ib_cm.c4
-rw-r--r--net/rds/ib_recv.c6
-rw-r--r--net/rds/ib_send.c8
-rw-r--r--net/rds/iw.c10
-rw-r--r--net/rds/iw_rdma.c5
-rw-r--r--net/rds/iw_send.c5
8 files changed, 19 insertions, 34 deletions
diff --git a/net/rds/ib.c b/net/rds/ib.c
index d020fade312c..2d3f2ab475df 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;
@@ -230,11 +222,10 @@ struct rds_ib_device *rds_ib_get_client_data(struct ib_device *device)
230 * 222 *
231 * This can be called at any time and can be racing with any other RDS path. 223 * This can be called at any time and can be racing with any other RDS path.
232 */ 224 */
233static void rds_ib_remove_one(struct ib_device *device) 225static void rds_ib_remove_one(struct ib_device *device, void *client_data)
234{ 226{
235 struct rds_ib_device *rds_ibdev; 227 struct rds_ib_device *rds_ibdev = client_data;
236 228
237 rds_ibdev = ib_get_client_data(device, &rds_ib_client);
238 if (!rds_ibdev) 229 if (!rds_ibdev)
239 return; 230 return;
240 231
diff --git a/net/rds/ib.h b/net/rds/ib.h
index 9fc95e38659a..aae60fda77f6 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 d150bb4aa3cb..9043f5c04787 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
381out: 380out:
@@ -682,7 +681,6 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
682 681
683 ic->i_cm_id = NULL; 682 ic->i_cm_id = NULL;
684 ic->i_pd = NULL; 683 ic->i_pd = NULL;
685 ic->i_mr = NULL;
686 ic->i_send_cq = NULL; 684 ic->i_send_cq = NULL;
687 ic->i_recv_cq = NULL; 685 ic->i_recv_cq = NULL;
688 ic->i_send_hdrs = NULL; 686 ic->i_send_hdrs = NULL;
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 6bbe62060060..f43831e4186a 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
@@ -564,7 +564,7 @@ void rds_ib_recv_init_ack(struct rds_ib_connection *ic)
564 564
565 sge->addr = ic->i_ack_dma; 565 sge->addr = ic->i_ack_dma;
566 sge->length = sizeof(struct rds_header); 566 sge->length = sizeof(struct rds_header);
567 sge->lkey = ic->i_mr->lkey; 567 sge->lkey = ic->i_pd->local_dma_lkey;
568 568
569 wr->sg_list = sge; 569 wr->sg_list = sge;
570 wr->num_sge = 1; 570 wr->num_sge = 1;
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index c576ebeb4115..4e88047086b6 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
@@ -818,7 +818,7 @@ int rds_ib_xmit_atomic(struct rds_connection *conn, struct rm_atomic_op *op)
818 /* Convert our struct scatterlist to struct ib_sge */ 818 /* Convert our struct scatterlist to struct ib_sge */
819 send->s_sge[0].addr = ib_sg_dma_address(ic->i_cm_id->device, op->op_sg); 819 send->s_sge[0].addr = ib_sg_dma_address(ic->i_cm_id->device, op->op_sg);
820 send->s_sge[0].length = ib_sg_dma_len(ic->i_cm_id->device, op->op_sg); 820 send->s_sge[0].length = ib_sg_dma_len(ic->i_cm_id->device, op->op_sg);
821 send->s_sge[0].lkey = ic->i_mr->lkey; 821 send->s_sge[0].lkey = ic->i_pd->local_dma_lkey;
822 822
823 rdsdebug("rva %Lx rpa %Lx len %u\n", op->op_remote_addr, 823 rdsdebug("rva %Lx rpa %Lx len %u\n", op->op_remote_addr,
824 send->s_sge[0].addr, send->s_sge[0].length); 824 send->s_sge[0].addr, send->s_sge[0].length);
@@ -932,7 +932,7 @@ int rds_ib_xmit_rdma(struct rds_connection *conn, struct rm_rdma_op *op)
932 send->s_sge[j].addr = 932 send->s_sge[j].addr =
933 ib_sg_dma_address(ic->i_cm_id->device, scat); 933 ib_sg_dma_address(ic->i_cm_id->device, scat);
934 send->s_sge[j].length = len; 934 send->s_sge[j].length = len;
935 send->s_sge[j].lkey = ic->i_mr->lkey; 935 send->s_sge[j].lkey = ic->i_pd->local_dma_lkey;
936 936
937 sent += len; 937 sent += len;
938 rdsdebug("ic %p sent %d remote_addr %llu\n", ic, sent, remote_addr); 938 rdsdebug("ic %p sent %d remote_addr %llu\n", ic, sent, remote_addr);
diff --git a/net/rds/iw.c b/net/rds/iw.c
index 5d5a9d258658..3df0295c6659 100644
--- a/net/rds/iw.c
+++ b/net/rds/iw.c
@@ -125,12 +125,11 @@ free_attr:
125 kfree(dev_attr); 125 kfree(dev_attr);
126} 126}
127 127
128static void rds_iw_remove_one(struct ib_device *device) 128static void rds_iw_remove_one(struct ib_device *device, void *client_data)
129{ 129{
130 struct rds_iw_device *rds_iwdev; 130 struct rds_iw_device *rds_iwdev = client_data;
131 struct rds_iw_cm_id *i_cm_id, *next; 131 struct rds_iw_cm_id *i_cm_id, *next;
132 132
133 rds_iwdev = ib_get_client_data(device, &rds_iw_client);
134 if (!rds_iwdev) 133 if (!rds_iwdev)
135 return; 134 return;
136 135
@@ -149,10 +148,7 @@ static void rds_iw_remove_one(struct ib_device *device)
149 if (rds_iwdev->mr) 148 if (rds_iwdev->mr)
150 ib_dereg_mr(rds_iwdev->mr); 149 ib_dereg_mr(rds_iwdev->mr);
151 150
152 while (ib_dealloc_pd(rds_iwdev->pd)) { 151 ib_dealloc_pd(rds_iwdev->pd);
153 rdsdebug("Failed to dealloc pd %p\n", rds_iwdev->pd);
154 msleep(1);
155 }
156 152
157 list_del(&rds_iwdev->list); 153 list_del(&rds_iwdev->list);
158 kfree(rds_iwdev); 154 kfree(rds_iwdev);
diff --git a/net/rds/iw_rdma.c b/net/rds/iw_rdma.c
index dba8d0864f18..6a8fbd6e69e7 100644
--- a/net/rds/iw_rdma.c
+++ b/net/rds/iw_rdma.c
@@ -667,11 +667,12 @@ static int rds_iw_init_fastreg(struct rds_iw_mr_pool *pool,
667 struct ib_mr *mr; 667 struct ib_mr *mr;
668 int err; 668 int err;
669 669
670 mr = ib_alloc_fast_reg_mr(rds_iwdev->pd, pool->max_message_size); 670 mr = ib_alloc_mr(rds_iwdev->pd, IB_MR_TYPE_MEM_REG,
671 pool->max_message_size);
671 if (IS_ERR(mr)) { 672 if (IS_ERR(mr)) {
672 err = PTR_ERR(mr); 673 err = PTR_ERR(mr);
673 674
674 printk(KERN_WARNING "RDS/IW: ib_alloc_fast_reg_mr failed (err=%d)\n", err); 675 printk(KERN_WARNING "RDS/IW: ib_alloc_mr failed (err=%d)\n", err);
675 return err; 676 return err;
676 } 677 }
677 678
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c
index 334fe98c5084..86152ec3b887 100644
--- a/net/rds/iw_send.c
+++ b/net/rds/iw_send.c
@@ -153,9 +153,10 @@ void rds_iw_send_init_ring(struct rds_iw_connection *ic)
153 sge->length = sizeof(struct rds_header); 153 sge->length = sizeof(struct rds_header);
154 sge->lkey = 0; 154 sge->lkey = 0;
155 155
156 send->s_mr = ib_alloc_fast_reg_mr(ic->i_pd, fastreg_message_size); 156 send->s_mr = ib_alloc_mr(ic->i_pd, IB_MR_TYPE_MEM_REG,
157 fastreg_message_size);
157 if (IS_ERR(send->s_mr)) { 158 if (IS_ERR(send->s_mr)) {
158 printk(KERN_WARNING "RDS/IW: ib_alloc_fast_reg_mr failed\n"); 159 printk(KERN_WARNING "RDS/IW: ib_alloc_mr failed\n");
159 break; 160 break;
160 } 161 }
161 162