From patchwork Tue Nov 9 12:40:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85BE5C433F5 for ; Tue, 9 Nov 2021 12:45:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6386D610A8 for ; Tue, 9 Nov 2021 12:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244498AbhKIMsi (ORCPT ); Tue, 9 Nov 2021 07:48:38 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:27189 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245080AbhKIMsX (ORCPT ); Tue, 9 Nov 2021 07:48:23 -0500 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HpSMt3K2Bz8vJn; Tue, 9 Nov 2021 20:43:54 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:29 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:29 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 1/7] libhns: Remove unused macros Date: Tue, 9 Nov 2021 20:40:57 +0800 Message-ID: <20211109124103.54326-2-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Lang Cheng These macros used to work, but are no longer used, they should be removed. Fixes: 516b8d4e4ebe ("providers: Use the new match_device and allocate_device ops") Fixes: 887b78c80224 ("libhns: Add initial main frame") Signed-off-by: Lang Cheng Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c index 3b31ad37..9dc4905d 100644 --- a/providers/hns/hns_roce_u.c +++ b/providers/hns/hns_roce_u.c @@ -41,9 +41,6 @@ static void hns_roce_free_context(struct ibv_context *ibctx); -#define HID_LEN 15 -#define DEV_MATCH_LEN 128 - #ifndef PCI_VENDOR_ID_HUAWEI #define PCI_VENDOR_ID_HUAWEI 0x19E5 #endif From patchwork Tue Nov 9 12:40:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9EA8C433FE for ; Tue, 9 Nov 2021 12:45:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FC1A610A3 for ; Tue, 9 Nov 2021 12:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244529AbhKIMsl (ORCPT ); Tue, 9 Nov 2021 07:48:41 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:15377 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245718AbhKIMsX (ORCPT ); Tue, 9 Nov 2021 07:48:23 -0500 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HpSPR5wxpz90wS; Tue, 9 Nov 2021 20:45:15 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:29 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 2/7] libhns: Remove unsupported QP type Date: Tue, 9 Nov 2021 20:40:58 +0800 Message-ID: <20211109124103.54326-3-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Currently, user space does not support UC type QP. Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u_hw_v1.c | 1 - providers/hns/hns_roce_u_hw_v2.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/providers/hns/hns_roce_u_hw_v1.c b/providers/hns/hns_roce_u_hw_v1.c index 5385d1c4..ef346424 100644 --- a/providers/hns/hns_roce_u_hw_v1.c +++ b/providers/hns/hns_roce_u_hw_v1.c @@ -539,7 +539,6 @@ static int hns_roce_u_v1_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, ctrl->flag |= htole32(ps_opcode); wqe += sizeof(struct hns_roce_wqe_raddr_seg); break; - case IBV_QPT_UC: case IBV_QPT_UD: default: break; diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 66ecd84a..1e8df6ef 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -460,8 +460,7 @@ static int hns_roce_handle_recv_inl_wqe(struct hns_roce_v2_cqe *cqe, struct hns_roce_qp **cur_qp, struct ibv_wc *wc, uint32_t opcode) { - if (((*cur_qp)->verbs_qp.qp.qp_type == IBV_QPT_RC || - (*cur_qp)->verbs_qp.qp.qp_type == IBV_QPT_UC) && + if (((*cur_qp)->verbs_qp.qp.qp_type == IBV_QPT_RC) && (opcode == HNS_ROCE_RECV_OP_SEND || opcode == HNS_ROCE_RECV_OP_SEND_WITH_IMM || opcode == HNS_ROCE_RECV_OP_SEND_WITH_INV) && From patchwork Tue Nov 9 12:40:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2569CC433EF for ; Tue, 9 Nov 2021 12:45:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E3C0610A8 for ; Tue, 9 Nov 2021 12:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244520AbhKIMsj (ORCPT ); Tue, 9 Nov 2021 07:48:39 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:27190 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245097AbhKIMsX (ORCPT ); Tue, 9 Nov 2021 07:48:23 -0500 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HpSMt5Zc3z8v11; Tue, 9 Nov 2021 20:43:54 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 3/7] libhns: Remove redundant variable initialization Date: Tue, 9 Nov 2021 20:40:59 +0800 Message-ID: <20211109124103.54326-4-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Yixing Liu The variable of owner_bit has been assigned before the reference, so there is no need to initialize. Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 1e8df6ef..31a0681d 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -1375,9 +1375,9 @@ static void __hns_roce_v2_cq_clean(struct hns_roce_cq *cq, uint32_t qpn, { int nfreed = 0; bool is_recv_cqe; + uint8_t owner_bit; uint16_t wqe_index; uint32_t prod_index; - uint8_t owner_bit = 0; struct hns_roce_v2_cqe *cqe, *dest; struct hns_roce_context *ctx = to_hr_ctx(cq->ibv_cq.context); From patchwork Tue Nov 9 12:41:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CC33C4332F for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA99C610A5 for ; Tue, 9 Nov 2021 12:45:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244542AbhKIMsl (ORCPT ); Tue, 9 Nov 2021 07:48:41 -0500 Received: from szxga08-in.huawei.com ([45.249.212.255]:27124 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343557AbhKIMsY (ORCPT ); Tue, 9 Nov 2021 07:48:24 -0500 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4HpSM94zb2z1DJGc; Tue, 9 Nov 2021 20:43:17 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 4/7] libhns: Fix wrong print format for unsigned type Date: Tue, 9 Nov 2021 20:41:00 +0800 Message-ID: <20211109124103.54326-5-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Xinhao Liu Change %d printf fortmat to %u for unsigned int variant. Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c index 382d2bd7..c0069b8b 100644 --- a/providers/hns/hns_roce_u_verbs.c +++ b/providers/hns/hns_roce_u_verbs.c @@ -73,7 +73,7 @@ int hns_roce_u_query_device(struct ibv_context *context, sub_minor = raw_fw_ver & 0xffff; snprintf(attr->orig_attr.fw_ver, sizeof(attr->orig_attr.fw_ver), - "%d.%d.%03d", major, minor, sub_minor); + "%u.%u.%03u", major, minor, sub_minor); return 0; } From patchwork Tue Nov 9 12:41:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80FCEC43217 for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 675D661077 for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244579AbhKIMsm (ORCPT ); Tue, 9 Nov 2021 07:48:42 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:27191 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343585AbhKIMsZ (ORCPT ); Tue, 9 Nov 2021 07:48:25 -0500 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HpSMv0nsRz8vH0; Tue, 9 Nov 2021 20:43:55 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 5/7] libhns: Fix wrong type of variables and fields Date: Tue, 9 Nov 2021 20:41:01 +0800 Message-ID: <20211109124103.54326-6-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Xinhao Liu Some variables and fields should be in type of unsigned instead of signed. Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u.h | 6 +++--- providers/hns/hns_roce_u_hw_v1.c | 6 +++--- providers/hns/hns_roce_u_hw_v2.c | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h index 0d7abd81..d5963941 100644 --- a/providers/hns/hns_roce_u.h +++ b/providers/hns/hns_roce_u.h @@ -99,7 +99,7 @@ #define roce_set_bit(origin, shift, val) \ roce_set_field((origin), (1ul << (shift)), (shift), (val)) -#define hr_ilog32(n) ilog32((n) - 1) +#define hr_ilog32(n) ilog32((unsigned int)(n) - 1) enum { HNS_ROCE_QP_TABLE_BITS = 8, @@ -203,7 +203,7 @@ struct hns_roce_cq { struct hns_roce_idx_que { struct hns_roce_buf buf; - int entry_shift; + unsigned int entry_shift; unsigned long *bitmap; int bitmap_cnt; unsigned int head; @@ -249,7 +249,7 @@ struct hns_roce_sge_info { struct hns_roce_sge_ex { int offset; unsigned int sge_cnt; - int sge_shift; + unsigned int sge_shift; }; struct hns_roce_rinl_sge { diff --git a/providers/hns/hns_roce_u_hw_v1.c b/providers/hns/hns_roce_u_hw_v1.c index ef346424..cc97de30 100644 --- a/providers/hns/hns_roce_u_hw_v1.c +++ b/providers/hns/hns_roce_u_hw_v1.c @@ -220,7 +220,7 @@ static int hns_roce_wq_overflow(struct hns_roce_wq *wq, int nreq, static struct hns_roce_qp *hns_roce_find_qp(struct hns_roce_context *ctx, uint32_t qpn) { - int tind = (qpn & (ctx->num_qps - 1)) >> ctx->qp_table_shift; + uint32_t tind = (qpn & (ctx->num_qps - 1)) >> ctx->qp_table_shift; if (ctx->qp_table[tind].refcnt) { return ctx->qp_table[tind].table[qpn & ctx->qp_table_mask]; @@ -232,7 +232,7 @@ static struct hns_roce_qp *hns_roce_find_qp(struct hns_roce_context *ctx, static void hns_roce_clear_qp(struct hns_roce_context *ctx, uint32_t qpn) { - int tind = (qpn & (ctx->num_qps - 1)) >> ctx->qp_table_shift; + uint32_t tind = (qpn & (ctx->num_qps - 1)) >> ctx->qp_table_shift; if (!--ctx->qp_table[tind].refcnt) free(ctx->qp_table[tind].table); @@ -739,7 +739,7 @@ static int hns_roce_u_v1_post_recv(struct ibv_qp *ibvqp, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr) { int ret = 0; - int nreq; + unsigned int nreq; struct ibv_sge *sg; struct hns_roce_rc_rq_wqe *rq_wqe; struct hns_roce_qp *qp = to_hr_qp(ibvqp); diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index 31a0681d..4943a5b1 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -247,7 +247,7 @@ static void *get_srq_wqe(struct hns_roce_srq *srq, unsigned int n) return srq->wqe_buf.buf + (n << srq->wqe_shift); } -static void *get_idx_buf(struct hns_roce_idx_que *idx_que, int n) +static void *get_idx_buf(struct hns_roce_idx_que *idx_que, unsigned int n) { return idx_que->buf.buf + (n << idx_que->entry_shift); } @@ -331,7 +331,7 @@ static void hns_roce_v2_update_cq_cons_index(struct hns_roce_context *ctx, static struct hns_roce_qp *hns_roce_v2_find_qp(struct hns_roce_context *ctx, uint32_t qpn) { - int tind = (qpn & (ctx->num_qps - 1)) >> ctx->qp_table_shift; + uint32_t tind = (qpn & (ctx->num_qps - 1)) >> ctx->qp_table_shift; if (ctx->qp_table[tind].refcnt) return ctx->qp_table[tind].table[qpn & ctx->qp_table_mask]; @@ -961,9 +961,8 @@ static int fill_ud_data_seg(struct hns_roce_ud_sq_wqe *ud_sq_wqe, return ret; } -static int set_ud_wqe(void *wqe, struct hns_roce_qp *qp, - struct ibv_send_wr *wr, int nreq, - struct hns_roce_sge_info *sge_info) +static int set_ud_wqe(void *wqe, struct hns_roce_qp *qp, struct ibv_send_wr *wr, + unsigned int nreq, struct hns_roce_sge_info *sge_info) { struct hns_roce_ah *ah = to_hr_ah(wr->wr.ud.ah); struct hns_roce_ud_sq_wqe *ud_sq_wqe = wqe; @@ -1119,7 +1118,7 @@ static int check_rc_opcode(struct hns_roce_rc_sq_wqe *wqe, } static int set_rc_wqe(void *wqe, struct hns_roce_qp *qp, struct ibv_send_wr *wr, - int nreq, struct hns_roce_sge_info *sge_info) + unsigned int nreq, struct hns_roce_sge_info *sge_info) { struct hns_roce_rc_sq_wqe *rc_sq_wqe = wqe; struct hns_roce_v2_wqe_data_seg *dseg; From patchwork Tue Nov 9 12:41:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1673C433F5 for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB204610A8 for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244992AbhKIMsm (ORCPT ); Tue, 9 Nov 2021 07:48:42 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:15812 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343641AbhKIMsZ (ORCPT ); Tue, 9 Nov 2021 07:48:25 -0500 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HpSPS366Fz90xV; Tue, 9 Nov 2021 20:45:16 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 6/7] libhns: The content of the header file should be protected with #define Date: Tue, 9 Nov 2021 20:41:02 +0800 Message-ID: <20211109124103.54326-7-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Xinhao Liu Header files should be protected with #define to prevent repeated inclusion. Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u_db.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/hns/hns_roce_u_db.h b/providers/hns/hns_roce_u_db.h index b44e64d4..c3dd583a 100644 --- a/providers/hns/hns_roce_u_db.h +++ b/providers/hns/hns_roce_u_db.h @@ -30,13 +30,13 @@ * SOFTWARE. */ +#ifndef _HNS_ROCE_U_DB_H +#define _HNS_ROCE_U_DB_H + #include #include "hns_roce_u.h" -#ifndef _HNS_ROCE_U_DB_H -#define _HNS_ROCE_U_DB_H - #if __BYTE_ORDER == __LITTLE_ENDIAN #define HNS_ROCE_PAIR_TO_64(val) ((uint64_t) val[1] << 32 | val[0]) #elif __BYTE_ORDER == __BIG_ENDIAN From patchwork Tue Nov 9 12:41:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenpeng Liang X-Patchwork-Id: 12610531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24906C43219 for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CFA3610E9 for ; Tue, 9 Nov 2021 12:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244546AbhKIMsm (ORCPT ); Tue, 9 Nov 2021 07:48:42 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:27192 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343608AbhKIMsZ (ORCPT ); Tue, 9 Nov 2021 07:48:25 -0500 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HpSMv2tkQz8vK6; Tue, 9 Nov 2021 20:43:55 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 Received: from localhost.localdomain (10.67.165.24) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.15; Tue, 9 Nov 2021 20:45:30 +0800 From: Wenpeng Liang To: , CC: , Subject: [PATCH rdma-core 7/7] libhns: The function declaration should be the same as the definition Date: Tue, 9 Nov 2021 20:41:03 +0800 Message-ID: <20211109124103.54326-8-liangwenpeng@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211109124103.54326-1-liangwenpeng@huawei.com> References: <20211109124103.54326-1-liangwenpeng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Xinhao Liu The parameter names should be the same when the function is declared and defined. Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang --- providers/hns/hns_roce_u.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h index d5963941..1616db9f 100644 --- a/providers/hns/hns_roce_u.h +++ b/providers/hns/hns_roce_u.h @@ -368,9 +368,9 @@ int hns_roce_u_free_pd(struct ibv_pd *pd); struct ibv_mr *hns_roce_u_reg_mr(struct ibv_pd *pd, void *addr, size_t length, uint64_t hca_va, int access); -int hns_roce_u_rereg_mr(struct verbs_mr *mr, int flags, struct ibv_pd *pd, +int hns_roce_u_rereg_mr(struct verbs_mr *vmr, int flags, struct ibv_pd *pd, void *addr, size_t length, int access); -int hns_roce_u_dereg_mr(struct verbs_mr *mr); +int hns_roce_u_dereg_mr(struct verbs_mr *vmr); struct ibv_mw *hns_roce_u_alloc_mw(struct ibv_pd *pd, enum ibv_mw_type type); int hns_roce_u_dealloc_mw(struct ibv_mw *mw);