From patchwork Sun Jan 27 15:28:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10782913 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 9DA596C2 for ; Sun, 27 Jan 2019 15:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ACF12AA33 for ; Sun, 27 Jan 2019 15:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F4A92AA36; Sun, 27 Jan 2019 15:29:38 +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,UNPARSEABLE_RELAY 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 DC47D2AA33 for ; Sun, 27 Jan 2019 15:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbfA0P3h (ORCPT ); Sun, 27 Jan 2019 10:29:37 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:49265 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726357AbfA0P3h (ORCPT ); Sun, 27 Jan 2019 10:29:37 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 27 Jan 2019 17:29:32 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x0RFTWBl014746; Sun, 27 Jan 2019 17:29:32 +0200 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id x0RFTWfd011521; Sun, 27 Jan 2019 17:29:32 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id x0RFTWh7011520; Sun, 27 Jan 2019 17:29:32 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, danitg@mellanox.com, yosefe@mellanox.com, maxg@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 1/3] rdmacm: Expose rdma_init_qp_attr Date: Sun, 27 Jan 2019 17:28:55 +0200 Message-Id: <1548602938-11370-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1548602938-11370-1-git-send-email-yishaih@mellanox.com> References: <1548602938-11370-1-git-send-email-yishaih@mellanox.com> 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 From: Danit Goldberg Expose the internal function 'rdma_init_qp_attr' in librdmacm API. Applications can get the parameters for creating AH (needed for DC QP), or control QP attributes after its creation. Signed-off-by: Danit Goldberg Signed-off-by: Yossi Itigin Signed-off-by: Yishai Hadas --- debian/librdmacm-dev.install | 1 + debian/librdmacm1.symbols | 2 ++ librdmacm/CMakeLists.txt | 2 +- librdmacm/cma.c | 4 +-- librdmacm/librdmacm.map | 5 ++++ librdmacm/man/CMakeLists.txt | 1 + librdmacm/man/rdma_init_qp_attr.3.md | 54 ++++++++++++++++++++++++++++++++++++ librdmacm/rdma_cma.h | 10 +++++++ 8 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 librdmacm/man/rdma_init_qp_attr.3.md diff --git a/debian/librdmacm-dev.install b/debian/librdmacm-dev.install index b8f643c..fe1b755 100644 --- a/debian/librdmacm-dev.install +++ b/debian/librdmacm-dev.install @@ -34,6 +34,7 @@ usr/share/man/man3/rdma_get_request.3 usr/share/man/man3/rdma_get_send_comp.3 usr/share/man/man3/rdma_get_src_port.3 usr/share/man/man3/rdma_getaddrinfo.3 +usr/share/man/man3/rdma_init_qp_attr.3 usr/share/man/man3/rdma_join_multicast.3 usr/share/man/man3/rdma_join_multicast_ex.3 usr/share/man/man3/rdma_leave_multicast.3 diff --git a/debian/librdmacm1.symbols b/debian/librdmacm1.symbols index 0fea265..0d1a54f 100644 --- a/debian/librdmacm1.symbols +++ b/debian/librdmacm1.symbols @@ -2,6 +2,7 @@ librdmacm.so.1 librdmacm1 #MINVER# * Build-Depends-Package: librdmacm-dev RDMACM_1.0@RDMACM_1.0 1.0.15 RDMACM_1.1@RDMACM_1.1 16 + RDMACM_1.2@RDMACM_1.2 23 raccept@RDMACM_1.0 1.0.16 rbind@RDMACM_1.0 1.0.16 rclose@RDMACM_1.0 1.0.16 @@ -32,6 +33,7 @@ librdmacm.so.1 librdmacm1 #MINVER# rdma_get_request@RDMACM_1.0 1.0.15 rdma_get_src_port@RDMACM_1.0 1.0.19 rdma_getaddrinfo@RDMACM_1.0 1.0.15 + rdma_init_qp_attr@RDMACM_1.2 23 rdma_join_multicast@RDMACM_1.0 1.0.15 rdma_join_multicast_ex@RDMACM_1.1 16 rdma_leave_multicast@RDMACM_1.0 1.0.15 diff --git a/librdmacm/CMakeLists.txt b/librdmacm/CMakeLists.txt index f71e407..b0329ad 100644 --- a/librdmacm/CMakeLists.txt +++ b/librdmacm/CMakeLists.txt @@ -10,7 +10,7 @@ publish_headers(infiniband rdma_library(rdmacm librdmacm.map # See Documentation/versioning.md - 1 1.1.${PACKAGE_VERSION} + 1 1.2.${PACKAGE_VERSION} acm.c addrinfo.c cma.c diff --git a/librdmacm/cma.c b/librdmacm/cma.c index 628d883..687ffd7 100644 --- a/librdmacm/cma.c +++ b/librdmacm/cma.c @@ -991,8 +991,8 @@ static int ucma_is_ud_qp(enum ibv_qp_type qp_type) return (qp_type == IBV_QPT_UD); } -static int rdma_init_qp_attr(struct rdma_cm_id *id, struct ibv_qp_attr *qp_attr, - int *qp_attr_mask) +int rdma_init_qp_attr(struct rdma_cm_id *id, struct ibv_qp_attr *qp_attr, + int *qp_attr_mask) { struct ucma_abi_init_qp_attr cmd; struct ib_uverbs_qp_attr resp; diff --git a/librdmacm/librdmacm.map b/librdmacm/librdmacm.map index 5813d74..bde1bc4 100644 --- a/librdmacm/librdmacm.map +++ b/librdmacm/librdmacm.map @@ -76,3 +76,8 @@ RDMACM_1.1 { global: rdma_join_multicast_ex; } RDMACM_1.0; + +RDMACM_1.2 { + global: + rdma_init_qp_attr; +} RDMACM_1.1; diff --git a/librdmacm/man/CMakeLists.txt b/librdmacm/man/CMakeLists.txt index d016c92..aec3b6b 100644 --- a/librdmacm/man/CMakeLists.txt +++ b/librdmacm/man/CMakeLists.txt @@ -32,6 +32,7 @@ rdma_man_pages( rdma_get_send_comp.3 rdma_get_src_port.3 rdma_getaddrinfo.3 + rdma_init_qp_attr.3.md rdma_join_multicast.3 rdma_join_multicast_ex.3 rdma_leave_multicast.3 diff --git a/librdmacm/man/rdma_init_qp_attr.3.md b/librdmacm/man/rdma_init_qp_attr.3.md new file mode 100644 index 0000000..99e812a --- /dev/null +++ b/librdmacm/man/rdma_init_qp_attr.3.md @@ -0,0 +1,54 @@ +--- +date: 2018-12-31 +footer: librdmacm +header: "Librdmacm Programmer's Manual" +layout: page +license: 'Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md' +section: 3 +title: RDMA_INIT_QP_ATTR +--- + +# NAME + +rdma_init_qp_attr - Returns qp attributes of a rdma_cm_id. + +# SYNOPSIS + +```c +#include + +int rdma_init_qp_attr(struct rdma_cm_id *id, + struct ibv_qp_attr *qp_attr, + int *qp_attr_mask); +``` +# DESCRIPTION + +**rdma_init_qp_attr()** returns qp attributes of a rdma_cm_id. + +Information about qp attributes and qp attributes mask is returned through the *qp_attr* and *qp_attr_mask* parameters. + +For details on the qp_attr structure, see ibv_modify_qp. + +# ARGUMENTS + +*id* +: RDMA identifier. + +*qp_attr* +: A reference to a qp attributes struct containing response information. + +*qp_attr_mask* +: A reference to a qp attributes mask containing response information. + +# RETURN VALUE + +**rdma_init_qp_attr()** returns 0 on success, or -1 on error. If an error occurs, errno will be set to indicate the failure reason. + +# SEE ALSO + +**rdma_cm**(7), +**ibv_modify_qp**(3) + +# AUTHOR + +Danit Goldberg diff --git a/librdmacm/rdma_cma.h b/librdmacm/rdma_cma.h index 2096a81..cf4a683 100644 --- a/librdmacm/rdma_cma.h +++ b/librdmacm/rdma_cma.h @@ -721,6 +721,16 @@ int rdma_getaddrinfo(const char *node, const char *service, void rdma_freeaddrinfo(struct rdma_addrinfo *res); +/** + * rdma_init_qp_attr - Returns QP attributes. + * @id: Communication identifier. + * @qp_attr: A reference to a QP attributes struct containing + * response information. + * @qp_attr_mask: A reference to a QP attributes mask containing + * response information. + */ +int rdma_init_qp_attr(struct rdma_cm_id *id, struct ibv_qp_attr *qp_attr, + int *qp_attr_mask); #ifdef __cplusplus } #endif