From patchwork Tue Oct 9 18:45:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10633169 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 DD0EE16B1 for ; Tue, 9 Oct 2018 18:47:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2361294FA for ; Tue, 9 Oct 2018 18:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6B552953E; Tue, 9 Oct 2018 18:47:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 6A017294FA for ; Tue, 9 Oct 2018 18:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727336AbeJJCFX (ORCPT ); Tue, 9 Oct 2018 22:05:23 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36057 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbeJJCFX (ORCPT ); Tue, 9 Oct 2018 22:05:23 -0400 Received: by mail-wm1-f68.google.com with SMTP id a8-v6so3090673wmf.1 for ; Tue, 09 Oct 2018 11:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+zJ7OvqIOhFG8Bz6ToLDYZc8ULkE9qZBoiGR2ew5iWI=; b=Q507SUmhEax7qewRupfeS41qg3UwG5ERb0oaZP0adeXHmd0b77GxjEYTg2vxMR+84p T7dt3VPT+ogFWNpO3zFVcOKm3T/xVT/3AIc1k+CI/mctap+nwIzPB+4yallwqTmj750B De0Tpz7eTSn745JAt6Ih4rBdpibPaezqnJ668wt6NjpqzuVKmf+nZJUsspteYGUH8M2a sKCQGcGvMQU3ATJnqNTgON/h9OGVlDwx7UtyP8KpKzVGjU8KGfrnofgMxF6jd8cBN+b8 JY+ett9wW3bxKTNVgKW1CP9e5QHSFxIuV+0yQT8FBeXu/T4/4Vy8g1jsCBDvtjnUmNiL COLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+zJ7OvqIOhFG8Bz6ToLDYZc8ULkE9qZBoiGR2ew5iWI=; b=VLufJPd3HGiQz2DqLWfVOq1iSN1aoJCqfGlyyIUbAHUc4A2lI7BkWQadH72k/fCYsz CvnqSp6Bn167R3A2I+RwGcx234IKYHWO/tAui6AEqwMmBzLxLrRVPAaKelAxSqOzftKQ v/qZoo3VBxvEZYN3Gi4E3DfJ0rmnxuDp4+NP2+5JzTA2Dx5SJwXUmpR1N3J+/cc6qb3M Bjf3aoWzYgHvUv8M/oyDgIR6nWhDbCvvISw3XFy2+h1v+KMNSAqswe3hhadH0cP5jXD8 3CRQPhGLFVoNWDmTYOKlsSAV5dlbhkTUtlOms3kwXUD3E1VUgrE9tBwmCeTmw2XdysWV LdJg== X-Gm-Message-State: ABuFfoggynPpS80j90lLikGREMbuBIZColxuLVnjd5pjCHtb6yNGm/ju zyTFr7ONdn7aoKfSH914a0o= X-Google-Smtp-Source: ACcGV61hCXXZ/y2nXS9JfPoIcXjWfhb4pHTTruP6VdObgkCa+LH8yKFxLsgGPNAZ/FH2/Y4hbVTuOA== X-Received: by 2002:a1c:a505:: with SMTP id o5-v6mr2257762wme.53.1539110821275; Tue, 09 Oct 2018 11:47:01 -0700 (PDT) Received: from localhost.localdomain (bzq-79-179-121-186.red.bezeqint.net. [79.179.121.186]) by smtp.gmail.com with ESMTPSA id r16-v6sm27093327wrv.21.2018.10.09.11.47.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 11:47:00 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next 13/18] RDMA/qedr: Initialize ib_device_ops struct Date: Tue, 9 Oct 2018 21:45:42 +0300 Message-Id: <20181009184547.5907-14-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181009184547.5907-1-kamalheib1@gmail.com> References: <20181009184547.5907-1-kamalheib1@gmail.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 Initialize ib_device_ops with the supported operations. Signed-off-by: Kamal Heib --- drivers/infiniband/hw/qedr/main.c | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c index cd7b8b39a129..ae7b28e4a475 100644 --- a/drivers/infiniband/hw/qedr/main.c +++ b/drivers/infiniband/hw/qedr/main.c @@ -133,12 +133,18 @@ static int qedr_iw_port_immutable(struct ib_device *ibdev, u8 port_num, return 0; } +static struct ib_device_ops qedr_iw_dev_ops = { + .query_gid = qedr_iw_query_gid, + .get_port_immutable = qedr_iw_port_immutable, +}; + static int qedr_iw_register_device(struct qedr_dev *dev) { dev->ibdev.node_type = RDMA_NODE_RNIC; dev->ibdev.query_gid = qedr_iw_query_gid; dev->ibdev.get_port_immutable = qedr_iw_port_immutable; + ib_set_device_ops(&dev->ibdev, &qedr_iw_dev_ops); dev->ibdev.iwcm = kzalloc(sizeof(*dev->ibdev.iwcm), GFP_KERNEL); if (!dev->ibdev.iwcm) @@ -159,13 +165,57 @@ static int qedr_iw_register_device(struct qedr_dev *dev) return 0; } +static struct ib_device_ops qedr_roce_dev_ops = { + .get_port_immutable = qedr_roce_port_immutable, +}; + static void qedr_roce_register_device(struct qedr_dev *dev) { dev->ibdev.node_type = RDMA_NODE_IB_CA; dev->ibdev.get_port_immutable = qedr_roce_port_immutable; + ib_set_device_ops(&dev->ibdev, &qedr_roce_dev_ops); } +static struct ib_device_ops qedr_dev_ops = { + .query_device = qedr_query_device, + .query_port = qedr_query_port, + .modify_port = qedr_modify_port, + .alloc_ucontext = qedr_alloc_ucontext, + .dealloc_ucontext = qedr_dealloc_ucontext, + .mmap = qedr_mmap, + .alloc_pd = qedr_alloc_pd, + .dealloc_pd = qedr_dealloc_pd, + .create_cq = qedr_create_cq, + .destroy_cq = qedr_destroy_cq, + .resize_cq = qedr_resize_cq, + .req_notify_cq = qedr_arm_cq, + .create_qp = qedr_create_qp, + .modify_qp = qedr_modify_qp, + .query_qp = qedr_query_qp, + .destroy_qp = qedr_destroy_qp, + .create_srq = qedr_create_srq, + .destroy_srq = qedr_destroy_srq, + .modify_srq = qedr_modify_srq, + .query_srq = qedr_query_srq, + .post_srq_recv = qedr_post_srq_recv, + .query_pkey = qedr_query_pkey, + .create_ah = qedr_create_ah, + .destroy_ah = qedr_destroy_ah, + .get_dma_mr = qedr_get_dma_mr, + .dereg_mr = qedr_dereg_mr, + .reg_user_mr = qedr_reg_user_mr, + .alloc_mr = qedr_alloc_mr, + .map_mr_sg = qedr_map_mr_sg, + .poll_cq = qedr_poll_cq, + .post_send = qedr_post_send, + .post_recv = qedr_post_recv, + .process_mad = qedr_process_mad, + .get_netdev = qedr_get_netdev, + .get_link_layer = qedr_link_layer, + .get_dev_fw_str = qedr_get_dev_fw_str, +}; + static int qedr_register_device(struct qedr_dev *dev) { int rc; @@ -261,6 +311,8 @@ static int qedr_register_device(struct qedr_dev *dev) dev->ibdev.get_link_layer = qedr_link_layer; dev->ibdev.get_dev_fw_str = qedr_get_dev_fw_str; + ib_set_device_ops(&dev->ibdev, &qedr_dev_ops); + dev->ibdev.driver_id = RDMA_DRIVER_QEDR; return ib_register_device(&dev->ibdev, "qedr%d", NULL); }