From patchwork Tue Jan 23 09:33:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalderon, Michal" X-Patchwork-Id: 10179899 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8AE116019D for ; Tue, 23 Jan 2018 09:35:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 715D928479 for ; Tue, 23 Jan 2018 09:35:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62192285D5; Tue, 23 Jan 2018 09:35:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD37728479 for ; Tue, 23 Jan 2018 09:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751141AbeAWJe6 (ORCPT ); Tue, 23 Jan 2018 04:34:58 -0500 Received: from mail-sn1nam02on0048.outbound.protection.outlook.com ([104.47.36.48]:58448 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751173AbeAWJey (ORCPT ); Tue, 23 Jan 2018 04:34:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WAko31G/OxYBrc5WWdeC+scsvxsAeiMxkM/pLTvRbH4=; b=RHsw7Zd8U9KzoBwzjZ2fjGShJe2/Wqtg3+Bj+l/qM0nN2E5b59sinegrEjHd1nUiT4g0TUFIs9B4CUnJAko1sG/gMBcxRiI+SEoBWtqBn5v6bNDm8bMyLEZsudcCDtFJii1RmS8/9AZZRu0fXq+E7EiWx4j4Dox56A1F0Ure/p8= Received: from SN1PR0701CA0070.namprd07.prod.outlook.com (2a01:111:e400:52fd::38) by SN4PR0701MB3824.namprd07.prod.outlook.com (2603:10b6:803:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Tue, 23 Jan 2018 09:34:52 +0000 Received: from BY2FFO11FD028.protection.gbl (2a01:111:f400:7c0c::132) by SN1PR0701CA0070.outlook.office365.com (2a01:111:e400:52fd::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.428.17 via Frontend Transport; Tue, 23 Jan 2018 09:34:52 +0000 Authentication-Results: spf=fail (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=cavium.com; Received-SPF: Fail (protection.outlook.com: domain of cavium.com does not designate 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD028.mail.protection.outlook.com (10.1.15.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.428.12 via Frontend Transport; Tue, 23 Jan 2018 09:34:52 +0000 Received: from lb-tlvb-michal.il.qlogic.com.com (10.185.6.89) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 23 Jan 2018 01:34:49 -0800 From: Michal Kalderon To: , CC: , , , , Michal Kalderon , Ariel Elior Subject: [PATCH net 2/2] qed: Free reserved MR tid Date: Tue, 23 Jan 2018 11:33:47 +0200 Message-ID: <1516700027-3361-3-git-send-email-Michal.Kalderon@cavium.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1516700027-3361-1-git-send-email-Michal.Kalderon@cavium.com> References: <1516700027-3361-1-git-send-email-Michal.Kalderon@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(346002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(81166006)(8936002)(478600001)(81156014)(8676002)(47776003)(72206003)(48376002)(105606002)(106466001)(104016004)(50226002)(36756003)(50466002)(69596002)(59450400001)(107886003)(77096007)(85426001)(110136005)(4326008)(26005)(316002)(16586007)(356003)(54906003)(2906002)(5660300001)(76176011)(86362001)(336011)(51416003)(305945005)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0701MB3824; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD028; 1:Uw4HEep6cexjnhnAsp8RvXqJ1rWltOt0JTjurW8yi9NE7wBgD6Rm4b8NokUMiuK/0XLcrTbLlO2663MmSvQjQeDDY0TLBmN70sc7BLop/hPSgmFSOJoD8vK8sXQszPwB X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 273aab2a-6e31-46c1-faaf-08d562448dfe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534164)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060); SRVR:SN4PR0701MB3824; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 3:MQ2UHxu2EE7XgfjQPB64vbSPYg42c7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edzUbYElaNNYXLIkUvQIg7kKhGApc4OZ5ZONHZnXgcHfFWOlzAAGfAIbYpCreYS14yEAzLI/MwOFSisr4MtZhdNEkj7tqQwHrdNGO2d8EY7aZ/++gS3U0JGeip+6lntoNMxiYX809tvOc2Sqh6iYZQCwPRQdknx9A4uJZawwSQf+OA60f0XkR1GlLRC8g+Gb2G+12YyPzjdgibt3XpcibjiltEBKbCqTtg4IAzLCsomiXeU+L/HsePpsPFqWU/Kdpz6GiaA0ES4rmRo2WGwOR4wMcQJ0EYYDfkoXO0dg0zVU0BuezbNLVZkrRmPdWmeGljPYT1melwW8AHrJiFzkom+69OUcxRIea2HRF/h68Wae0QmHGVEb3zh/4VUGGtM+EDTzGqXeBYBg9S3xqtjguIIVnrThZxZEw348+dMeLyBRFuw6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(10201501046)(3002001)(93006095)(93001095)(6041288)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:SN4PR0701MB3824; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN4PR0701MB3824; X-Microsoft-Exchange-Diagnostics: 1; SN4PR0701MB3824; 4:BX0xg8ALrJaN4bZ0DhT/Yop1QdCUGibdWqIJzAnCZAInoPu+ySVDwdw7dRqEpx9NLYlvgMhN343OQxA2vaLbaL0qm/thyjYbQkYV2wyep6ibTEwkKf5NQYLhbb2nogZgCiY0QIOaY2JBL8mScFhst0RSiPv2asHhaQFXn5IbHLcmkXiliGnWXdX5mpuQqNYEoedHolsPzSw9CKKrmGvIGlnrtFLX62taCLDQp+suN2E+qq++kmsfEBItjDyqXsJVfQPCWmm17LUf4OGqgqcTPw== X-Forefront-PRVS: 05610E64EE X-Microsoft-Exchange-Diagnost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w2ISWlipgb3nutYxH15I4TMwT7oLwvpHtyF9sbKPxMjcL6gEtWPWiNQ7vnmYocLFJvVZzd++1xn8RCeegBIi6SjNV4sGGxixI67trcpLmlY+fHVGoXaVjyuvymAsuRFuUEyw5t6D62P0pkDtASjGr6b0gJCwUt2FTgo5tTqX+pym SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2018 09:34:52.0361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 273aab2a-6e31-46c1-faaf-08d562448dfe X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3824 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A tid was allocated for reserved MR during initialization but not freed. This lead to an annoying output message during rdma unload flow. Signed-off-by: Michal Kalderon Signed-off-by: Ariel Elior --- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c index 9d6e2d4..b7abb82 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -358,10 +358,27 @@ static void qed_rdma_resc_free(struct qed_hwfn *p_hwfn) kfree(p_rdma_info); } +static void qed_rdma_free_tid(void *rdma_cxt, u32 itid) +{ + struct qed_hwfn *p_hwfn = (struct qed_hwfn *)rdma_cxt; + + DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "itid = %08x\n", itid); + + spin_lock_bh(&p_hwfn->p_rdma_info->lock); + qed_bmap_release_id(p_hwfn, &p_hwfn->p_rdma_info->tid_map, itid); + spin_unlock_bh(&p_hwfn->p_rdma_info->lock); +} + +static void qed_rdma_free_reserved_lkey(struct qed_hwfn *p_hwfn) +{ + qed_rdma_free_tid(p_hwfn, p_hwfn->p_rdma_info->dev->reserved_lkey); +} + static void qed_rdma_free(struct qed_hwfn *p_hwfn) { DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Freeing RDMA\n"); + qed_rdma_free_reserved_lkey(p_hwfn); qed_rdma_resc_free(p_hwfn); } @@ -794,17 +811,6 @@ static struct qed_rdma_device *qed_rdma_query_device(void *rdma_cxt) return p_hwfn->p_rdma_info->dev; } -static void qed_rdma_free_tid(void *rdma_cxt, u32 itid) -{ - struct qed_hwfn *p_hwfn = (struct qed_hwfn *)rdma_cxt; - - DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "itid = %08x\n", itid); - - spin_lock_bh(&p_hwfn->p_rdma_info->lock); - qed_bmap_release_id(p_hwfn, &p_hwfn->p_rdma_info->tid_map, itid); - spin_unlock_bh(&p_hwfn->p_rdma_info->lock); -} - static void qed_rdma_cnq_prod_update(void *rdma_cxt, u8 qz_offset, u16 prod) { struct qed_hwfn *p_hwfn;