From patchwork Tue Oct 9 18:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10633167 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 4847115E8 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 3E00C294F9 for ; Tue, 9 Oct 2018 18:47:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32552294FD; 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 CAD44294F9 for ; Tue, 9 Oct 2018 18:47:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726503AbeJJCFX (ORCPT ); Tue, 9 Oct 2018 22:05:23 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54531 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbeJJCFX (ORCPT ); Tue, 9 Oct 2018 22:05:23 -0400 Received: by mail-wm1-f66.google.com with SMTP id r63-v6so2910468wma.4 for ; Tue, 09 Oct 2018 11:47:00 -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=N7vpRjs4HnVzSUO+t3h2x028FfZuTWcDxrvni65rb60=; b=DFA5bzMq9UKQHmuw84RiCMMUjPR3tyOroM0d+Qq50hD0FH09IWvHekbPGXe1qpDugW qQs0mY9+Oj622VXhYEEpH99ejQHmmNI3JQdKp0ZNI+BlCUWFPMa/Chq7vEDoAaazGYBU k/RPIV4Uefqdbt7oPBpB3/CtaQtGs1oIZuIMCL1uQGRaJre4sPoasIWTL8SgkY9vpAQx bmmYHwdsNVTZdV316R0oJvjf2y3Fr1TypvhcFqFEYE+Y4NuXMXrhjYNfOTrD1iFaQdub RwpSa2O/6ERWEAtjEAGKQqhwjEx5+FgQkQxYpAdlIYaNI4mHTDCB07LATaiOBoJXp73+ J9IQ== 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=N7vpRjs4HnVzSUO+t3h2x028FfZuTWcDxrvni65rb60=; b=YSE775FrceEhpBGUvCVtvEcvSRaWvnZVNCy8IIg+7DNe/hESyYxjPrmH8Ux1scyuZ8 VWIelm6eVWHKvVHpY8NL34qmuNzc87fsnzzrCmvsClO7qmpyHifMnWFvMzBS5jKC+P8S gxV6ndbriPkhOKCgkvm06Xf+BWoZ4InPZ/qHSaaLJUTX/1E2rEtE1tYWX+aUSEeY8UxX y5m8ah3tafEcvW+JOuY2ZhWTUfDdGNs4JQcpWIEaaMtHHT+GnaPeIVmQuueC0yqxYUi8 pRTM0Gdr0awgBDHP/E77w1OhDlhHQe+o7Q1WpZKNYQdXDIuqanS42I6PE9KAnt2DsZqY jhKg== X-Gm-Message-State: ABuFfogx3N0h9nA+tH93E514bHZJZHO07a3KHO35qQdCLCNjjcbXr4k1 WrHdBqwprw8IfB0JkaPIFw4= X-Google-Smtp-Source: ACcGV62gxKfcK9Cx/2pL3lBRZRiwq8fijrFDbyXCv7RVSn8Jek4FG/CsoTyglgTKb62aN5kBB4f1cA== X-Received: by 2002:a1c:2dc5:: with SMTP id t188-v6mr2752970wmt.94.1539110820162; Tue, 09 Oct 2018 11:47:00 -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.46.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 11:46:59 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next 12/18] RDMA/ocrdma: Initialize ib_device_ops struct Date: Tue, 9 Oct 2018 21:45:41 +0300 Message-Id: <20181009184547.5907-13-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/ocrdma/ocrdma_main.c | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 4d3c27613351..1ad1c4110bf8 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -114,6 +114,50 @@ static void get_dev_fw_str(struct ib_device *device, char *str) snprintf(str, IB_FW_VERSION_NAME_MAX, "%s", &dev->attr.fw_ver[0]); } +static struct ib_device_ops ocrdma_dev_ops = { + .query_device = ocrdma_query_device, + .query_port = ocrdma_query_port, + .modify_port = ocrdma_modify_port, + .get_netdev = ocrdma_get_netdev, + .get_link_layer = ocrdma_link_layer, + .alloc_pd = ocrdma_alloc_pd, + .dealloc_pd = ocrdma_dealloc_pd, + .create_cq = ocrdma_create_cq, + .destroy_cq = ocrdma_destroy_cq, + .resize_cq = ocrdma_resize_cq, + .create_qp = ocrdma_create_qp, + .modify_qp = ocrdma_modify_qp, + .query_qp = ocrdma_query_qp, + .destroy_qp = ocrdma_destroy_qp, + .query_pkey = ocrdma_query_pkey, + .create_ah = ocrdma_create_ah, + .destroy_ah = ocrdma_destroy_ah, + .query_ah = ocrdma_query_ah, + .poll_cq = ocrdma_poll_cq, + .post_send = ocrdma_post_send, + .post_recv = ocrdma_post_recv, + .req_notify_cq = ocrdma_arm_cq, + .get_dma_mr = ocrdma_get_dma_mr, + .dereg_mr = ocrdma_dereg_mr, + .reg_user_mr = ocrdma_reg_user_mr, + .alloc_mr = ocrdma_alloc_mr, + .map_mr_sg = ocrdma_map_mr_sg, + .alloc_ucontext = ocrdma_alloc_ucontext, + .dealloc_ucontext = ocrdma_dealloc_ucontext, + .mmap = ocrdma_mmap, + .process_mad = ocrdma_process_mad, + .get_port_immutable = ocrdma_port_immutable, + .get_dev_fw_str = get_dev_fw_str, +}; + +static struct ib_device_ops ocrdma_dev_srq_ops = { + .create_srq = ocrdma_create_srq, + .modify_srq = ocrdma_modify_srq, + .query_srq = ocrdma_query_srq, + .destroy_srq = ocrdma_destroy_srq, + .post_srq_recv = ocrdma_post_srq_recv, +}; + static int ocrdma_register_device(struct ocrdma_dev *dev) { ocrdma_get_guid(dev, (u8 *)&dev->ibdev.node_guid); @@ -198,6 +242,8 @@ static int ocrdma_register_device(struct ocrdma_dev *dev) dev->ibdev.get_port_immutable = ocrdma_port_immutable; dev->ibdev.get_dev_fw_str = get_dev_fw_str; + ib_set_device_ops(&dev->ibdev, &ocrdma_dev_ops); + if (ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R) { dev->ibdev.uverbs_cmd_mask |= OCRDMA_UVERBS(CREATE_SRQ) | @@ -211,6 +257,7 @@ static int ocrdma_register_device(struct ocrdma_dev *dev) dev->ibdev.query_srq = ocrdma_query_srq; dev->ibdev.destroy_srq = ocrdma_destroy_srq; dev->ibdev.post_srq_recv = ocrdma_post_srq_recv; + ib_set_device_ops(&dev->ibdev, &ocrdma_dev_srq_ops); } dev->ibdev.driver_id = RDMA_DRIVER_OCRDMA; return ib_register_device(&dev->ibdev, "ocrdma%d", NULL);