Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2967475pxf; Sun, 4 Apr 2021 22:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyFKttPJEsf4VxxFm86gRWm+oPLDm5kA3++FwvfOroMcpcagL7i+tv7UnCn9aVh1tlkxQN X-Received: by 2002:a05:6638:218b:: with SMTP id s11mr22116883jaj.81.1617600359192; Sun, 04 Apr 2021 22:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617600359; cv=none; d=google.com; s=arc-20160816; b=hPnGljrNmi5grsApFBUW4JukIEDp8g9ghwRC2Dn+I/O5kZC8pEDyul8B09ZZSO3a7i OiR9IGXVHPX4SkSobI+wWvaSR3uKhxv6sKR1U3N9CGpdB6DoQc99WTZd7x+853QRnFyQ /jwidG+ZRmrUjbtqPQYv+jL0q7JEZYnEDTrPDjTd0V6QyvKpZjI9LS6U6ffFYK7Ylk6L FqFdDbzGFTd5YqV1qLUIKPV6n4dhVWTLaizACAnkJt9ndRxWH2wBWtf/13OAGcRIfAgD 3MGUaB8nV9LpjGwT3Jh9HID81Gm4onDiPtc42Ji7c34pSOVvFBX9scL5edevmIRa46IH eeZA== 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=BSt+7OfS5BGkUgG6AZwMrg8m8FVyqpE3lIUgGB1PvMs=; b=j/8BBOZci9j12fGCb0/Uu4xkXIVuiT82N4OU+iQ9077f5NbJLDl3d3SDiaS7rGIsOF DPx8kG2DPVc6vykUaLaJT3Fz5WbTcMbWaObcfnMKVMc08S3RUw/cEnpqSyPCeaYTAKHO n1aLWSqh/e34muPZ13hvbEOIGpEEb1DFVl/ZwECG3bfM2VTKE2xub5jfoIO3ommd5hs0 XBkpS3iTwNeeAf2rJu5/aY7wPJdXYvXPHHC7EuAuJQwskm6CBKMUTob8oL8RwH+cK1kk HcutmUSrs1KDx8RQpVDxp7hyZfIiajYwaF9pKbZXR4gNsV03f7mSR6zCJf/7DEnkg0kd 0FUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="H/LrR2ey"; 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 t4si4848709ilo.19.2021.04.04.22.25.46; Sun, 04 Apr 2021 22:25:59 -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="H/LrR2ey"; 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 S232274AbhDEFYv (ORCPT + 99 others); Mon, 5 Apr 2021 01:24:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:57662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232269AbhDEFYp (ORCPT ); Mon, 5 Apr 2021 01:24:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E7DCD613AE; Mon, 5 Apr 2021 05:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617600279; bh=kgFeNEGqbN9WM+uS4TOUKfA2KjjvWH4Sn9QKyrs2Esc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H/LrR2eygKEWxFLckWrWCNTnD6kKtvMcLmftsZoTnWCqk/rgGjPILP1O9Sb/m2viK unVBfkwguZGE9J6jSmdfrppM0HIlMce2I1CMFt3b8rq3SQaGOSdUrmAdgRZOndp/VF zIYWDg6Ge7lvfxKr803oVG0AT8FhZZ2x5c5l0N3hBRcjqBiaRPlr+4xs3g3l3XdBJF XvOyzE85/pRqLznPmdWpEyLjjT8s0HbLGGqxpaxyrGJxkVqP+3zTrUzHF9bbDXflGB pGiGbDaDmxBdvgIZL3qNem0va+qf59TNStPrQAG9mmWUREFLPlkFkrT/UVlRflsgKH ir0e3t698GSvQ== 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 06/10] nvme-rdma: Enable Relaxed Ordering Date: Mon, 5 Apr 2021 08:24:00 +0300 Message-Id: <20210405052404.213889-7-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 for nvme. 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: Max Gurtovoy Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky --- drivers/nvme/host/rdma.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index 4dbc17311e0b..8f106b20b39c 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -532,9 +532,8 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue) */ pages_per_mr = nvme_rdma_get_max_fr_pages(ibdev, queue->pi_support) + 1; ret = ib_mr_pool_init(queue->qp, &queue->qp->rdma_mrs, - queue->queue_size, - IB_MR_TYPE_MEM_REG, - pages_per_mr, 0, 0); + queue->queue_size, IB_MR_TYPE_MEM_REG, + pages_per_mr, 0, IB_ACCESS_RELAXED_ORDERING); if (ret) { dev_err(queue->ctrl->ctrl.device, "failed to initialize MR pool sized %d for QID %d\n", @@ -545,7 +544,8 @@ static int nvme_rdma_create_queue_ib(struct nvme_rdma_queue *queue) if (queue->pi_support) { ret = ib_mr_pool_init(queue->qp, &queue->qp->sig_mrs, queue->queue_size, IB_MR_TYPE_INTEGRITY, - pages_per_mr, pages_per_mr, 0); + pages_per_mr, pages_per_mr, + IB_ACCESS_RELAXED_ORDERING); if (ret) { dev_err(queue->ctrl->ctrl.device, "failed to initialize PI MR pool sized %d for QID %d\n", @@ -1382,9 +1382,9 @@ static int nvme_rdma_map_sg_fr(struct nvme_rdma_queue *queue, req->reg_wr.wr.num_sge = 0; req->reg_wr.mr = req->mr; req->reg_wr.key = req->mr->rkey; - req->reg_wr.access = IB_ACCESS_LOCAL_WRITE | - IB_ACCESS_REMOTE_READ | - IB_ACCESS_REMOTE_WRITE; + req->reg_wr.access = IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_READ | + IB_ACCESS_REMOTE_WRITE | + IB_ACCESS_RELAXED_ORDERING; sg->addr = cpu_to_le64(req->mr->iova); put_unaligned_le24(req->mr->length, sg->length); @@ -1488,9 +1488,8 @@ static int nvme_rdma_map_sg_pi(struct nvme_rdma_queue *queue, wr->wr.send_flags = 0; wr->mr = req->mr; wr->key = req->mr->rkey; - wr->access = IB_ACCESS_LOCAL_WRITE | - IB_ACCESS_REMOTE_READ | - IB_ACCESS_REMOTE_WRITE; + wr->access = IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_READ | + IB_ACCESS_REMOTE_WRITE | IB_ACCESS_RELAXED_ORDERING; sg->addr = cpu_to_le64(req->mr->iova); put_unaligned_le24(req->mr->length, sg->length); -- 2.30.2