From patchwork Wed May 17 09:19:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9730521 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 EA2C660387 for ; Wed, 17 May 2017 09:21:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5E8A286D2 for ; Wed, 17 May 2017 09:21:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB0A328718; Wed, 17 May 2017 09:21:44 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 493F92871B for ; Wed, 17 May 2017 09:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754015AbdEQJVh (ORCPT ); Wed, 17 May 2017 05:21:37 -0400 Received: from mail-qk0-f177.google.com ([209.85.220.177]:36362 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753807AbdEQJVf (ORCPT ); Wed, 17 May 2017 05:21:35 -0400 Received: by mail-qk0-f177.google.com with SMTP id u75so4783751qka.3 for ; Wed, 17 May 2017 02:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+M+Rq/utbR07Hgd4V7L7YxTComO2aoHy/plZk6XOCiU=; b=evs0Ecvde1EDjaChkXr7Fuc4XVWcpbrdkS9nCe8mhmc9237MM7zXBgqj0wgEiy/hvE 98S/omeuA0/qWdyfVpEI5R/DjcGvnftwdvzSOEaCIsxivaSASjIl9Zwd89a0Za3n2Q+d DwpAQg38Lii5jPat4bguhel77qMZJsSJFMRwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+M+Rq/utbR07Hgd4V7L7YxTComO2aoHy/plZk6XOCiU=; b=AQ00BL2DNFwvluDfEnyQR9CH5wbk+zfhY3I2U1PiyM0L5PfTid7bTBKu1p/WaZGGC6 yxNCbmyaW0PByFNXDNoqIx43DV3zbduUkh1hu2Gbx8/XlxH4rodRJxzWB/rPF2+AdySD Zj8bUQj2JskS5YqA5URE8lrVfShwI2EqQZRi6B74lDlh0aA87uYOaigbSnj4fvQjJuL9 wo8axcvSXnvpleyNNRiWXmhr1wZuKPatW+nxk7Kny4U87C3z7Z0DEN+CX+3qQeVw6Eoe +V1Q/eB+zLsLqK/ec/k2dn0w7mDSCqoFGzsEZG290xHnB0DTB0zgU/sdmxck1PpRkeYd 1Pzw== X-Gm-Message-State: AODbwcCDsYtYUICcRUJdzHgOCHikLUvhSQGJlAD1eC59x0H5r0fNOx3n gBLJPeAOof1Gn3ax+dY= X-Received: by 10.55.138.193 with SMTP id m184mr1865832qkd.192.1495012889314; Wed, 17 May 2017 02:21:29 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id t136sm998431qke.40.2017.05.17.02.21.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 May 2017 02:21:28 -0700 (PDT) From: Selvin Xavier To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Selvin Xavier Subject: [PATCH V2 for-next 15/15] RDMA/bnxt_re: Disable FMR by default Date: Wed, 17 May 2017 02:19:51 -0700 Message-Id: <1495012791-5053-16-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1495012791-5053-1-git-send-email-selvin.xavier@broadcom.com> References: <1495012791-5053-1-git-send-email-selvin.xavier@broadcom.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 Adding a config mechanism to enable/disable FMR support. There are some issues seen with FMR implementation during stress traffic. So disabling it by default for now. Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/Kconfig | 8 ++++++++ drivers/infiniband/hw/bnxt_re/ib_verbs.c | 6 +++++- drivers/infiniband/hw/bnxt_re/ib_verbs.h | 2 ++ drivers/infiniband/hw/bnxt_re/main.c | 2 ++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/Kconfig b/drivers/infiniband/hw/bnxt_re/Kconfig index 19982a4..f1ea349 100644 --- a/drivers/infiniband/hw/bnxt_re/Kconfig +++ b/drivers/infiniband/hw/bnxt_re/Kconfig @@ -7,3 +7,11 @@ config INFINIBAND_BNXT_RE This driver supports Broadcom NetXtreme-E 10/25/40/50 gigabit RoCE HCAs. To compile this driver as a module, choose M here: the module will be called bnxt_re. + +config BNXT_RE_FMR + bool "FMR Support for Netxtreme HCA (EXPERIMENTAL)" + default n + depends on INFINIBAND_BNXT_RE + ---help--- + Say Y here if you want enable FMR support for bnxt_re driver. + If unsure say N. diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index aa3d2e6..8e3c1a3 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -189,8 +189,10 @@ int bnxt_re_query_device(struct ib_device *ibdev, ib_attr->max_total_mcast_qp_attach = 0; ib_attr->max_ah = dev_attr->max_ah; +#ifdef CONFIG_BNXT_RE_FMR ib_attr->max_fmr = dev_attr->max_fmr; - ib_attr->max_map_per_fmr = 1; /* ? */ + ib_attr->max_map_per_fmr = 1; +#endif ib_attr->max_srq = dev_attr->max_srq; ib_attr->max_srq_wr = dev_attr->max_srq_wqes; @@ -3215,6 +3217,7 @@ int bnxt_re_dealloc_mw(struct ib_mw *ib_mw) } /* Fast Memory Regions */ +#ifdef CONFIG_BNXT_RE_FMR struct ib_fmr *bnxt_re_alloc_fmr(struct ib_pd *ib_pd, int mr_access_flags, struct ib_fmr_attr *fmr_attr) { @@ -3307,6 +3310,7 @@ int bnxt_re_dealloc_fmr(struct ib_fmr *ib_fmr) atomic_dec(&rdev->mr_count); return rc; } +#endif /* uverbs */ struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *ib_pd, u64 start, u64 length, diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.h b/drivers/infiniband/hw/bnxt_re/ib_verbs.h index 93539e3..279e7bf 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.h +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.h @@ -195,12 +195,14 @@ int bnxt_re_dereg_mr(struct ib_mr *mr); struct ib_mw *bnxt_re_alloc_mw(struct ib_pd *ib_pd, enum ib_mw_type type, struct ib_udata *udata); int bnxt_re_dealloc_mw(struct ib_mw *mw); +#ifdef CONFIG_BNXT_RE_FMR struct ib_fmr *bnxt_re_alloc_fmr(struct ib_pd *pd, int mr_access_flags, struct ib_fmr_attr *fmr_attr); int bnxt_re_map_phys_fmr(struct ib_fmr *fmr, u64 *page_list, int list_len, u64 iova); int bnxt_re_unmap_fmr(struct list_head *fmr_list); int bnxt_re_dealloc_fmr(struct ib_fmr *fmr); +#endif struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, u64 virt_addr, int mr_access_flags, struct ib_udata *udata); diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 00dab7c..eecb3de 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -510,10 +510,12 @@ static int bnxt_re_register_ib(struct bnxt_re_dev *rdev) ibdev->dereg_mr = bnxt_re_dereg_mr; ibdev->alloc_mr = bnxt_re_alloc_mr; ibdev->map_mr_sg = bnxt_re_map_mr_sg; +#ifdef CONFIG_BNXT_RE_FMR ibdev->alloc_fmr = bnxt_re_alloc_fmr; ibdev->map_phys_fmr = bnxt_re_map_phys_fmr; ibdev->unmap_fmr = bnxt_re_unmap_fmr; ibdev->dealloc_fmr = bnxt_re_dealloc_fmr; +#endif ibdev->reg_user_mr = bnxt_re_reg_user_mr; ibdev->alloc_ucontext = bnxt_re_alloc_ucontext;