From: Sean Hefty Date: Fri, 13 Aug 2010 21:56:54 +0000 (-0700) Subject: refresh (create temporary patch) X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2b5e451629a9ab80c79e8f2d06422ac98f91de1c;p=~shefty%2Frdma-win.git refresh (create temporary patch) --- diff --git a/meta b/meta index 98878b9c..760361fd 100644 --- a/meta +++ b/meta @@ -1,10 +1,11 @@ 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 diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 00000000..85402fe8 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,68 @@ +Bottom: cde452a8770b460e61069001a796d5df0ead1543 +Top: 1114fd2ae9cf76c3bd34aa8c7f1733a80350f375 +Author: Sean Hefty +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 + { + struct ibv_context *verbs; ++ struct ibv_pd *pd; + uint64_t guid; + int port_cnt; + uint8_t max_initiator_depth; +@@ -134,6 +135,13 @@ static int ucma_acquire(void) + goto err4; + } + ++ cma_dev->pd = ibv_alloc_pd(cma_dev->verbs); ++ if (cma_dev->pd == NULL) { ++ ibv_close_device(cma_dev->verbs); ++ ret = -1; ++ goto err4; ++ } ++ + ++i; + ret = ibv_query_device(cma_dev->verbs, &attr); + if (ret) { +@@ -151,8 +159,9 @@ out: + return 0; + + err4: +- while (i) { +- ibv_close_device(cma_dev_array[--i].verbs); ++ while (i--) { ++ ibv_dealloc_pd(cma_dev_array[i].pd); ++ ibv_close_device(cma_dev_array[i].verbs); + } + delete cma_dev_array; + err3: +@@ -172,6 +181,7 @@ void ucma_release(void) + EnterCriticalSection(&lock); + if (--ref == 0) { + for (i = 0; i < cma_dev_cnt; i++) { ++ ibv_decalloc_pd(cma_dev_array[i].pd); + ibv_close_device(cma_dev_array[i].verbs); + } + delete cma_dev_array; +@@ -635,8 +645,10 @@ int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd, + int ret; + + id_priv = CONTAINING_RECORD(id, struct cma_id_private, id); +- if (id->verbs != pd->context) { +- return -1; ++ if (!pd) { ++ pd = id_priv->cma_dev->pd; ++ } else if (id->verbs != pd->context) { ++ return rdma_seterrno(EINVAL); + } + + qp = ibv_create_qp(pd, qp_init_attr);