From patchwork Mon Apr 5 05:23:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 12182663 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A677C43462 for ; Mon, 5 Apr 2021 05:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C069613A5 for ; Mon, 5 Apr 2021 05:24:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232231AbhDEFYk (ORCPT ); Mon, 5 Apr 2021 01:24:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:57206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbhDEFYf (ORCPT ); Mon, 5 Apr 2021 01:24:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8480761399; Mon, 5 Apr 2021 05:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617600269; bh=p/hww5IZwUmzeql1CaZSwd9MbMxjAL9Py3kRE/ZWykI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uLDgHWnJZEA57dXtfbUnnMoN/P65nZ62XVceMV0PYewnSGtXpa1kEmCn/aU7YHKau MhUfd5vWeGLxn/LMJ/EQN9Ip3pQqBTuSZ4m4km9tfyG5RTzN1ZyYU4QixYyzJsDqzO XlL7M6JX3pBDqjeArPmtC8gPieGD6EFcnV3lbqgZy/pXahBL3gbinib+Mw87e/3tPi lUExqbfEvV9NXPic6DXti8R2W9MHIurmzIhR9VkfDoD3I7ceB2DjwrJt2aH2/L45n6 2VPIPu5r6tPNnG0JsUIAp3gBDb6CDio6PV6WPJ8inYhOWZ/yUfGECBUUE2tCamY992 hR0HSc24y6wsw== From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Avihai Horon , Adit Ranadive , Anna Schumaker , Ariel Elior , Bart Van Assche , Bernard Metzler , Christoph Hellwig , Chuck Lever , "David S. Miller" , Dennis Dalessandro , Devesh Sharma , Faisal Latif , Jack Wang , Jakub Kicinski , "J. Bruce Fields" , Jens Axboe , Karsten Graul , Keith Busch , Lijun Ou , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, Max Gurtovoy , Max Gurtovoy , "Md. Haris Iqbal" , Michael Guralnik , Michal Kalderon , Mike Marciniszyn , Naresh Kumar PBS , netdev@vger.kernel.org, Potnuri Bharat Teja , rds-devel@oss.oracle.com, Sagi Grimberg , samba-technical@lists.samba.org, Santosh Shilimkar , Selvin Xavier , Shiraz Saleem , Somnath Kotur , Sriharsha Basavapatna , Steve French , Trond Myklebust , VMware PV-Drivers , Weihang Li , Yishai Hadas , Zhu Yanjun Subject: [PATCH rdma-next 02/10] RDMA/core: Enable Relaxed Ordering in __ib_alloc_pd() Date: Mon, 5 Apr 2021 08:23:56 +0300 Message-Id: <20210405052404.213889-3-leon@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210405052404.213889-1-leon@kernel.org> References: <20210405052404.213889-1-leon@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Avihai Horon Enable Relaxed Ordering in __ib_alloc_pd() allocation of the local_dma_lkey. This will take effect only for devices that don't pre-allocate the lkey but allocate it per PD allocation. Signed-off-by: Avihai Horon Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/verbs.c | 3 ++- drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index a1782f8a6ca0..9b719f7d6fd5 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -287,7 +287,8 @@ struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags, if (device->attrs.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) pd->local_dma_lkey = device->local_dma_lkey; else - mr_access_flags |= IB_ACCESS_LOCAL_WRITE; + mr_access_flags |= + IB_ACCESS_LOCAL_WRITE | IB_ACCESS_RELAXED_ORDERING; if (flags & IB_PD_UNSAFE_GLOBAL_RKEY) { pr_warn("%s: enabling unsafe global rkey\n", caller); diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c index b3fa783698a0..d74827694f92 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c @@ -66,6 +66,7 @@ struct ib_mr *pvrdma_get_dma_mr(struct ib_pd *pd, int acc) int ret; /* Support only LOCAL_WRITE flag for DMA MRs */ + acc &= ~IB_ACCESS_RELAXED_ORDERING; if (acc & ~IB_ACCESS_LOCAL_WRITE) { dev_warn(&dev->pdev->dev, "unsupported dma mr access flags %#x\n", acc);