From patchwork Wed Dec 5 13:24:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10714201 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 E07F417DB for ; Wed, 5 Dec 2018 13:25:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0CF02CF32 for ; Wed, 5 Dec 2018 13:25:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C50852CF34; Wed, 5 Dec 2018 13:25:18 +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 6E99A2CF33 for ; Wed, 5 Dec 2018 13:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727511AbeLENZP (ORCPT ); Wed, 5 Dec 2018 08:25:15 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:36153 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727496AbeLENZP (ORCPT ); Wed, 5 Dec 2018 08:25:15 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 5 Dec 2018 15:31:11 +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 wB5DP9dZ000831; Wed, 5 Dec 2018 15:25:09 +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 wB5DP9x8011316; Wed, 5 Dec 2018 15:25:09 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id wB5DP9nm011315; Wed, 5 Dec 2018 15:25:09 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, monis@mellanox.com, guyle@mellanox.com, aviadye@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 4/6] mlx5: Support advise_mr verb Date: Wed, 5 Dec 2018 15:24:49 +0200 Message-Id: <1544016291-10815-5-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1544016291-10815-1-git-send-email-yishaih@mellanox.com> References: <1544016291-10815-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 Add an implementation to verb ibv_advise_mr(). Signed-off-by: Moni Shoua Reviewed-by: Guy Levi Signed-off-by: Yishai Hadas --- providers/mlx5/mlx5.c | 1 + providers/mlx5/mlx5.h | 6 +++++- providers/mlx5/verbs.c | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c index 86939bf..0d71992 100644 --- a/providers/mlx5/mlx5.c +++ b/providers/mlx5/mlx5.c @@ -115,6 +115,7 @@ static const struct verbs_context_ops mlx5_ctx_common_ops = { .attach_mcast = mlx5_attach_mcast, .detach_mcast = mlx5_detach_mcast, + .advise_mr = mlx5_advise_mr, .alloc_dm = mlx5_alloc_dm, .alloc_parent_domain = mlx5_alloc_parent_domain, .alloc_td = mlx5_alloc_td, diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h index c812195..977bc0a 100644 --- a/providers/mlx5/mlx5.h +++ b/providers/mlx5/mlx5.h @@ -904,7 +904,11 @@ int mlx5_read_counters(struct ibv_counters *counters, uint64_t *counters_value, uint32_t ncounters, uint32_t flags); - +int mlx5_advise_mr(struct ibv_pd *pd, + enum ibv_advise_mr_advice advice, + uint32_t flags, + struct ibv_sge *sg_list, + uint32_t num_sges); static inline void *mlx5_find_uidx(struct mlx5_context *ctx, uint32_t uidx) { int tind = uidx >> MLX5_UIDX_TABLE_SHIFT; diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index 9e5bc47..0dc7807 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -493,6 +493,15 @@ free: return 0; } +int mlx5_advise_mr(struct ibv_pd *pd, + enum ibv_advise_mr_advice advice, + uint32_t flags, + struct ibv_sge *sg_list, + uint32_t num_sge) +{ + return ibv_cmd_advise_mr(pd, advice, flags, sg_list, num_sge); +} + struct ibv_mw *mlx5_alloc_mw(struct ibv_pd *pd, enum ibv_mw_type type) { struct ibv_mw *mw;