From patchwork Sat Oct 27 10:56:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 10658335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C7C1615A7 for ; Sat, 27 Oct 2018 10:54:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C19652B1A1 for ; Sat, 27 Oct 2018 10:54:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B36A62B5E8; Sat, 27 Oct 2018 10:54:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5687C2B1A1 for ; Sat, 27 Oct 2018 10:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728398AbeJ0TfT (ORCPT ); Sat, 27 Oct 2018 15:35:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:52333 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728477AbeJ0TfT (ORCPT ); Sat, 27 Oct 2018 15:35:19 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E722C5130F7C5; Sat, 27 Oct 2018 18:54:42 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.408.0; Sat, 27 Oct 2018 18:54:40 +0800 From: Lijun Ou To: , CC: , Subject: [PATCH rdma-core 3/6] libhns: Add query srq verb for hip08 user mode Date: Sat, 27 Oct 2018 18:56:34 +0800 Message-ID: <1540637797-97065-4-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1540637797-97065-1-git-send-email-oulijun@huawei.com> References: <1540637797-97065-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch mainly implement the verbs of querying srq for hip08 userspace library. Signed-off-by: Lijun Ou --- providers/hns/hns_roce_u.c | 1 + providers/hns/hns_roce_u.h | 1 + providers/hns/hns_roce_u_verbs.c | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c index 81b74f3..9b46e25 100644 --- a/providers/hns/hns_roce_u.c +++ b/providers/hns/hns_roce_u.c @@ -80,6 +80,7 @@ static const struct verbs_context_ops hns_common_ops = { .rereg_mr = hns_roce_u_rereg_mr, .create_srq = hns_roce_u_create_srq, .modify_srq = hns_roce_u_modify_srq, + .query_srq = hns_roce_u_query_srq, }; static struct verbs_context *hns_roce_alloc_context(struct ibv_device *ibdev, diff --git a/providers/hns/hns_roce_u.h b/providers/hns/hns_roce_u.h index dd9ba88..2b307e3 100644 --- a/providers/hns/hns_roce_u.h +++ b/providers/hns/hns_roce_u.h @@ -305,6 +305,7 @@ struct ibv_srq *hns_roce_u_create_srq(struct ibv_pd *pd, struct ibv_srq_init_attr *srq_init_attr); int hns_roce_u_modify_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr, int srq_attr_mask); +int hns_roce_u_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr); struct ibv_qp *hns_roce_u_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr); diff --git a/providers/hns/hns_roce_u_verbs.c b/providers/hns/hns_roce_u_verbs.c index 379d78d..5106a35 100644 --- a/providers/hns/hns_roce_u_verbs.c +++ b/providers/hns/hns_roce_u_verbs.c @@ -589,6 +589,13 @@ int hns_roce_u_modify_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr, sizeof(cmd)); } +int hns_roce_u_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr) +{ + struct ibv_query_srq cmd; + + return ibv_cmd_query_srq(srq, srq_attr, &cmd, sizeof(cmd)); +} + static int hns_roce_verify_qp(struct ibv_qp_init_attr *attr, struct hns_roce_context *context) {