Version: 1
-Previous: 219d8c12669b4d4f34b8e62f57df2909a91f922e
-Head: 30ca433ea9422e4ed89726b35029369dda64dbc3
+Previous: efadc9c2f3c82725536e71036aa1636b32f3453a
+Head: a13fd8c5744c3f8eb80150654e2c34e50a5f04aa
Applied:
rm-ib-var: 63a728f303f78348ad9727c46ac3e271197dace4
- cma-rm-pd: 05f424a751356396f7546c73b8d2881109958008
- refresh-temp: 30ca433ea9422e4ed89726b35029369dda64dbc3
+ cma-rm-pd: a13fd8c5744c3f8eb80150654e2c34e50a5f04aa
Unapplied:
transpose: 84e0beee0d2d3c217cd9703b9e438d25856cacb6
fork: 0744fbe2b19f7924faf0dce72349307cc445577e
Bottom: 7683fa697371afc1116e378e4f1b6c848ead85aa
-Top: 8be788d836cc93c7da4ef5d9221d97c9784be146
+Top: 31c0cf47f562afc290796ba3e9791f672a7d5d8b
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2012-07-19 10:09:48 -0700
---
diff --git a/src/cma.c b/src/cma.c
-index bad8bce..a190dee 100755
+index bad8bce..e2772fa 100755
--- a/src/cma.c
+++ b/src/cma.c
@@ -76,6 +76,7 @@ struct cma_device {
#define container_of(ptr, type, field) \
((type *) ((void *)ptr - offsetof(type, field)))
-@@ -129,10 +131,12 @@ int af_ib_support;
- static void ucma_cleanup(void)
- {
- ucma_ib_cleanup();
-+ ucma_release_verbs();
+@@ -132,7 +134,8 @@ static void ucma_cleanup(void)
if (cma_dev_cnt) {
while (cma_dev_cnt--) {
ibv_close_device(cma_dev_array[cma_dev_cnt].verbs);
}
-@@ -235,7 +239,7 @@ int ucma_init(void)
+@@ -235,7 +238,7 @@ int ucma_init(void)
goto err2;
}
if (!cma_dev_array) {
ret = ERR(ENOMEM);
goto err2;
-@@ -252,13 +256,6 @@ int ucma_init(void)
+@@ -252,13 +255,6 @@ int ucma_init(void)
goto err3;
}
i++;
ret = ibv_query_device(cma_dev->verbs, &attr);
if (ret) {
-@@ -280,10 +277,8 @@ int ucma_init(void)
+@@ -280,10 +276,8 @@ int ucma_init(void)
return 0;
err3:
free(cma_dev_array);
err2:
ibv_free_device_list(dev_list);
-@@ -358,15 +353,34 @@ static int ucma_get_device(struct cma_id_private *id_priv, uint64_t guid)
+@@ -354,23 +348,45 @@ void rdma_destroy_event_channel(struct rdma_event_channel *channel)
+ static int ucma_get_device(struct cma_id_private *id_priv, uint64_t guid)
+ {
+ struct cma_device *cma_dev;
+- int i;
++ int i, ret = 0;
for (i = 0; i < cma_dev_cnt; i++) {
cma_dev = &cma_dev_array[i];
+ cma_dev->pd = ibv_alloc_pd(cma_dev_array[i].verbs);
+ if (!cma_dev->pd) {
+ cma_dev->refcnt--;
-+ pthread_mutex_unlock(&mut);
-+ return ERR(ENOMEM);
++ ret = ERR(ENOMEM);
++ goto out;
+ }
+ }
-+ pthread_mutex_unlock(&mut);
+ id_priv->cma_dev = cma_dev;
+ id_priv->id.verbs = cma_dev->verbs;
+ id_priv->id.pd = cma_dev->pd;
-+ return 0;
++out:
++ pthread_mutex_unlock(&mut);
++ return ret;
+}
+
+static void ucma_put_device(struct cma_device *cma_dev)
}
static void ucma_free_id(struct cma_id_private *id_priv)
+ {
++ if (id_priv->cma_dev)
++ ucma_put_device(id_priv->cma_dev);
+ pthread_cond_destroy(&id_priv->cond);
+ pthread_mutex_destroy(&id_priv->mut);
+ if (id_priv->id.route.path_rec)
+++ /dev/null
-Bottom: 8be788d836cc93c7da4ef5d9221d97c9784be146
-Top: 31c0cf47f562afc290796ba3e9791f672a7d5d8b
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2012-07-19 14:19:28 -0700
-
-Refresh of cma-rm-pd
-
----
-
-diff --git a/src/cma.c b/src/cma.c
-index a190dee..e2772fa 100755
---- a/src/cma.c
-+++ b/src/cma.c
-@@ -131,7 +131,6 @@ static int verbs_refcnt;
- static void ucma_cleanup(void)
- {
- ucma_ib_cleanup();
-- ucma_release_verbs();
-
- if (cma_dev_cnt) {
- while (cma_dev_cnt--) {
-@@ -349,7 +348,7 @@ void rdma_destroy_event_channel(struct rdma_event_channel *channel)
- static int ucma_get_device(struct cma_id_private *id_priv, uint64_t guid)
- {
- struct cma_device *cma_dev;
-- int i;
-+ int i, ret = 0;
-
- for (i = 0; i < cma_dev_cnt; i++) {
- cma_dev = &cma_dev_array[i];
-@@ -364,15 +363,16 @@ match:
- cma_dev->pd = ibv_alloc_pd(cma_dev_array[i].verbs);
- if (!cma_dev->pd) {
- cma_dev->refcnt--;
-- pthread_mutex_unlock(&mut);
-- return ERR(ENOMEM);
-+ ret = ERR(ENOMEM);
-+ goto out;
- }
- }
-- pthread_mutex_unlock(&mut);
- id_priv->cma_dev = cma_dev;
- id_priv->id.verbs = cma_dev->verbs;
- id_priv->id.pd = cma_dev->pd;
-- return 0;
-+out:
-+ pthread_mutex_unlock(&mut);
-+ return ret;
- }
-
- static void ucma_put_device(struct cma_device *cma_dev)
-@@ -385,6 +385,8 @@ static void ucma_put_device(struct cma_device *cma_dev)
-
- static void ucma_free_id(struct cma_id_private *id_priv)
- {
-+ if (id_priv->cma_dev)
-+ ucma_put_device(id_priv->cma_dev);
- pthread_cond_destroy(&id_priv->cond);
- pthread_mutex_destroy(&id_priv->mut);
- if (id_priv->id.route.path_rec)