aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/ocrdma/ocrdma.h
diff options
context:
space:
mode:
authorNaresh Gottumukkala <bgottumukkala@emulex.com>2013-08-26 15:27:44 +0530
committerRoland Dreier <roland@purestorage.com>2013-09-02 21:18:32 -0700
commitcffce99051b80c90630a9fff662a1b25e278069d (patch)
tree58257cc50f34458649c412d5a723063d53b417a3 /drivers/infiniband/hw/ocrdma/ocrdma.h
parent2b51a9b9eb6bf240d2592e10d2f8823dd1f5ee3e (diff)
RDMA/ocrdma: Dont use PD 0 for userpace CQ DB
Create_CQ verb doesn't provide a PD pointer. So, until now we are creating all (both userspace and kernel) CQ DB regions from PD0. This will result in mmapping PD0 to applications. A rogue userspace application can mess things up. Also more serious issues is even the be2net NIC uses PD0. This patch addresses this problem by: 1) Create a PD page for every userspace application when the alloc_ucontext is called. This will be destroyed in dealloc_ucontext. 2) All CQs for that context will use the PD allocated in ucontext. 3) The first create_PD call from application will result in returning the PD address from its ucontext (no new PD will be created). 4) For subsecquent create_pd calls from application, we create new PDs for the application. Signed-off-by: Naresh Gottumukkala <bgottumukkala@emulex.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma.h')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 1c8ba4cefcba..fde8fb097a8c 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -324,6 +324,9 @@ struct ocrdma_ucontext {
struct list_head mm_head;
struct mutex mm_list_lock; /* protects list entries of mm type */
+ struct ocrdma_pd *cntxt_pd;
+ int pd_in_use;
+
struct {
u32 *va;
dma_addr_t pa;