Skip to content

Commit 64ffd86

Browse files
jubinjohngregkh
authored andcommitted
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>
1 parent abfc445 commit 64ffd86

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/staging/rdma/hfi1/verbs.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ static void verbs_sdma_complete(
129129
int status,
130130
int drained);
131131

132+
/* Length of buffer to create verbs txreq cache name */
133+
#define TXREQ_NAME_LEN 24
134+
132135
/*
133136
* Note that it is OK to post send work requests in the SQE and ERR
134137
* states; hfi1_do_send() will process them and generate error
@@ -1905,6 +1908,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
19051908
int ret;
19061909
size_t lcpysz = IB_DEVICE_NAME_MAX;
19071910
u16 descq_cnt;
1911+
char buf[TXREQ_NAME_LEN];
19081912

19091913
ret = hfi1_qp_init(dev);
19101914
if (ret)
@@ -1958,8 +1962,9 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
19581962

19591963
descq_cnt = sdma_get_descq_cnt();
19601964

1965+
snprintf(buf, sizeof(buf), "hfi1_%u_vtxreq_cache", dd->unit);
19611966
/* SLAB_HWCACHE_ALIGN for AHG */
1962-
dev->verbs_txreq_cache = kmem_cache_create("hfi1_vtxreq_cache",
1967+
dev->verbs_txreq_cache = kmem_cache_create(buf,
19631968
sizeof(struct verbs_txreq),
19641969
0, SLAB_HWCACHE_ALIGN,
19651970
verbs_txreq_kmem_cache_ctor);

0 commit comments

Comments
 (0)