From patchwork Mon Sep 2 05:52:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13786742 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55D151AACA for ; Mon, 2 Sep 2024 06:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257604; cv=none; b=KMgc0fvR23qmgxJKptYmuloEZfLKOCpba8ukqnOskBpxhthq+GUqxdAUDZ//N3wxQ5lqsobZF/ya/5UacgL/4RfsQCnDmh5mNdPgnjTLcMru60S4jSRwcL3OWN2vaMhdwtoG4l3z08x+KBWJTu3W8ljFW4qSOqQMyBb+lvaydHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257604; c=relaxed/simple; bh=TX5GFzH77yfVF/cdwWrEISulUeGN7PBMii5WG+lhoNI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=RAbhpTWmcqKWOvHw5l20N8B4YrBsusgYkBa9TGNx3iJeecvzCDv95nOZLp8VsaVs69GXfQHjeF7Qe7kgVaRtzwRAdis+qvW6zpuw2ANsLpFEv61Ppg1Zvdy8F5XSrBGL9lhdyL0ErepcbMtGsibXM18btrUk7cv9JfYR9vtiUeM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=Dj1/M5tu; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Dj1/M5tu" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2057c6c57b5so2983495ad.1 for ; Sun, 01 Sep 2024 23:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725257602; x=1725862402; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=TvsCwGZswkvekt0UpZVHab8326YO+Ej47S2Dw9ycIGQ=; b=Dj1/M5tu2TL310KAJtCocX/ZJIO+oXXRG6K9yg/yaZPHf2rY11/OHhuEJbf9doSLrP dunw4Y+aUwzvrfyZ9RMj3bELhgIABnK5UsHQMk8iAeyVgYxtnMZ98/rszJXGcaENGoU5 j/m76GKS2lqKoaBnPEdiv7hyx3HLUVhm9u2QM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725257602; x=1725862402; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TvsCwGZswkvekt0UpZVHab8326YO+Ej47S2Dw9ycIGQ=; b=mo0RXMGq6NHQva6pTTt0hdzbf7jBQnBnKxqLWK0rkTPiLc8OxQKb02DZCnpOyd0tB4 F2x7osazd5GNnve/VypsbxV47jbLi0xvbR2ijXY7CL/4xwSZ/2bcHW6VtOyPTzhYlPjJ l2pyKNeM3EYWxsPiCm+FYVlLqub+PH3sSE2tiHyHKue7yiz5k1+9SAg+kZy2EkLfgORO jOPW/2UAlp15BZEsdBKJrALHgB/8BjH+lJyUdM5mFNZve+wzlH+lVosRHLILGoxcdaZr tBWG/qz31udvpvn8CaJFtBN8ldYo96YTgoiAAaZQLmJAfFQ12aMX7xM1WUB8J/YtSvjd rd+w== X-Gm-Message-State: AOJu0Yww9sWy9CZybOMVU+bPX7DGDbT72/7pqMA+alvyMI9vWm+iSsm7 gzO96OQJmSTJF9EAGM1zjpKedV3Sb4KF6d/E/NqGx0XhV6DVD9vGEwPvtP8cn9IOSoNRyReGzst HZQ== X-Google-Smtp-Source: AGHT+IHEXNo2D+Of6Ity4q4kOI828ejY84wbYDWvXYeJHYJ8XJ2ueWfXg5wBn9sxgdfpetVZeSWcaw== X-Received: by 2002:a17:902:fb0f:b0:205:80e6:b7f2 with SMTP id d9443c01a7336-20580e6b8d8mr18742485ad.11.1725257602492; Sun, 01 Sep 2024 23:13:22 -0700 (PDT) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2054a2629c3sm28907955ad.105.2024.09.01.23.13.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2024 23:13:21 -0700 (PDT) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Selvin Xavier Subject: [PATCH for-next 1/4] RDMA/bnxt_re: Update HW interface headers Date: Sun, 1 Sep 2024 22:52:28 -0700 Message-Id: <1725256351-12751-2-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> References: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Kalesh AP Updating the HW structures for the pcie relax ordering support. Newly added interface structures will be used in the followup patch. Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/roce_hsi.h | 36 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/roce_hsi.h b/drivers/infiniband/hw/bnxt_re/roce_hsi.h index 0425309..3ec8952 100644 --- a/drivers/infiniband/hw/bnxt_re/roce_hsi.h +++ b/drivers/infiniband/hw/bnxt_re/roce_hsi.h @@ -409,7 +409,7 @@ struct creq_deinitialize_fw_resp { u8 reserved48[6]; }; -/* cmdq_create_qp (size:768b/96B) */ +/* cmdq_create_qp (size:832b/104B) */ struct cmdq_create_qp { u8 opcode; #define CMDQ_CREATE_QP_OPCODE_CREATE_QP 0x1UL @@ -430,8 +430,11 @@ struct cmdq_create_qp { #define CMDQ_CREATE_QP_QP_FLAGS_OPTIMIZED_TRANSMIT_ENABLED 0x20UL #define CMDQ_CREATE_QP_QP_FLAGS_RESPONDER_UD_CQE_WITH_CFA 0x40UL #define CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED 0x80UL + #define CMDQ_CREATE_QP_QP_FLAGS_EXPRESS_MODE_ENABLED 0x100UL + #define CMDQ_CREATE_QP_QP_FLAGS_STEERING_TAG_VALID 0x200UL + #define CMDQ_CREATE_QP_QP_FLAGS_RDMA_READ_OR_ATOMICS_USED 0x400UL #define CMDQ_CREATE_QP_QP_FLAGS_LAST \ - CMDQ_CREATE_QP_QP_FLAGS_EXT_STATS_ENABLED + CMDQ_CREATE_QP_QP_FLAGS_RDMA_READ_OR_ATOMICS_USED u8 type; #define CMDQ_CREATE_QP_TYPE_RC 0x2UL #define CMDQ_CREATE_QP_TYPE_UD 0x4UL @@ -492,6 +495,9 @@ struct cmdq_create_qp { __le64 rq_pbl; __le64 irrq_addr; __le64 orrq_addr; + __le32 request_xid; + __le16 steering_tag; + __le16 reserved16; }; /* creq_create_qp_resp (size:128b/16B) */ @@ -972,13 +978,14 @@ struct creq_query_qp_extend_resp_sb_tlv { __le16 reserved_16; }; -/* cmdq_create_srq (size:384b/48B) */ +/* cmdq_create_srq (size:448b/56B) */ struct cmdq_create_srq { u8 opcode; #define CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ 0x5UL #define CMDQ_CREATE_SRQ_OPCODE_LAST CMDQ_CREATE_SRQ_OPCODE_CREATE_SRQ u8 cmd_size; __le16 flags; + #define CMDQ_CREATE_SRQ_FLAGS_STEERING_TAG_VALID 0x1UL __le16 cookie; u8 resp_size; u8 reserved8; @@ -1012,6 +1019,8 @@ struct cmdq_create_srq { __le32 dpi; __le32 pd_id; __le64 pbl; + __le16 steering_tag; + u8 reserved48[6]; }; /* creq_create_srq_resp (size:128b/16B) */ @@ -1118,7 +1127,7 @@ struct creq_query_srq_resp_sb { __le32 data[4]; }; -/* cmdq_create_cq (size:384b/48B) */ +/* cmdq_create_cq (size:448b/56B) */ struct cmdq_create_cq { u8 opcode; #define CMDQ_CREATE_CQ_OPCODE_CREATE_CQ 0x9UL @@ -1126,6 +1135,8 @@ struct cmdq_create_cq { u8 cmd_size; __le16 flags; #define CMDQ_CREATE_CQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION 0x1UL + #define CMDQ_CREATE_CQ_FLAGS_STEERING_TAG_VALID 0x2UL + #define CMDQ_CREATE_CQ_FLAGS_INFINITE_CQ_MODE 0x4UL __le16 cookie; u8 resp_size; u8 reserved8; @@ -1157,6 +1168,8 @@ struct cmdq_create_cq { __le32 dpi; __le32 cq_size; __le64 pbl; + __le16 steering_tag; + u8 reserved48[6]; }; /* creq_create_cq_resp (size:128b/16B) */ @@ -1288,11 +1301,12 @@ struct cmdq_allocate_mrw { #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A 0x3UL #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B 0x4UL #define CMDQ_ALLOCATE_MRW_MRW_FLAGS_LAST CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B - #define CMDQ_ALLOCATE_MRW_UNUSED4_MASK 0xf0UL - #define CMDQ_ALLOCATE_MRW_UNUSED4_SFT 4 + #define CMDQ_ALLOCATE_MRW_STEERING_TAG_VALID 0x10UL + #define CMDQ_ALLOCATE_MRW_UNUSED4_MASK 0xe0UL + #define CMDQ_ALLOCATE_MRW_UNUSED4_SFT 5 u8 access; #define CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY 0x20UL - __le16 unused16; + __le16 steering_tag; __le32 pd_id; }; @@ -1359,14 +1373,16 @@ struct creq_deallocate_key_resp { __le32 bound_window_info; }; -/* cmdq_register_mr (size:384b/48B) */ +/* cmdq_register_mr (size:448b/56B) */ struct cmdq_register_mr { u8 opcode; #define CMDQ_REGISTER_MR_OPCODE_REGISTER_MR 0xfUL #define CMDQ_REGISTER_MR_OPCODE_LAST CMDQ_REGISTER_MR_OPCODE_REGISTER_MR u8 cmd_size; __le16 flags; - #define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR 0x1UL + #define CMDQ_REGISTER_MR_FLAGS_ALLOC_MR 0x1UL + #define CMDQ_REGISTER_MR_FLAGS_STEERING_TAG_VALID 0x2UL + #define CMDQ_REGISTER_MR_FLAGS_ENABLE_RO 0x4UL __le16 cookie; u8 resp_size; u8 reserved8; @@ -1415,6 +1431,8 @@ struct cmdq_register_mr { __le64 pbl; __le64 va; __le64 mr_size; + __le16 steering_tag; + u8 reserved48[6]; }; /* creq_register_mr_resp (size:128b/16B) */ From patchwork Mon Sep 2 05:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13786743 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C1391AACA for ; Mon, 2 Sep 2024 06:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257607; cv=none; b=P7ojQo90tHHRUeBQdmjYy2bzMlGA5FPJLEzJ93ZhkUc+15hFcP0KU/+XNWcwJM20SLcPsB45/LVE4y4su9f1msV8tFeBEC13vnvrmkIwI/DrWoeEqz3wmDswdQEjOMsmS5FSLzVP+GGJA8KoPTjXbEgdHm4+kVnC4c1FqGM6fzY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257607; c=relaxed/simple; bh=MBbNxAb/mVMUvpcJqhyts8SLQrIIZavqqxT+vW01E8s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=kz8+oDmrgWYoF7DRdc/5AkHjW1pLk5j/U0FvbB6KHZr6UYPv4Y2mvbvn8YIQwb9Er5mKo2Kc6N4+O2d9v1ag0FYNX0XT/lgYP+Zw2Kfk1nbafOM9R2/3Yy9ovOmRbIQrc+A9ZNqsWjPEEYVkHTeSw71rAiw0+zngkOJsuHoa8pQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=eHkycqo5; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="eHkycqo5" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-714263cb074so2765719b3a.1 for ; Sun, 01 Sep 2024 23:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725257605; x=1725862405; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=y+pSs4G6UTXAmRixYYXCYgjYOBstIlplC2UOFltRfuY=; b=eHkycqo5kzeKQXpaR99siq2ieoYYYnvwG/YxtuSyOTPEvemHY6okjtA3JY5yne0cJv JUaSjbW2t0MUZ7cQiieOMsJ3oEkGewOzG7U7fyxJffi1aVW3fggE0fc9FXYYDLC5Ry/K peK/57gd+N1TFKt+wJnJs2QS46lEFBYc94atQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725257605; x=1725862405; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y+pSs4G6UTXAmRixYYXCYgjYOBstIlplC2UOFltRfuY=; b=dqLEXCIqB2HBLs2ia1siojFRqQrLnBcIfO7Gzusf4DbGTOZIjVXLtCmwqGAflLUP4W c3XNACB4Px55uuqCvzylg1qFcUtPxE0ahKdBnbO7NNruUSIodGQxmyLrwDnOpeWHb4jK Nh6mmqV/3th93yYZDGv+IWmdMAAdo2yhlaOgw4RUIbLbcNIjHjEjVkUHJWvLrRrEYPrX xPoMPeYzYJ323oc1eV+mAAsLOEcjYQ6SdZaiOx5CwIrQym1+aIlIZNnNQfbxTioJiu5w dewm1kP6+fNFMv6F3aK09ztE3AAlhW5e7+4XEJSaxMabt7m6gKbQlSbx4v+6SW3N3RQU FQWQ== X-Gm-Message-State: AOJu0Yw/hJ10mPODTJMTdqk256zM2g9+EkspeGpdoj9HghvgfELHgd+1 vbhER8WNqfnHNRAoAPTfOcu9ElkvKq2tdbDjgO77ftn/2mZJDwFcHBqdnKxzXg== X-Google-Smtp-Source: AGHT+IHZ/THfUI1dFjzdKpy69a7YDlZCnjDpYatR+pbgCYERNXuh53UgE3VprtwjsaLnl4OYHjq9jg== X-Received: by 2002:a05:6a20:1d56:b0:1ce:f063:853a with SMTP id adf61e73a8af0-1cef0638540mr625440637.0.1725257605193; Sun, 01 Sep 2024 23:13:25 -0700 (PDT) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2054a2629c3sm28907955ad.105.2024.09.01.23.13.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2024 23:13:24 -0700 (PDT) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Selvin Xavier Subject: [PATCH for-next 2/4] RDMA/bnxt_re: Rename a variable Date: Sun, 1 Sep 2024 22:52:29 -0700 Message-Id: <1725256351-12751-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> References: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Kalesh AP Renaming flags to access_flags for clarity. Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 8 ++++---- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 4 ++-- drivers/infiniband/hw/bnxt_re/qplib_sp.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 6ce1db9..d5c9b6a 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -517,7 +517,7 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd) mr->rdev = rdev; mr->qplib_mr.pd = &pd->qplib_pd; mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR; - mr->qplib_mr.flags = __from_ib_access_flags(mr_access_flags); + mr->qplib_mr.access_flags = __from_ib_access_flags(mr_access_flags); rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); if (rc) { ibdev_err(&rdev->ibdev, "Failed to alloc fence-HW-MR\n"); @@ -3868,7 +3868,7 @@ struct ib_mr *bnxt_re_get_dma_mr(struct ib_pd *ib_pd, int mr_access_flags) mr->rdev = rdev; mr->qplib_mr.pd = &pd->qplib_pd; - mr->qplib_mr.flags = __from_ib_access_flags(mr_access_flags); + mr->qplib_mr.access_flags = __from_ib_access_flags(mr_access_flags); mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR; /* Allocate and register 0 as the address */ @@ -3968,7 +3968,7 @@ struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type type, mr->rdev = rdev; mr->qplib_mr.pd = &pd->qplib_pd; - mr->qplib_mr.flags = BNXT_QPLIB_FR_PMR; + mr->qplib_mr.access_flags = BNXT_QPLIB_FR_PMR; mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR; rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); @@ -4085,7 +4085,7 @@ static struct ib_mr *__bnxt_re_user_reg_mr(struct ib_pd *ib_pd, u64 length, u64 mr->rdev = rdev; mr->qplib_mr.pd = &pd->qplib_pd; - mr->qplib_mr.flags = __from_ib_access_flags(mr_access_flags); + mr->qplib_mr.access_flags = __from_ib_access_flags(mr_access_flags); mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR; rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index ca2aa35..c26e8f5 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -544,7 +544,7 @@ int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) req.pd_id = cpu_to_le32(mrw->pd->id); req.mrw_flags = mrw->type; if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR && - mrw->flags & BNXT_QPLIB_FR_PMR) || + mrw->access_flags & BNXT_QPLIB_FR_PMR) || mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A || mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B) req.access = CMDQ_ALLOCATE_MRW_ACCESS_CONSUMER_OWNED_KEY; @@ -656,7 +656,7 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, req.log2_pbl_pg_size = cpu_to_le16(((ilog2(PAGE_SIZE) << CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_SFT) & CMDQ_REGISTER_MR_LOG2_PBL_PG_SIZE_MASK)); - req.access = (mr->flags & 0xFFFF); + req.access = (mr->access_flags & 0xFFFF); req.va = cpu_to_le64(mr->va); req.key = cpu_to_le32(mr->lkey); req.mr_size = cpu_to_le64(mr->total_size); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.h b/drivers/infiniband/hw/bnxt_re/qplib_sp.h index a633e2a..06e74b6 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h @@ -109,7 +109,7 @@ struct bnxt_qplib_ah { struct bnxt_qplib_mrw { struct bnxt_qplib_pd *pd; int type; - u32 flags; + u32 access_flags; #define BNXT_QPLIB_FR_PMR 0x80000000 u32 lkey; u32 rkey; From patchwork Mon Sep 2 05:52:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13786744 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C1931AACA for ; Mon, 2 Sep 2024 06:13:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257610; cv=none; b=sCAM6w0Q/6uaRR9SfEZPaN/xLan1Le0YXZwwKPh/3rIsU4Ws7Q/KQ+o8abgHPrPt76wKtR1td7bIXH9Rwc8OWE4uiEvRj4AW9T3RaET/0E5YungU6K33a1C/ougN0NArReVLpP6i1h7WtrVN+HHNlEU/zF4HkQXjrHsIXkDkbNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257610; c=relaxed/simple; bh=sXmJS2WMQBWus9nTMfzAR07HfXL0vhhEI1Yx61U8pEU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=NrOOnKYUY8mExx06h7J2DSPCoNkpzE7pjrRzJozZyOWuugkCqBtj6/rJ11UoybZerdRAsO03GawtSUSA/j8DmPC/i0hzmLzBEbCKX0UuMoo3ye6ca22vhdR3UqDmsznHxfrcuRlTD8P8EdF/vL2xh8gNA9qgo/0uoWUW7NTa9pg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=S62hLZKV; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="S62hLZKV" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2055f630934so7279625ad.1 for ; Sun, 01 Sep 2024 23:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725257608; x=1725862408; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=KPEjwMCkAJY53axIFi/zWxXhDAR/ShRtXq1gvog/XOc=; b=S62hLZKV04TYeciaGr8kKAXXI5gdWJT5X7z/34nfVXuOvzVjClngJnm6hPhvPsbxDQ JP44jiBOtKVpta43S5i8XvKLWF0/59Kyk2+snekYOWErPvAkhpnu6PHrHqBs6NI5vcu4 HrbfKf/OgvOXWCUFuZK/3MhAZGyhC/U5/2Jp4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725257608; x=1725862408; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KPEjwMCkAJY53axIFi/zWxXhDAR/ShRtXq1gvog/XOc=; b=Xw7GCXMuQzTilNW4VA6fxHEIQVxJmz36aLwGNhQztg467I8PW08t3qUg/TjFO18Bkf G0c1/PkpXsozyhW1ouLLWD2i+IjTbglepVzMnjQyifUXepgn1QMn5NK7aipYS3PMAf+g DngZIebm1TaTz5bpzJb0qa34lKw6aJQFY50kljXokBQOG1UO5V8AEgbWbDNdAWkpyTFo Dyo22mhJVSWbs/x++q1gj/dD/nizl7IizViEdhZEf5aqye4J4uVMqUW/iqgvb5/j2p36 wNW5aLIXJ2G2TOpAnnc0L+tE13elbXWOlVKJQlVmX+JNFIEP98vS3Jh6K9hU7PgRHI+K GQrg== X-Gm-Message-State: AOJu0YwqkrJNtgioGmRKQAQHmsXu/sQFRO8ZhjVyW0+TqgCdZzT7SLF/ jr5WMpryoAOgs3ENt6PBPrS+Eo/44L3dKfakEqlpHqmzE1p8/Say3YbwCgoNahlX00yNtVlcDDJ HrA== X-Google-Smtp-Source: AGHT+IHIq3MrOBRSZ74qfrfayrad7dykd0PJ4mCdPGdW8AXC++DAbV8ECfECh2Z1ldQ7UuZ642WnXQ== X-Received: by 2002:a17:902:ce85:b0:205:937f:3ae3 with SMTP id d9443c01a7336-205937f4326mr785155ad.44.1725257607899; Sun, 01 Sep 2024 23:13:27 -0700 (PDT) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2054a2629c3sm28907955ad.105.2024.09.01.23.13.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2024 23:13:27 -0700 (PDT) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Selvin Xavier Subject: [PATCH for-next 3/4] RDMA/bnxt_re: Avoid an extra hwrm per MR creation Date: Sun, 1 Sep 2024 22:52:30 -0700 Message-Id: <1725256351-12751-4-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> References: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Kalesh AP Firmware now have a new mr registration command where both MR allocation and registration can be done in a single hwrm command. Driver has to issue this new hwrm command whenever the support flag is set. This reduces the number of hwrm issued per MR creation and speed up the MR creation. Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 36 +++++++++++++++++++------------ drivers/infiniband/hw/bnxt_re/qplib_res.h | 5 +++++ drivers/infiniband/hw/bnxt_re/qplib_sp.c | 8 +++++++ drivers/infiniband/hw/bnxt_re/qplib_sp.h | 1 + 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index d5c9b6a..50cf3ec 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -518,14 +518,18 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd) mr->qplib_mr.pd = &pd->qplib_pd; mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR; mr->qplib_mr.access_flags = __from_ib_access_flags(mr_access_flags); - rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); - if (rc) { - ibdev_err(&rdev->ibdev, "Failed to alloc fence-HW-MR\n"); - goto fail; - } + if (!_is_alloc_mr_unified(rdev->dev_attr.dev_cap_flags)) { + rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); + if (rc) { + ibdev_err(&rdev->ibdev, "Failed to alloc fence-HW-MR\n"); + goto fail; + } - /* Register MR */ - mr->ib_mr.lkey = mr->qplib_mr.lkey; + /* Register MR */ + mr->ib_mr.lkey = mr->qplib_mr.lkey; + } else { + mr->qplib_mr.flags = CMDQ_REGISTER_MR_FLAGS_ALLOC_MR; + } mr->qplib_mr.va = (u64)(unsigned long)fence->va; mr->qplib_mr.total_size = BNXT_RE_FENCE_BYTES; rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, NULL, @@ -4088,14 +4092,18 @@ static struct ib_mr *__bnxt_re_user_reg_mr(struct ib_pd *ib_pd, u64 length, u64 mr->qplib_mr.access_flags = __from_ib_access_flags(mr_access_flags); mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_MR; - rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); - if (rc) { - ibdev_err(&rdev->ibdev, "Failed to allocate MR rc = %d", rc); - rc = -EIO; - goto free_mr; + if (!_is_alloc_mr_unified(rdev->dev_attr.dev_cap_flags)) { + rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); + if (rc) { + ibdev_err(&rdev->ibdev, "Failed to allocate MR rc = %d", rc); + rc = -EIO; + goto free_mr; + } + /* The fixed portion of the rkey is the same as the lkey */ + mr->ib_mr.rkey = mr->qplib_mr.rkey; + } else { + mr->qplib_mr.flags = CMDQ_REGISTER_MR_FLAGS_ALLOC_MR; } - /* The fixed portion of the rkey is the same as the lkey */ - mr->ib_mr.rkey = mr->qplib_mr.rkey; mr->ib_umem = umem; mr->qplib_mr.va = virt_addr; mr->qplib_mr.total_size = length; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h index a0f78cd..b452b2f 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.h @@ -565,4 +565,9 @@ static inline u8 bnxt_qplib_dbr_pacing_en(struct bnxt_qplib_chip_ctx *cctx) return cctx->modes.dbr_pacing; } +static inline bool _is_alloc_mr_unified(u16 dev_cap_flags) +{ + return dev_cap_flags & CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC; +} + #endif /* __BNXT_QPLIB_RES_H__ */ diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index c26e8f5..4f75e7e 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -659,6 +659,9 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, req.access = (mr->access_flags & 0xFFFF); req.va = cpu_to_le64(mr->va); req.key = cpu_to_le32(mr->lkey); + if (_is_alloc_mr_unified(res->dattr->dev_cap_flags)) + req.key = cpu_to_le32(mr->pd->id); + req.flags = cpu_to_le16(mr->flags); req.mr_size = cpu_to_le64(mr->total_size); bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, NULL, sizeof(req), @@ -667,6 +670,11 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, if (rc) goto fail; + if (_is_alloc_mr_unified(res->dattr->dev_cap_flags)) { + mr->lkey = le32_to_cpu(resp.xid); + mr->rkey = mr->lkey; + } + return 0; fail: diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.h b/drivers/infiniband/hw/bnxt_re/qplib_sp.h index 06e74b6..4ce44aa 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h @@ -117,6 +117,7 @@ struct bnxt_qplib_mrw { u64 va; u64 total_size; u32 npages; + u16 flags; u64 mr_handle; struct bnxt_qplib_hwq hwq; }; From patchwork Mon Sep 2 05:52:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13786745 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C009154C00 for ; Mon, 2 Sep 2024 06:13:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257614; cv=none; b=F9vv2bADjY0eC1qvneQ9L+gTJbhYkdT5Oy3JE292ND75fUrHTHmgNNrEGF0XDHwuXPh725TPeUjqOtuzDjKM0iuGyW6aGe5VyySxEfu7JOEv8kqTxdnL8iRHKp/DS9j3D3VJUiSypwVYJIGcHIsO3w3OwIRMXU3qKw1XX1xzAcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725257614; c=relaxed/simple; bh=cOyciZmrtJ50Kt8IZMalAG2P3Xqu7Fn9kGjUo7vuE4E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=uxMPY3bKUm8EXu0dTKFt1Cf73HnqLuE1wi5UtkobFcq69WU+xbmyIwG1rQ2+bnPnWLlOpO6S9wg/tEphuXd0m+OgRbgniqM/W/hpNx7jpZl15WZ+nB/yX8S6kxkk9fjl7bbf7DkZAaUq0EIeR0aFxdFU7DtbCbeP/7YlgbuBqf0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=LsdpTg1m; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="LsdpTg1m" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2055a3f80a4so6076995ad.2 for ; Sun, 01 Sep 2024 23:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725257611; x=1725862411; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Z2KugG7I1eBzOpFBMSKxsiL2Kwnc/YnNno1Vj2AryAo=; b=LsdpTg1m0OA85BqIldWs1p63A3U50xL2drdq5ZEKAWL8BrxDr+y+/zJLqdoijUKXz/ Nq2q5/tyz6Xj8XYwL9kPUZpaggWmWmUb2NfkzEIRLdM2KDurPi3bmmDsTwOE0a1sIeJq wRG3AuykEG0BJwt9DZF41BG3+6NG8Lb6LU93A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725257611; x=1725862411; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z2KugG7I1eBzOpFBMSKxsiL2Kwnc/YnNno1Vj2AryAo=; b=r4F16656Szf7mx8fK3crcOKkcglwaqMi+YaWBFzp0uIyEI1tXKqunLTMVTxZ2AOa8G qzPBvsO7+RSeNUy6+t3lOsaxLNiCAXlLRESgsUhTQjqCgQPv8WyoHbmgU6WX6MvTqK3u uG+RSvfKDzTfSL1lMQfCFek0XvuZSwR+3UKkqplfKcWCUXo3RycSN4D756puOJVq5YTK gW2JJwORRSIvI9fknIlF4FKYCQtho5v0/+i/ZXzxMAknlOsbzBroS3D9XnoMEg+hXdM3 bzWSq4vyUtgLM6g+JQTebQFeVecJPogPI5xdEhmuhiiDgbYFRpZIghrvP12D1PpnNkHb xO4Q== X-Gm-Message-State: AOJu0YzENb53dvdM7VitAEeVvqJg0LFc/a+s/I3xKZQYsAh7+NtLYNcu jmsi+OHsi2loH2TwPwQhCGDxBLONpzgdPPca9Wq3gcZalY6HxUd2qcRJNMU5Iw== X-Google-Smtp-Source: AGHT+IHlsNtE8ZbLvq2OVn4EMi+RPGnoUuig4XLLTt7qsVIiugEJ2StQEk+OOhrFY4/WQCnF975kvQ== X-Received: by 2002:a17:903:230c:b0:205:5155:c05 with SMTP id d9443c01a7336-20551550d58mr40109365ad.60.1725257610563; Sun, 01 Sep 2024 23:13:30 -0700 (PDT) Received: from sxavier-dev.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2054a2629c3sm28907955ad.105.2024.09.01.23.13.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Sep 2024 23:13:29 -0700 (PDT) From: Selvin Xavier To: leon@kernel.org, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, kalesh-anakkur.purayil@broadcom.com, Selvin Xavier Subject: [PATCH for-next 4/4] RDMA/bnxt_re: Add support for MR Relaxed Ordering Date: Sun, 1 Sep 2024 22:52:31 -0700 Message-Id: <1725256351-12751-5-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> References: <1725256351-12751-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: From: Kalesh AP Some of the adapters support Relaxed Ordering for the MRs. Driver queries support for Memory region relax ordering support from firmware and set relax ordering bit in REGISTER_MR request, if the users request for the support. Also, this is supported only if the PCIe device has enabled relaxed ordering attribute. Reviewed-by: Chandramohan Akula Reviewed-by: Selvin Xavier Reviewed-by: Vijay Kumar Mandadapu Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 14 ++++++++++++++ drivers/infiniband/hw/bnxt_re/qplib_res.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 50cf3ec..a081580 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -115,6 +115,14 @@ static enum ib_access_flags __to_ib_access_flags(int qflags) return iflags; }; +static void bnxt_re_check_and_set_relaxed_ordering(struct bnxt_re_dev *rdev, + struct bnxt_qplib_mrw *qplib_mr) +{ + if (_is_relaxed_ordering_supported(rdev->dev_attr.dev_cap_flags2) && + pcie_relaxed_ordering_enabled(rdev->en_dev->pdev)) + qplib_mr->flags |= CMDQ_REGISTER_MR_FLAGS_ENABLE_RO; +} + static int bnxt_re_build_sgl(struct ib_sge *ib_sg_list, struct bnxt_qplib_sge *sg_list, int num) { @@ -3875,6 +3883,9 @@ struct ib_mr *bnxt_re_get_dma_mr(struct ib_pd *ib_pd, int mr_access_flags) mr->qplib_mr.access_flags = __from_ib_access_flags(mr_access_flags); mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR; + if (mr_access_flags & IB_ACCESS_RELAXED_ORDERING) + bnxt_re_check_and_set_relaxed_ordering(rdev, &mr->qplib_mr); + /* Allocate and register 0 as the address */ rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr); if (rc) @@ -4108,6 +4119,9 @@ static struct ib_mr *__bnxt_re_user_reg_mr(struct ib_pd *ib_pd, u64 length, u64 mr->qplib_mr.va = virt_addr; mr->qplib_mr.total_size = length; + if (mr_access_flags & IB_ACCESS_RELAXED_ORDERING) + bnxt_re_check_and_set_relaxed_ordering(rdev, &mr->qplib_mr); + umem_pgs = ib_umem_num_dma_blocks(umem, page_size); rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, umem, umem_pgs, page_size); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h index b452b2f..049805a 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.h @@ -570,4 +570,9 @@ static inline bool _is_alloc_mr_unified(u16 dev_cap_flags) return dev_cap_flags & CREQ_QUERY_FUNC_RESP_SB_MR_REGISTER_ALLOC; } +static inline bool _is_relaxed_ordering_supported(u16 dev_cap_ext_flags2) +{ + return dev_cap_ext_flags2 & CREQ_QUERY_FUNC_RESP_SB_MEMORY_REGION_RO_SUPPORTED; +} + #endif /* __BNXT_QPLIB_RES_H__ */