From patchwork Tue Jan 28 16:27:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matan Azrad X-Patchwork-Id: 65254 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EBAA1A04B3; Tue, 28 Jan 2020 17:29:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 475D31D41D; Tue, 28 Jan 2020 17:28:17 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 350811D37D for ; Tue, 28 Jan 2020 17:28:01 +0100 (CET) Received: from Internal Mail-Server by MTLPINE2 (envelope-from asafp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 28 Jan 2020 18:27:56 +0200 Received: from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx [10.210.16.112]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00SIOulR013316; Tue, 28 Jan 2020 20:25:09 +0200 From: Matan Azrad To: dev@dpdk.org, Viacheslav Ovsiienko Cc: Raslan Darawsheh Date: Tue, 28 Jan 2020 16:27:23 +0000 Message-Id: <1580228860-10665-9-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1580228860-10665-1-git-send-email-matan@mellanox.com> References: <1580205965-21492-1-git-send-email-matan@mellanox.com> <1580228860-10665-1-git-send-email-matan@mellanox.com> Subject: [dpdk-dev] [PATCH v3 08/25] common/mlx5: glue null memory region allocation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add support for rdma-core API to allocate NULL MR. When the device HW get a NULL MR address, it will do nothing with the address, no read and no write. Signed-off-by: Matan Azrad Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_glue.c | 13 +++++++++++++ drivers/common/mlx5/mlx5_glue.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c index d5bc84e..e75e6bc 100644 --- a/drivers/common/mlx5/mlx5_glue.c +++ b/drivers/common/mlx5/mlx5_glue.c @@ -226,6 +226,18 @@ return ibv_reg_mr(pd, addr, length, access); } +static struct ibv_mr * +mlx5_glue_alloc_null_mr(struct ibv_pd *pd) +{ +#ifdef HAVE_IBV_DEVX_OBJ + return ibv_alloc_null_mr(pd); +#else + (void)pd; + errno = ENOTSUP; + return NULL; +#endif +} + static int mlx5_glue_dereg_mr(struct ibv_mr *mr) { @@ -1070,6 +1082,7 @@ .destroy_qp = mlx5_glue_destroy_qp, .modify_qp = mlx5_glue_modify_qp, .reg_mr = mlx5_glue_reg_mr, + .alloc_null_mr = mlx5_glue_alloc_null_mr, .dereg_mr = mlx5_glue_dereg_mr, .create_counter_set = mlx5_glue_create_counter_set, .destroy_counter_set = mlx5_glue_destroy_counter_set, diff --git a/drivers/common/mlx5/mlx5_glue.h b/drivers/common/mlx5/mlx5_glue.h index f4c3180..33afaf4 100644 --- a/drivers/common/mlx5/mlx5_glue.h +++ b/drivers/common/mlx5/mlx5_glue.h @@ -138,6 +138,7 @@ struct mlx5_glue { int attr_mask); struct ibv_mr *(*reg_mr)(struct ibv_pd *pd, void *addr, size_t length, int access); + struct ibv_mr *(*alloc_null_mr)(struct ibv_pd *pd); int (*dereg_mr)(struct ibv_mr *mr); struct ibv_counter_set *(*create_counter_set) (struct ibv_context *context,