From patchwork Mon Oct 30 14:09:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10032705 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 B1CD9603B4 for ; Mon, 30 Oct 2017 14:09:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A93AF20415 for ; Mon, 30 Oct 2017 14:09:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E1DB20499; Mon, 30 Oct 2017 14:09:37 +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 4759120415 for ; Mon, 30 Oct 2017 14:09:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068AbdJ3OJe (ORCPT ); Mon, 30 Oct 2017 10:09:34 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46692 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752274AbdJ3OJd (ORCPT ); Mon, 30 Oct 2017 10:09:33 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 30 Oct 2017 16:09:27 +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 v9UE9RHW009486; Mon, 30 Oct 2017 16:09:27 +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 v9UE9RDg026686; Mon, 30 Oct 2017 16:09:27 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v9UE9R3e026685; Mon, 30 Oct 2017 16:09:27 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, yonatanc@mellanox.com, majd@mellanox.com, dledford@redhat.com Subject: [PATCH rdma-core 3/4] mlx4: Add support for CQ moderation Date: Mon, 30 Oct 2017 16:09:02 +0200 Message-Id: <1509372543-26603-4-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1509372543-26603-1-git-send-email-yishaih@mellanox.com> References: <1509372543-26603-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: Yonatan Cohen Support CQ moderation via modify_cq verb. Signed-off-by: Yonatan Cohen Reviewed-by: Yishai Hadas --- providers/mlx4/mlx4.c | 1 + providers/mlx4/mlx4.h | 1 + providers/mlx4/verbs.c | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/providers/mlx4/mlx4.c b/providers/mlx4/mlx4.c index 6de0bee..9d521a7 100644 --- a/providers/mlx4/mlx4.c +++ b/providers/mlx4/mlx4.c @@ -256,6 +256,7 @@ static int mlx4_init_context(struct verbs_device *v_device, verbs_set_ctx_op(verbs_ctx, destroy_wq, mlx4_destroy_wq); verbs_set_ctx_op(verbs_ctx, create_rwq_ind_table, mlx4_create_rwq_ind_table); verbs_set_ctx_op(verbs_ctx, destroy_rwq_ind_table, mlx4_destroy_rwq_ind_table); + verbs_set_ctx_op(verbs_ctx, modify_cq, mlx4_modify_cq); return 0; diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h index 14f2720..8283260 100644 --- a/providers/mlx4/mlx4.h +++ b/providers/mlx4/mlx4.h @@ -350,6 +350,7 @@ void mlx4_cq_fill_pfns(struct mlx4_cq *cq, const struct ibv_cq_init_attr_ex *cq_ int mlx4_alloc_cq_buf(struct mlx4_device *dev, struct mlx4_buf *buf, int nent, int entry_size); int mlx4_resize_cq(struct ibv_cq *cq, int cqe); +int mlx4_modify_cq(struct ibv_cq *cq, struct ibv_modify_cq_attr *attr); int mlx4_destroy_cq(struct ibv_cq *cq); int mlx4_poll_cq(struct ibv_cq *cq, int ne, struct ibv_wc *wc); int mlx4_arm_cq(struct ibv_cq *cq, int solicited); diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c index b966ef2..1c33f8b 100644 --- a/providers/mlx4/verbs.c +++ b/providers/mlx4/verbs.c @@ -1609,3 +1609,10 @@ int mlx4_destroy_rwq_ind_table(struct ibv_rwq_ind_table *rwq_ind_table) free(rwq_ind_table); return 0; } + +int mlx4_modify_cq(struct ibv_cq *cq, struct ibv_modify_cq_attr *attr) +{ + struct ibv_modify_cq cmd = {}; + + return ibv_cmd_modify_cq(cq, attr, &cmd, sizeof(cmd)); +}