From patchwork Mon Oct 30 14:09:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10032703 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 CB086603B4 for ; Mon, 30 Oct 2017 14:09:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3F0220415 for ; Mon, 30 Oct 2017 14:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B85F220416; Mon, 30 Oct 2017 14:09:36 +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 65712205F6 for ; Mon, 30 Oct 2017 14:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752274AbdJ3OJe (ORCPT ); Mon, 30 Oct 2017 10:09:34 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46712 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751677AbdJ3OJd (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 v9UE9RNR009489; 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 v9UE9RdG026690; 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 v9UE9RrQ026689; 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 4/4] mlx5: Add support for CQ moderation Date: Mon, 30 Oct 2017 16:09:03 +0200 Message-Id: <1509372543-26603-5-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/mlx5/mlx5.c | 1 + providers/mlx5/mlx5.h | 1 + providers/mlx5/verbs.c | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c index 2414881..e63586b 100644 --- a/providers/mlx5/mlx5.c +++ b/providers/mlx5/mlx5.c @@ -966,6 +966,7 @@ static int mlx5_init_context(struct verbs_device *vdev, verbs_set_ctx_op(v_ctx, create_rwq_ind_table, mlx5_create_rwq_ind_table); verbs_set_ctx_op(v_ctx, destroy_rwq_ind_table, mlx5_destroy_rwq_ind_table); verbs_set_ctx_op(v_ctx, post_srq_ops, mlx5_post_srq_ops); + verbs_set_ctx_op(v_ctx, modify_cq, mlx5_modify_cq); memset(&device_attr, 0, sizeof(device_attr)); if (!mlx5_query_device_ex(ctx, NULL, &device_attr, diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h index 5b7d5c0..c26421c 100644 --- a/providers/mlx5/mlx5.h +++ b/providers/mlx5/mlx5.h @@ -661,6 +661,7 @@ int mlx5_alloc_cq_buf(struct mlx5_context *mctx, struct mlx5_cq *cq, struct mlx5_buf *buf, int nent, int cqe_sz); int mlx5_free_cq_buf(struct mlx5_context *ctx, struct mlx5_buf *buf); int mlx5_resize_cq(struct ibv_cq *cq, int cqe); +int mlx5_modify_cq(struct ibv_cq *cq, struct ibv_modify_cq_attr *attr); int mlx5_destroy_cq(struct ibv_cq *cq); int mlx5_poll_cq(struct ibv_cq *cq, int ne, struct ibv_wc *wc); int mlx5_poll_cq_v1(struct ibv_cq *cq, int ne, struct ibv_wc *wc); diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index b073d7b..4de4fa1 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -2378,3 +2378,10 @@ int mlx5_destroy_rwq_ind_table(struct ibv_rwq_ind_table *rwq_ind_table) free(rwq_ind_table); return 0; } + +int mlx5_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)); +}