Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp277682pxx; Wed, 28 Oct 2020 04:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc8kKpc1VMYz1PnvNDCsKNEJq8wKId6vS7KGf4CnHnJbmpHkhCI27JOqYCeMIxmfRzNf3y X-Received: by 2002:a05:6402:1d82:: with SMTP id dk2mr6997671edb.299.1603885804113; Wed, 28 Oct 2020 04:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885804; cv=none; d=google.com; s=arc-20160816; b=R6iqjKSkIv2/5lbBeGvfQ01rZD7qNZnH6aNmieAs07fzC6kyR2VEwT3IiwFuY1Q/G4 3DS+F/FskEEZOid4pWNq1Dta9diIMqVCg2uVZcE4xqiTLK/ndEX40jUJ/oR9wBNzojWh edJhdEfLfivZdz5bc+mcxmbqWXHysQhHa2ptSgYO5ayWjddhH2fmIYOP3Err0eAhiRrF PAHF1j/tijAlRvGOnSCSHT6Kat+s/pAnWCnaRFuKO38RpO7SIFCOIETBcL3ttYS0OiKN FYhpYkYE3/7+TzbNOL6kgC4IhdZpookNypYxuqZz47RVJVU9hhqgHuMyHY1+pccXntFl dG4Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RKqoIq8oOMSBFyBRdSE9zh9awME2qb40Rc9v4H/t+Ek=; b=VRSmqf8ojLZF5UaZHLrYrXPfoa9Ro8x70IvIK9s/mtTb2NeSHG5iutOT9w0Wef9w4b mq9AXwGdplG1Si2jjOnzNVI10d7e+7vcA1WRqxjmPIPmj9ziNUgTESn4rXqc/251UT8T wXgqA+ZP84xnV92sbZdsAkbX3qtiyLLCuVZZeWL1S4ml+NTQpfZkDreXRoNiYSh4Q9rf LWCe0NS258tcklHsXIYR7mS/fY5DuXhIqk08xv9/UbtIe0FT752b6Qxamhhn/z2KJuRQ ZwlZY7b6TuUV6iHlVpS4JXpCj8YTlrR9lwzKz//pUmWpggawCjJEOBg1jtVfbgH9HcWq crdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LfpVIYai; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si2664388eds.99.2020.10.28.04.49.42; Wed, 28 Oct 2020 04:50:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=default header.b=LfpVIYai; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794514AbgJ0PMM (ORCPT + 99 others); Tue, 27 Oct 2020 11:12:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:39994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790984AbgJ0PFg (ORCPT ); Tue, 27 Oct 2020 11:05:36 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C146221707; Tue, 27 Oct 2020 15:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811135; bh=7Pi2iXOC2BpCmsxbMkpE9+ZDVx1F96+q2hL3GkwWOVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LfpVIYaixsb11xpIafqzhXDndXocy6LfW0HLjuai3h8t9WjkDa0+z6Jr10Jt1LBik 85Gr/UtjH/ycNKOZtyCq+c5ApbkOyOs/mVmqrEstLo445j1oFPXjC0RdnZhuXOXWDP nvFDkOKywTHYGryaIyH4t0neNv/C+ROsrW2EBuUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leon Romanovsky , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 378/633] RDMA/mlx5: Use set_mkc_access_pd_addr_fields() in reg_create() Date: Tue, 27 Oct 2020 14:52:01 +0100 Message-Id: <20201027135540.438644569@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Gunthorpe [ Upstream commit 1c97ca3da0d12e0156a177f48ed3184c3f202002 ] reg_create() open codes this helper, use the shared code. Link: https://lore.kernel.org/r/20200914112653.345244-3-leon@kernel.org Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/mr.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 44683073be0c4..8d975c4d93060 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -1190,29 +1190,16 @@ static struct mlx5_ib_mr *reg_create(struct ib_mr *ibmr, struct ib_pd *pd, MLX5_SET(create_mkey_in, in, pg_access, !!(pg_cap)); mkc = MLX5_ADDR_OF(create_mkey_in, in, memory_key_mkey_entry); + set_mkc_access_pd_addr_fields(mkc, access_flags, virt_addr, pd); MLX5_SET(mkc, mkc, free, !populate); MLX5_SET(mkc, mkc, access_mode_1_0, MLX5_MKC_ACCESS_MODE_MTT); - if (MLX5_CAP_GEN(dev->mdev, relaxed_ordering_write)) - MLX5_SET(mkc, mkc, relaxed_ordering_write, - !!(access_flags & IB_ACCESS_RELAXED_ORDERING)); - if (MLX5_CAP_GEN(dev->mdev, relaxed_ordering_read)) - MLX5_SET(mkc, mkc, relaxed_ordering_read, - !!(access_flags & IB_ACCESS_RELAXED_ORDERING)); - MLX5_SET(mkc, mkc, a, !!(access_flags & IB_ACCESS_REMOTE_ATOMIC)); - MLX5_SET(mkc, mkc, rw, !!(access_flags & IB_ACCESS_REMOTE_WRITE)); - MLX5_SET(mkc, mkc, rr, !!(access_flags & IB_ACCESS_REMOTE_READ)); - MLX5_SET(mkc, mkc, lw, !!(access_flags & IB_ACCESS_LOCAL_WRITE)); - MLX5_SET(mkc, mkc, lr, 1); MLX5_SET(mkc, mkc, umr_en, 1); - MLX5_SET64(mkc, mkc, start_addr, virt_addr); MLX5_SET64(mkc, mkc, len, length); - MLX5_SET(mkc, mkc, pd, to_mpd(pd)->pdn); MLX5_SET(mkc, mkc, bsf_octword_size, 0); MLX5_SET(mkc, mkc, translations_octword_size, get_octo_len(virt_addr, length, page_shift)); MLX5_SET(mkc, mkc, log_page_size, page_shift); - MLX5_SET(mkc, mkc, qpn, 0xffffff); if (populate) { MLX5_SET(create_mkey_in, in, translations_octword_actual_size, get_octo_len(virt_addr, length, page_shift)); -- 2.25.1