From patchwork Mon Feb 25 16:45:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10828905 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 5F56317EF for ; Mon, 25 Feb 2019 16:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA9E29014 for ; Mon, 25 Feb 2019 16:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 410442B811; Mon, 25 Feb 2019 16:46:01 +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 D645C29EE5 for ; Mon, 25 Feb 2019 16:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728563AbfBYQp7 (ORCPT ); Mon, 25 Feb 2019 11:45:59 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:58457 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728564AbfBYQp7 (ORCPT ); Mon, 25 Feb 2019 11:45:59 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 25 Feb 2019 18:45:55 +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 x1PGjtvm003064; Mon, 25 Feb 2019 18:45:55 +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 x1PGjt39017012; Mon, 25 Feb 2019 18:45:55 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id x1PGjtaF017011; Mon, 25 Feb 2019 18:45:55 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, monis@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 1/3] verbs: Introduce implicit ODP support flag Date: Mon, 25 Feb 2019 18:45:26 +0200 Message-Id: <1551113128-16917-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1551113128-16917-1-git-send-email-yishaih@mellanox.com> References: <1551113128-16917-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: Moni Shoua Implicit ODP is a special form of ODP where the entire process memory space is registered on demand. This may simplify an application's memory registration scheme. The kernel may or may not support implicit ODP memory registration and the application needs to query the device before using it. Running 'ibv_devinfo -v' will show this capability when it is supported. Relevant manual pages were updated accordingly. Signed-off-by: Moni Shoua Signed-off-by: Yishai Hadas --- libibverbs/examples/devinfo.c | 5 ++++- libibverbs/man/ibv_query_device_ex.3 | 1 + libibverbs/man/ibv_reg_mr.3 | 2 ++ libibverbs/verbs.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libibverbs/examples/devinfo.c b/libibverbs/examples/devinfo.c index e928b05..07b4af5 100644 --- a/libibverbs/examples/devinfo.c +++ b/libibverbs/examples/devinfo.c @@ -314,13 +314,16 @@ static void print_odp_trans_caps(uint32_t trans) static void print_odp_caps(const struct ibv_device_attr_ex *device_attr) { - uint64_t unknown_general_caps = ~(IBV_ODP_SUPPORT); + uint64_t unknown_general_caps = ~(IBV_ODP_SUPPORT | + IBV_ODP_SUPPORT_IMPLICIT); const struct ibv_odp_caps *caps = &device_attr->odp_caps; /* general odp caps */ printf("\tgeneral_odp_caps:\n"); if (caps->general_caps & IBV_ODP_SUPPORT) printf("\t\t\t\t\tODP_SUPPORT\n"); + if (caps->general_caps & IBV_ODP_SUPPORT_IMPLICIT) + printf("\t\t\t\t\tODP_SUPPORT_IMPLICIT\n"); if (caps->general_caps & unknown_general_caps) printf("\t\t\t\t\tUnknown flags: 0x%" PRIX64 "\n", caps->general_caps & unknown_general_caps); diff --git a/libibverbs/man/ibv_query_device_ex.3 b/libibverbs/man/ibv_query_device_ex.3 index f99f818..b652884 100644 --- a/libibverbs/man/ibv_query_device_ex.3 +++ b/libibverbs/man/ibv_query_device_ex.3 @@ -52,6 +52,7 @@ struct ibv_odp_caps { enum ibv_odp_general_cap_bits { IBV_ODP_SUPPORT = 1 << 0, /* On demand paging is supported */ + IBV_ODP_SUPPORT_IMPLICIT = 1 << 1, /* Implicit on demand paging is supported */ }; enum ibv_odp_transport_cap_bits { diff --git a/libibverbs/man/ibv_reg_mr.3 b/libibverbs/man/ibv_reg_mr.3 index d9053b1..631e5fe 100644 --- a/libibverbs/man/ibv_reg_mr.3 +++ b/libibverbs/man/ibv_reg_mr.3 @@ -50,6 +50,8 @@ must be set too. .PP Local read access is always enabled for the MR. .PP +To create an implicit ODP MR, IBV_ACCESS_ON_DEMAND should be set, addr should be 0 and length should be SIZE_MAX. +.PP .B ibv_dereg_mr() deregisters the MR .I mr\fR. diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h index 9561e39..243cd8c 100644 --- a/libibverbs/verbs.h +++ b/libibverbs/verbs.h @@ -218,6 +218,7 @@ struct ibv_odp_caps { enum ibv_odp_general_caps { IBV_ODP_SUPPORT = 1 << 0, + IBV_ODP_SUPPORT_IMPLICIT = 1 << 1, }; struct ibv_tso_caps {