From patchwork Tue Sep 12 12:53:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9949139 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 41A5F60325 for ; Tue, 12 Sep 2017 12:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3348428F34 for ; Tue, 12 Sep 2017 12:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 283B928F6E; Tue, 12 Sep 2017 12:53:31 +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 C3D2A28F34 for ; Tue, 12 Sep 2017 12:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbdILMx2 (ORCPT ); Tue, 12 Sep 2017 08:53:28 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:52436 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751405AbdILMxY (ORCPT ); Tue, 12 Sep 2017 08:53:24 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 12 Sep 2017 15:53:20 +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 v8CCrKPC031233; Tue, 12 Sep 2017 15:53:20 +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 v8CCrKFv023925; Tue, 12 Sep 2017 15:53:20 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v8CCrJvW023924; Tue, 12 Sep 2017 15:53:19 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, guyle@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 6/6] mlx4: Support WQ object type in direct verb mlx4dv_init_obj Date: Tue, 12 Sep 2017 15:53:08 +0300 Message-Id: <1505220788-23849-7-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1505220788-23849-1-git-send-email-yishaih@mellanox.com> References: <1505220788-23849-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: Guy Levi Exposing relevant data-path attributes from the mlx4 object which is used for WQ (i.e. from mlx4_qp) to let user working directly over hardware specification. Signed-off-by: Guy Levi Reviewed-by: Yishai Hadas --- providers/mlx4/man/mlx4dv_init_obj.3 | 20 ++++++++++++++++++++ providers/mlx4/mlx4.c | 20 ++++++++++++++++++++ providers/mlx4/mlx4dv.h | 19 +++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/providers/mlx4/man/mlx4dv_init_obj.3 b/providers/mlx4/man/mlx4dv_init_obj.3 index c6d8d2b..d2a2bb0 100644 --- a/providers/mlx4/man/mlx4dv_init_obj.3 +++ b/providers/mlx4/man/mlx4dv_init_obj.3 @@ -83,6 +83,26 @@ uint64_t comp_mask; .in -8 }; +struct mlx4dv_rwq { +.in +8 +__be32 *rdb; +struct { +.in +8 +uint32_t wqe_cnt; +int wqe_shift; +int offset; +.in -8 +} rq; +struct { +.in +8 +void *buf; +size_t length; +.in -8 +} buf; +uint64_t comp_mask; +.in -8 +}; + struct mlx4dv_obj { .in +8 struct { diff --git a/providers/mlx4/mlx4.c b/providers/mlx4/mlx4.c index 5daea3b..3571234 100644 --- a/providers/mlx4/mlx4.c +++ b/providers/mlx4/mlx4.c @@ -419,6 +419,24 @@ static int mlx4dv_get_srq(struct ibv_srq *srq_in, return 0; } +static int mlx4dv_get_rwq(struct ibv_wq *wq_in, struct mlx4dv_rwq *wq_out) +{ + struct mlx4_qp *mqp = wq_to_mqp(wq_in); + + wq_out->comp_mask = 0; + + wq_out->buf.buf = mqp->buf.buf; + wq_out->buf.length = mqp->buf.length; + + wq_out->rdb = mqp->db; + + wq_out->rq.wqe_cnt = mqp->rq.wqe_cnt; + wq_out->rq.wqe_shift = mqp->rq.wqe_shift; + wq_out->rq.offset = mqp->rq.offset; + + return 0; +} + int mlx4dv_init_obj(struct mlx4dv_obj *obj, uint64_t obj_type) { int ret = 0; @@ -429,6 +447,8 @@ int mlx4dv_init_obj(struct mlx4dv_obj *obj, uint64_t obj_type) ret = mlx4dv_get_cq(obj->cq.in, obj->cq.out); if (!ret && (obj_type & MLX4DV_OBJ_SRQ)) ret = mlx4dv_get_srq(obj->srq.in, obj->srq.out); + if (!ret && (obj_type & MLX4DV_OBJ_RWQ)) + ret = mlx4dv_get_rwq(obj->rwq.in, obj->rwq.out); return ret; } diff --git a/providers/mlx4/mlx4dv.h b/providers/mlx4/mlx4dv.h index 453de55..d47d3cd 100644 --- a/providers/mlx4/mlx4dv.h +++ b/providers/mlx4/mlx4dv.h @@ -197,6 +197,20 @@ struct mlx4dv_srq { uint64_t comp_mask; }; +struct mlx4dv_rwq { + __be32 *rdb; + struct { + uint32_t wqe_cnt; + int wqe_shift; + int offset; + } rq; + struct { + void *buf; + size_t length; + } buf; + uint64_t comp_mask; +}; + struct mlx4dv_obj { struct { struct ibv_qp *in; @@ -210,12 +224,17 @@ struct mlx4dv_obj { struct ibv_srq *in; struct mlx4dv_srq *out; } srq; + struct { + struct ibv_wq *in; + struct mlx4dv_rwq *out; + } rwq; }; enum mlx4dv_obj_type { MLX4DV_OBJ_QP = 1 << 0, MLX4DV_OBJ_CQ = 1 << 1, MLX4DV_OBJ_SRQ = 1 << 2, + MLX4DV_OBJ_RWQ = 1 << 3, }; /*