aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw
diff options
context:
space:
mode:
authorSebastian Sanchez <sebastian.sanchez@intel.com>2016-12-07 22:33:53 -0500
committerDoug Ledford <dledford@redhat.com>2016-12-11 15:29:42 -0500
commitf84dfa26e61c6f31a3a0366532296911df763170 (patch)
treeb25cf23a6fac724240a21c6e0dc21131c29bb65a /drivers/infiniband/sw
parentb44980f8794faf3561d970fe8c05e34765fbdc9b (diff)
IB/hfi1: Use reference count wrapper for MRs
Some parts of the code don't use the standard driver wrapper for memory region reference counters. Use the standard driver wrapper throughout the code. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r--drivers/infiniband/sw/rdmavt/mr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c
index 562cf78b6ae9..52fd15276ee6 100644
--- a/drivers/infiniband/sw/rdmavt/mr.c
+++ b/drivers/infiniband/sw/rdmavt/mr.c
@@ -793,7 +793,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
793 mr = rcu_dereference(dev->dma_mr); 793 mr = rcu_dereference(dev->dma_mr);
794 if (!mr) 794 if (!mr)
795 goto bail; 795 goto bail;
796 atomic_inc(&mr->refcount); 796 rvt_get_mr(mr);
797 rcu_read_unlock(); 797 rcu_read_unlock();
798 798
799 isge->mr = mr; 799 isge->mr = mr;
@@ -814,7 +814,7 @@ int rvt_lkey_ok(struct rvt_lkey_table *rkt, struct rvt_pd *pd,
814 off + sge->length > mr->length || 814 off + sge->length > mr->length ||
815 (mr->access_flags & acc) != acc)) 815 (mr->access_flags & acc) != acc))
816 goto bail; 816 goto bail;
817 atomic_inc(&mr->refcount); 817 rvt_get_mr(mr);
818 rcu_read_unlock(); 818 rcu_read_unlock();
819 819
820 off += mr->offset; 820 off += mr->offset;
@@ -892,7 +892,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,
892 mr = rcu_dereference(rdi->dma_mr); 892 mr = rcu_dereference(rdi->dma_mr);
893 if (!mr) 893 if (!mr)
894 goto bail; 894 goto bail;
895 atomic_inc(&mr->refcount); 895 rvt_get_mr(mr);
896 rcu_read_unlock(); 896 rcu_read_unlock();
897 897
898 sge->mr = mr; 898 sge->mr = mr;
@@ -913,7 +913,7 @@ int rvt_rkey_ok(struct rvt_qp *qp, struct rvt_sge *sge,
913 if (unlikely(vaddr < mr->iova || off + len > mr->length || 913 if (unlikely(vaddr < mr->iova || off + len > mr->length ||
914 (mr->access_flags & acc) == 0)) 914 (mr->access_flags & acc) == 0))
915 goto bail; 915 goto bail;
916 atomic_inc(&mr->refcount); 916 rvt_get_mr(mr);
917 rcu_read_unlock(); 917 rcu_read_unlock();
918 918
919 off += mr->offset; 919 off += mr->offset;