From patchwork Wed Aug 30 14:31:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9929795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D5AF160380 for ; Wed, 30 Aug 2017 14:31:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8A5B28688 for ; Wed, 30 Aug 2017 14:31:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD70F28692; Wed, 30 Aug 2017 14:31: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=-6.9 required=2.0 tests=BAYES_00, 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 3D4E428688 for ; Wed, 30 Aug 2017 14:31:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751326AbdH3Obp (ORCPT ); Wed, 30 Aug 2017 10:31:45 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:53026 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751317AbdH3Obp (ORCPT ); Wed, 30 Aug 2017 10:31:45 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Aug 2017 17:31:42 +0300 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 v7UEVgid017006; Wed, 30 Aug 2017 17:31:42 +0300 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 v7UEVfUK024418; Wed, 30 Aug 2017 17:31:41 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v7UEVeWo024414; Wed, 30 Aug 2017 17:31:40 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, maorg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core] mlx4: Extend mlx4dv_get_cq to return uar Date: Wed, 30 Aug 2017 17:31:14 +0300 Message-Id: <1504103474-24345-1-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 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 Extend mlx4dv_get_cq to return cq_uar to enable applications direct access as part of arm_cq flow. Reviewed-by: Maor Gottlieb Signed-off-by: Yishai Hadas --- Pull request was sent: https://github.com/linux-rdma/rdma-core/pull/203 providers/mlx4/man/mlx4dv_init_obj.3 | 3 ++- providers/mlx4/mlx4.c | 9 ++++++++- providers/mlx4/mlx4dv.h | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/providers/mlx4/man/mlx4dv_init_obj.3 b/providers/mlx4/man/mlx4dv_init_obj.3 index 7d10b93..c6d8d2b 100644 --- a/providers/mlx4/man/mlx4dv_init_obj.3 +++ b/providers/mlx4/man/mlx4dv_init_obj.3 @@ -62,7 +62,8 @@ uint32_t *set_ci_db; uint32_t *arm_db; int arm_sn; int cqe_size; -uint64_t comp_mask; +uint64_t comp_mask; /* Use enum mlx4dv_cq_comp_mask */ +void *cq_uar; .in -8 }; diff --git a/providers/mlx4/mlx4.c b/providers/mlx4/mlx4.c index d65ef20..eecb9c7 100644 --- a/providers/mlx4/mlx4.c +++ b/providers/mlx4/mlx4.c @@ -375,8 +375,9 @@ static int mlx4dv_get_cq(struct ibv_cq *cq_in, struct mlx4dv_cq *cq_out) { struct mlx4_cq *mcq = to_mcq(cq_in); + struct mlx4_context *mctx = to_mctx(cq_in->context); + uint64_t mask_out = 0; - cq_out->comp_mask = 0; cq_out->buf.buf = mcq->buf.buf; cq_out->buf.length = mcq->buf.length; cq_out->cqn = mcq->cqn; @@ -388,6 +389,12 @@ static int mlx4dv_get_cq(struct ibv_cq *cq_in, mcq->flags |= MLX4_CQ_FLAGS_DV_OWNED; + if (cq_out->comp_mask & MLX4DV_CQ_MASK_UAR) { + cq_out->cq_uar = mctx->uar; + mask_out |= MLX4DV_CQ_MASK_UAR; + } + + cq_out->comp_mask = mask_out; return 0; } diff --git a/providers/mlx4/mlx4dv.h b/providers/mlx4/mlx4dv.h index 16045ef..3f50d34 100644 --- a/providers/mlx4/mlx4dv.h +++ b/providers/mlx4/mlx4dv.h @@ -166,6 +166,10 @@ struct mlx4dv_qp { uint64_t comp_mask; }; +enum mlx4dv_cq_comp_mask { + MLX4DV_CQ_MASK_UAR = 1 << 0, +}; + struct mlx4dv_cq { struct { void *buf; @@ -178,7 +182,9 @@ struct mlx4dv_cq { int arm_sn; int cqe_size; uint64_t comp_mask; + void *cq_uar; }; + struct mlx4dv_srq { struct { void *buf;