Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2967280pxf; Sun, 4 Apr 2021 22:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBxpXDeXpf1kb1FsLdjZEKc6xAM9rvZaoL43YSjPejOQfrdouy98xPlO9T3d3FD3O8dfpJ X-Received: by 2002:a05:6e02:12c6:: with SMTP id i6mr17842025ilm.235.1617600323698; Sun, 04 Apr 2021 22:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617600323; cv=none; d=google.com; s=arc-20160816; b=N2Q1foQQkcA9UzvILawt29aIl5beE9bjY1GUjaU2ZV1iY84WI81tHScO0fSwTxepUO rzKgomvs+pvAMxVrAhMeylKgcOTMQliKO7LFRDllRhdIZxe3vfx13MGt6q46i2KFZVS8 4ZbRDpw6eHK4b552vmHcGhXMKuPMj3N8su3S85mtV7kNjLxIpH1pfFKHf10+KkznGjJA qFvI0JhKAynI7ab2KhhN4DKmQQewDfXAwoDTJb6MIvs7+SKTT4mLH9+A1NNlNJA66hWX JFUVH/JO76tAhuoxQdEsLOaZCDaHFiC+S4APVdpHaaZ0OBU8fbGwhu0zJysn6rEkKG93 LVSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ta3vh2KZXPbXcLVm+QmNGIdFaMk1+2+2uubb97EviJg=; b=w5NIA/zoM0mKQAwqaH/CF2LkLwfYK+o8bJ2xE3BVEPABZEKoOKYAMdC5H56igJ+om/ 6wnJbMOvgWFYxoyRy13I3tXVcuVV7YZ6eygaMRiCbfbyww8gpeAOyxWbGqfzty4vwSpH rAvOuZraiFGr4qyPnwLgPiICfR78vPmG1rf+JqZnKu/owWyDfy9k+vTinltc78iodfBL A0bPm/7xFjJQStdWFvemip1ehQUXfUa+cYYkD4Pp9SZkc+7ASdcY+HVMzLGHPPdmV2iz oOQGCmVE9VJdK285eVbxbCM8IAxq/O/eZgzvn+OjPjxgJV/q014VcgmoD4FQ95P9U1Gu CoiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uLDgHWnJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si4876787ila.29.2021.04.04.22.25.10; Sun, 04 Apr 2021 22:25:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uLDgHWnJ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232216AbhDEFYi (ORCPT + 99 others); Mon, 5 Apr 2021 01:24:38 -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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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); -- 2.30.2