IB/core: add a need_inval flag to struct ib_mr
authorSteve Wise <swise@chelsio.com>
Tue, 3 May 2016 16:01:08 +0000 (18:01 +0200)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 17:37:19 +0000 (13:37 -0400)
This is the first step toward moving MR invalidation decisions
to the core.  It will be needed by the upcoming RW API.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/verbs.c
include/rdma/ib_verbs.h

index 8549345c616918c8eb9d03dca6c341f73c292a0c..76c9c3faac202993fd714f795eb411705f90f397 100644 (file)
@@ -1353,6 +1353,7 @@ struct ib_mr *ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags)
                mr->pd      = pd;
                mr->uobject = NULL;
                atomic_inc(&pd->usecnt);
+               mr->need_inval = false;
        }
 
        return mr;
@@ -1399,6 +1400,7 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd,
                mr->pd      = pd;
                mr->uobject = NULL;
                atomic_inc(&pd->usecnt);
+               mr->need_inval = false;
        }
 
        return mr;
index 400a8a0422a4dff5e929c98cc97f26210a86bcac..3f66647749cafdb095c9f041003970d5ee9e8bd6 100644 (file)
@@ -1446,6 +1446,7 @@ struct ib_mr {
        u64                iova;
        u32                length;
        unsigned int       page_size;
+       bool               need_inval;
        union {
                struct ib_uobject       *uobject;       /* user */
                struct list_head        qp_entry;       /* FR */