Version: 1
-Previous: 186a23a2bc60cd154e272df72c447784fa521db8
-Head: 07495583b69e2ce98851971cd4d28e7b1be8d1d0
+Previous: b7bd8061a05c5c6ca9aaaf7a3376bd7091591ced
+Head: 1eb50772395b9ce232cc6ac836cef149be784d5c
Applied:
sync: 452ce3b051e10e10363baa77834962a89267e052
pre-af-ib: 73504ef1f812bea6d1fd59f194f90e5194ca2efa
opt-pd: 07495583b69e2ce98851971cd4d28e7b1be8d1d0
+ refresh-temp: 1eb50772395b9ce232cc6ac836cef149be784d5c
Unapplied:
cq-status: d4535a68c8d41302c9ee9d44b98a75ea19b4f172
wv-rm-ioctl: 2c4f8b27f89993bc9c1215e8c358046b2934f755
--- /dev/null
+Bottom: cde452a8770b460e61069001a796d5df0ead1543
+Top: 1114fd2ae9cf76c3bd34aa8c7f1733a80350f375
+Author: Sean Hefty <sean.hefty@intel.com>
+Date: 2010-08-13 14:56:52 -0700
+
+Refresh of opt-pd
+
+---
+
+diff --git a/trunk/ulp/librdmacm/src/cma.cpp b/trunk/ulp/librdmacm/src/cma.cpp
+index 2698bde..4f2b261 100644
+--- a/trunk/ulp/librdmacm/src/cma.cpp
++++ b/trunk/ulp/librdmacm/src/cma.cpp
+@@ -79,6 +79,7 @@ struct cma_id_private
+ struct cma_device\r
+ {\r
+ struct ibv_context *verbs;\r
++ struct ibv_pd *pd;\r
+ uint64_t guid;\r
+ int port_cnt;\r
+ uint8_t max_initiator_depth;\r
+@@ -134,6 +135,13 @@ static int ucma_acquire(void)
+ goto err4;\r
+ }\r
+ \r
++ cma_dev->pd = ibv_alloc_pd(cma_dev->verbs);\r
++ if (cma_dev->pd == NULL) {\r
++ ibv_close_device(cma_dev->verbs);\r
++ ret = -1;\r
++ goto err4;\r
++ }\r
++\r
+ ++i;\r
+ ret = ibv_query_device(cma_dev->verbs, &attr);\r
+ if (ret) {\r
+@@ -151,8 +159,9 @@ out:
+ return 0;\r
+ \r
+ err4:\r
+- while (i) {\r
+- ibv_close_device(cma_dev_array[--i].verbs);\r
++ while (i--) {\r
++ ibv_dealloc_pd(cma_dev_array[i].pd);\r
++ ibv_close_device(cma_dev_array[i].verbs);\r
+ }\r
+ delete cma_dev_array;\r
+ err3:\r
+@@ -172,6 +181,7 @@ void ucma_release(void)
+ EnterCriticalSection(&lock);\r
+ if (--ref == 0) {\r
+ for (i = 0; i < cma_dev_cnt; i++) {\r
++ ibv_decalloc_pd(cma_dev_array[i].pd);\r
+ ibv_close_device(cma_dev_array[i].verbs);\r
+ }\r
+ delete cma_dev_array;\r
+@@ -635,8 +645,10 @@ int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd,
+ int ret;\r
+ \r
+ id_priv = CONTAINING_RECORD(id, struct cma_id_private, id);\r
+- if (id->verbs != pd->context) {\r
+- return -1;\r
++ if (!pd) {\r
++ pd = id_priv->cma_dev->pd;\r
++ } else if (id->verbs != pd->context) {\r
++ return rdma_seterrno(EINVAL);\r
+ }\r
+ \r
+ qp = ibv_create_qp(pd, qp_init_attr);