From patchwork Mon Apr 5 05:24:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 12182643 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=ham 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 7BDE3C43611 for ; Mon, 5 Apr 2021 05:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 444F8613B0 for ; Mon, 5 Apr 2021 05:24:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbhDEFYm (ORCPT ); Mon, 5 Apr 2021 01:24:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:57314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232218AbhDEFYj (ORCPT ); Mon, 5 Apr 2021 01:24:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3E3C6139F; Mon, 5 Apr 2021 05:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617600272; bh=H8VyokLLj861miN6eL/BS/iydH8X5tcb3ZsH8b+Rr3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pc2AL8IA2ENJh5d/e1ATkUHiXYZJp3c0RoiDrukP7UR18XgRnLUPOt455aETZDgD+ 9tN6dCnr71sF7xwuEtUhcHtpYZv9kBVm2hXs5G4KU8C43sJeLHi9n4p2Yca+o1XWUm 4x87/gYWytjWu5929v6HulHxqQmQQA+kzbo5WGRzXAT/mfUU28J4IoUVN36S0olB1C SSiN6RrpurpK+3g49qd79KBJ73uiaGztbXchONgqfNrwuB6SP1tsCLgjB4KFzTjLHK 0DkCmaVePHL7WmR8f37thwoi/35+N1BSlEBQDZAZbwzNsjvUBXpKze2FWem04y6aEO Jk8f5lhdh17MQ== 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 07/10] cifs: smbd: Enable Relaxed Ordering Date: Mon, 5 Apr 2021 08:24:01 +0300 Message-Id: <20210405052404.213889-8-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: linux-cifs@vger.kernel.org From: Avihai Horon Enable Relaxed Ordering for smbd. Relaxed Ordering is an optional access flag and as such, it is ignored by vendors that don't support it. Signed-off-by: Avihai Horon Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky --- fs/cifs/smbdirect.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 647098a5cf3b..1e86dc8bbe85 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -2178,8 +2178,10 @@ static void smbd_mr_recovery_work(struct work_struct *work) continue; } - smbdirect_mr->mr = ib_alloc_mr(info->pd, info->mr_type, - info->max_frmr_depth, 0); + smbdirect_mr->mr = + ib_alloc_mr(info->pd, info->mr_type, + info->max_frmr_depth, + IB_ACCESS_RELAXED_ORDERING); if (IS_ERR(smbdirect_mr->mr)) { log_rdma_mr(ERR, "ib_alloc_mr failed mr_type=%x max_frmr_depth=%x\n", info->mr_type, @@ -2244,7 +2246,8 @@ static int allocate_mr_list(struct smbd_connection *info) if (!smbdirect_mr) goto out; smbdirect_mr->mr = ib_alloc_mr(info->pd, info->mr_type, - info->max_frmr_depth, 0); + info->max_frmr_depth, + IB_ACCESS_RELAXED_ORDERING); if (IS_ERR(smbdirect_mr->mr)) { log_rdma_mr(ERR, "ib_alloc_mr failed mr_type=%x max_frmr_depth=%x\n", info->mr_type, info->max_frmr_depth); @@ -2406,9 +2409,10 @@ struct smbd_mr *smbd_register_mr( reg_wr->wr.send_flags = IB_SEND_SIGNALED; reg_wr->mr = smbdirect_mr->mr; reg_wr->key = smbdirect_mr->mr->rkey; - reg_wr->access = writing ? - IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE : - IB_ACCESS_REMOTE_READ; + reg_wr->access = + (writing ? IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE : + IB_ACCESS_REMOTE_READ) | + IB_ACCESS_RELAXED_ORDERING; /* * There is no need for waiting for complemtion on ib_post_send