rds/ib: Remove ib_get_dma_mr calls
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Thu, 30 Jul 2015 23:22:26 +0000 (17:22 -0600)
committerDoug Ledford <dledford@redhat.com>
Sun, 30 Aug 2015 22:12:36 +0000 (18:12 -0400)
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>
net/rds/ib.c
net/rds/ib.h
net/rds/ib_cm.c
net/rds/ib_recv.c
net/rds/ib_send.c

index 348ac37c11616dd4e5c6cfff4b87dbd1e6adb9a9..c6f95b9494ae12135d574d5e9492852623be6d31 100644 (file)
@@ -99,8 +99,6 @@ static void rds_ib_dev_free(struct work_struct *work)
 
        if (rds_ibdev->mr_pool)
                rds_ib_destroy_mr_pool(rds_ibdev->mr_pool);
-       if (rds_ibdev->mr)
-               ib_dereg_mr(rds_ibdev->mr);
        if (rds_ibdev->pd)
                ib_dealloc_pd(rds_ibdev->pd);
 
@@ -164,12 +162,6 @@ static void rds_ib_add_one(struct ib_device *device)
                goto put_dev;
        }
 
-       rds_ibdev->mr = ib_get_dma_mr(rds_ibdev->pd, IB_ACCESS_LOCAL_WRITE);
-       if (IS_ERR(rds_ibdev->mr)) {
-               rds_ibdev->mr = NULL;
-               goto put_dev;
-       }
-
        rds_ibdev->mr_pool = rds_ib_create_mr_pool(rds_ibdev);
        if (IS_ERR(rds_ibdev->mr_pool)) {
                rds_ibdev->mr_pool = NULL;
index 86d88ec5d5563538472b9ece4a99c7f751dfe0d1..36f7d808ffaaee64aa5bcb85d15c1220cee4b61b 100644 (file)
@@ -100,7 +100,6 @@ struct rds_ib_connection {
        /* alphabet soup, IBTA style */
        struct rdma_cm_id       *i_cm_id;
        struct ib_pd            *i_pd;
-       struct ib_mr            *i_mr;
        struct ib_cq            *i_send_cq;
        struct ib_cq            *i_recv_cq;
 
@@ -173,7 +172,6 @@ struct rds_ib_device {
        struct list_head        conn_list;
        struct ib_device        *dev;
        struct ib_pd            *pd;
-       struct ib_mr            *mr;
        struct rds_ib_mr_pool   *mr_pool;
        unsigned int            fmr_max_remaps;
        unsigned int            max_fmrs;
index 0da2a45b33bd8ee5df6915e253440d3bc65081fc..a75e8832bc2326d5f7284f0aaa2ea46aab83378b 100644 (file)
@@ -269,7 +269,6 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
 
        /* Protection domain and memory range */
        ic->i_pd = rds_ibdev->pd;
-       ic->i_mr = rds_ibdev->mr;
 
        cq_attr.cqe = ic->i_send_ring.w_nr + 1;
        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)
 
        rds_ib_recv_init_ack(ic);
 
-       rdsdebug("conn %p pd %p mr %p cq %p %p\n", conn, ic->i_pd, ic->i_mr,
+       rdsdebug("conn %p pd %p cq %p %p\n", conn, ic->i_pd,
                 ic->i_send_cq, ic->i_recv_cq);
 
 out:
@@ -678,7 +677,6 @@ void rds_ib_conn_shutdown(struct rds_connection *conn)
 
                ic->i_cm_id = NULL;
                ic->i_pd = NULL;
-               ic->i_mr = NULL;
                ic->i_send_cq = NULL;
                ic->i_recv_cq = NULL;
                ic->i_send_hdrs = NULL;
index cac5b4506ee387053d0baf64b1c588cbab8e0f5e..0ceb4c60d2a3aa657c09dc4228cd02174765d9cc 100644 (file)
@@ -62,12 +62,12 @@ void rds_ib_recv_init_ring(struct rds_ib_connection *ic)
                sge = &recv->r_sge[0];
                sge->addr = ic->i_recv_hdrs_dma + (i * sizeof(struct rds_header));
                sge->length = sizeof(struct rds_header);
-               sge->lkey = ic->i_mr->lkey;
+               sge->lkey = ic->i_pd->local_dma_lkey;
 
                sge = &recv->r_sge[1];
                sge->addr = 0;
                sge->length = RDS_FRAG_SIZE;
-               sge->lkey = ic->i_mr->lkey;
+               sge->lkey = ic->i_pd->local_dma_lkey;
        }
 }
 
@@ -520,7 +520,7 @@ void rds_ib_recv_init_ack(struct rds_ib_connection *ic)
 
        sge->addr = ic->i_ack_dma;
        sge->length = sizeof(struct rds_header);
-       sge->lkey = ic->i_mr->lkey;
+       sge->lkey = ic->i_pd->local_dma_lkey;
 
        wr->sg_list = sge;
        wr->num_sge = 1;
index 5d0a704fa039f9859d588f6136a4515d98d71c8b..f6c829d43373f02ca9ba97f5612c8633c22add67 100644 (file)
@@ -202,9 +202,9 @@ void rds_ib_send_init_ring(struct rds_ib_connection *ic)
                sge = &send->s_sge[0];
                sge->addr = ic->i_send_hdrs_dma + (i * sizeof(struct rds_header));
                sge->length = sizeof(struct rds_header);
-               sge->lkey = ic->i_mr->lkey;
+               sge->lkey = ic->i_pd->local_dma_lkey;
 
-               send->s_sge[1].lkey = ic->i_mr->lkey;
+               send->s_sge[1].lkey = ic->i_pd->local_dma_lkey;
        }
 }
 
@@ -813,7 +813,7 @@ int rds_ib_xmit_atomic(struct rds_connection *conn, struct rm_atomic_op *op)
        /* Convert our struct scatterlist to struct ib_sge */
        send->s_sge[0].addr = ib_sg_dma_address(ic->i_cm_id->device, op->op_sg);
        send->s_sge[0].length = ib_sg_dma_len(ic->i_cm_id->device, op->op_sg);
-       send->s_sge[0].lkey = ic->i_mr->lkey;
+       send->s_sge[0].lkey = ic->i_pd->local_dma_lkey;
 
        rdsdebug("rva %Lx rpa %Lx len %u\n", op->op_remote_addr,
                 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)
                        send->s_sge[j].addr =
                                 ib_sg_dma_address(ic->i_cm_id->device, scat);
                        send->s_sge[j].length = len;
-                       send->s_sge[j].lkey = ic->i_mr->lkey;
+                       send->s_sge[j].lkey = ic->i_pd->local_dma_lkey;
 
                        sent += len;
                        rdsdebug("ic %p sent %d remote_addr %llu\n", ic, sent, remote_addr);