From patchwork Tue Oct 20 02:11:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Weiny X-Patchwork-Id: 7441631 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2CB30BEEA4 for ; Tue, 20 Oct 2015 02:12:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53C5B20785 for ; Tue, 20 Oct 2015 02:12:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C778D20797 for ; Tue, 20 Oct 2015 02:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752125AbbJTCMX (ORCPT ); Mon, 19 Oct 2015 22:12:23 -0400 Received: from mga11.intel.com ([192.55.52.93]:10135 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbbJTCMW (ORCPT ); Mon, 19 Oct 2015 22:12:22 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 19 Oct 2015 19:12:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,705,1437462000"; d="scan'208";a="830833326" Received: from phlsvsds.ph.intel.com ([10.228.195.38]) by fmsmga002.fm.intel.com with ESMTP; 19 Oct 2015 19:12:20 -0700 Received: from phlsvsds.ph.intel.com (localhost.localdomain [127.0.0.1]) by phlsvsds.ph.intel.com (8.13.8/8.13.8) with ESMTP id t9K2CJ5A008785; Mon, 19 Oct 2015 22:12:19 -0400 Received: (from iweiny@localhost) by phlsvsds.ph.intel.com (8.13.8/8.13.8/Submit) id t9K2CJeh008782; Mon, 19 Oct 2015 22:12:19 -0400 X-Authentication-Warning: phlsvsds.ph.intel.com: iweiny set sender to ira.weiny@intel.com using -f From: ira.weiny@intel.com To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, Jubin John , Ira Weiny Subject: [PATCH v2 20/22] staging/rdma/hfi1: Add unit # to verbs txreq cache name Date: Mon, 19 Oct 2015 22:11:35 -0400 Message-Id: <1445307097-8244-21-git-send-email-ira.weiny@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1445307097-8244-1-git-send-email-ira.weiny@intel.com> References: <1445307097-8244-1-git-send-email-ira.weiny@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jubin John 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 Signed-off-by: Jubin John Signed-off-by: Ira Weiny --- drivers/staging/rdma/hfi1/verbs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rdma/hfi1/verbs.c b/drivers/staging/rdma/hfi1/verbs.c index cac3f4a30741..ece50ea837e5 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 @@ -1899,6 +1902,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) @@ -1952,8 +1956,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);