summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJubin John <jubin.john@intel.com>2015-10-26 10:28:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-27 17:45:51 +0900
commit64ffd86cf9c1b5d7febcb9dfbd415d886fa76451 (patch)
treedf9bade50d511022607f5664010936a2c3b0a933
parentabfc4459c99d2c87e11f2cd67f8c069a03cfe143 (diff)
staging/rdma/hfi1: Add unit # to verbs txreq cache name
The name used to create the verbs txreq cache was not qualified with the unit number. This causes a panic when destroying the cache on a dual HFI systems. Create a unique name with the unit number with this patch Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Jubin John <jubin.john@intel.com> Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/rdma/hfi1/verbs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/verbs.c b/drivers/staging/rdma/hfi1/verbs.c
index d8f6347decd6..a13a2b135365 100644
--- a/drivers/staging/rdma/hfi1/verbs.c
+++ b/drivers/staging/rdma/hfi1/verbs.c
@@ -129,6 +129,9 @@ static void verbs_sdma_complete(
int status,
int drained);
+/* Length of buffer to create verbs txreq cache name */
+#define TXREQ_NAME_LEN 24
+
/*
* Note that it is OK to post send work requests in the SQE and ERR
* states; hfi1_do_send() will process them and generate error
@@ -1905,6 +1908,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
int ret;
size_t lcpysz = IB_DEVICE_NAME_MAX;
u16 descq_cnt;
+ char buf[TXREQ_NAME_LEN];
ret = hfi1_qp_init(dev);
if (ret)
@@ -1958,8 +1962,9 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
descq_cnt = sdma_get_descq_cnt();
+ snprintf(buf, sizeof(buf), "hfi1_%u_vtxreq_cache", dd->unit);
/* SLAB_HWCACHE_ALIGN for AHG */
- dev->verbs_txreq_cache = kmem_cache_create("hfi1_vtxreq_cache",
+ dev->verbs_txreq_cache = kmem_cache_create(buf,
sizeof(struct verbs_txreq),
0, SLAB_HWCACHE_ALIGN,
verbs_txreq_kmem_cache_ctor);