From patchwork Thu Apr 13 15:56:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Gurtovoy X-Patchwork-Id: 9679677 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 78DF360386 for ; Thu, 13 Apr 2017 15:56:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BE4028658 for ; Thu, 13 Apr 2017 15:56:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60C852866A; Thu, 13 Apr 2017 15:56:29 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 E2F8628667 for ; Thu, 13 Apr 2017 15:56:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbdDMP41 (ORCPT ); Thu, 13 Apr 2017 11:56:27 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:33366 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751657AbdDMP4Z (ORCPT ); Thu, 13 Apr 2017 11:56:25 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maxg@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 Apr 2017 18:56:18 +0300 Received: from r-vnc08.mtr.labs.mlnx (r-vnc08.mtr.labs.mlnx [10.208.0.121]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v3DFuHov028607; Thu, 13 Apr 2017 18:56:18 +0300 From: Max Gurtovoy To: linux-nvme@lists.infradead.org, keith.busch@intel.com, hch@lst.de, linux-rdma@vger.kernel.org, leon@kernel.org Cc: vladimirk@mellanox.com, maxg@mellanox.com Subject: [PATCH v2 2/4] IB/iser: Use ib_get_sg_mr_type() helper Date: Thu, 13 Apr 2017 18:56:15 +0300 Message-Id: <1492098977-5231-3-git-send-email-maxg@mellanox.com> X-Mailer: git-send-email 1.7.8.2 In-Reply-To: <1492098977-5231-1-git-send-email-maxg@mellanox.com> References: <1492098977-5231-1-git-send-email-maxg@mellanox.com> 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 Signed-off-by: Max Gurtovoy Reviewed-by: Leon Romanovsky --- drivers/infiniband/ulp/iser/iser_verbs.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index c538a38..7e63ffc 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c @@ -242,15 +242,9 @@ void iser_free_fmr_pool(struct ib_conn *ib_conn) unsigned int size) { struct ib_device *ib_dev = device->ib_device; - enum ib_mr_type mr_type; int ret; - if (ib_dev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG) - mr_type = IB_MR_TYPE_SG_GAPS; - else - mr_type = IB_MR_TYPE_MEM_REG; - - res->mr = ib_alloc_mr(pd, mr_type, size); + res->mr = ib_alloc_mr(pd, ib_get_sg_mr_type(ib_dev), size); if (IS_ERR(res->mr)) { ret = PTR_ERR(res->mr); iser_err("Failed to allocate ib_fast_reg_mr err=%d\n", ret);