From patchwork Tue Oct 9 18:45:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10633175 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 A5A0815E8 for ; Tue, 9 Oct 2018 18:47:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B8D9294F9 for ; Tue, 9 Oct 2018 18:47:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9013A294FD; Tue, 9 Oct 2018 18:47:08 +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 36B6C294F9 for ; Tue, 9 Oct 2018 18:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727343AbeJJCF1 (ORCPT ); Tue, 9 Oct 2018 22:05:27 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34967 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbeJJCF1 (ORCPT ); Tue, 9 Oct 2018 22:05:27 -0400 Received: by mail-wm1-f68.google.com with SMTP id e187-v6so3125624wmf.0 for ; Tue, 09 Oct 2018 11:47:05 -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=bZx3t7q+UnozZRruXST7lP2ZXEpIQkkgwHA6Q+6HcUY=; b=eSrXDIQE8t+JZ5Z5UrB0/F0e6LlnhR5vgYJxTkIwFPkD/ernFF/WRpOqjz6XFBXdv1 fJHwVsPuTqhPmW8EFw7c8jh/ZJqm7cQZ1S9SA/sFGn4mXMVrfnb0BfgoGDIK9tjr44UN kE30nbjWVeh2Cql8C4NWLVqn7icD0Qn3roQb9oo8n9CUulRDeE0e+la4TzCFra0tXcwH 6QNDb71Stepyqehah55redNehFvbm/oy6/N3lduDz37WPW0AtsGRJ/rnVsWL2aghmC17 wm67x+2zsj/XGIsHH8cKmgMF+1IoZn50QAfxA/tCRAmh1B3S5HEuw9VIt5a/ojaNwXWs DFKw== 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=bZx3t7q+UnozZRruXST7lP2ZXEpIQkkgwHA6Q+6HcUY=; b=DJpFxKPLhbQff6KOS2x/Ky3m/JHst74RDsbX872NEVg5yPrcVb1EWf5i2IDzJgO5ZX dA1vDQYgFC48TvgfEpKJ+5BTIP9rGLZMlyn9lqwBTMUuLv58f9Ur8T6ew937nKC7U15S IH4p+qXG8HmSA3fmcexiNVWoVEh27FWz174UlDWfoXOlrvmAnfYfubj3OiPxXFiedIfK SS4P2j1ZKrov0glabiuF5YsgIt55GTxtpx2eOzNPwUfJpyq2/gSO0JiOxlownIYXv5q8 U11ir9zf6wZ83Ovj5znRTiSJ9FiuzIoDe1iTJ95SiQv4C323cl8SRpu5XLZcMEQoWMBT xxaw== X-Gm-Message-State: ABuFfog5JKMcIVNfEJvE6pZxiNVEyb3Ff63ZfqDb98lpcXQn+O7n7yYD 3NjMhZi4zSMQEtXGBkkXlpw= X-Google-Smtp-Source: ACcGV60eXkHPhmevrMIqYv4MyUHJHANIj42EcXmn0qCs3MnsjD4l8Tt+pvyNKPtHXdgl+OOrKi4A8g== X-Received: by 2002:a7b:c216:: with SMTP id x22-v6mr2792256wmi.65.1539110824777; Tue, 09 Oct 2018 11:47:04 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 11:47:04 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next 16/18] RDMA/vmw_pvrdma: Initialize ib_device_ops struct Date: Tue, 9 Oct 2018 21:45:45 +0300 Message-Id: <20181009184547.5907-17-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/vmw_pvrdma/pvrdma_main.c | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c index c1e31985b11c..25d494ce2d7d 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c @@ -157,6 +157,49 @@ static struct net_device *pvrdma_get_netdev(struct ib_device *ibdev, return netdev; } +static struct ib_device_ops pvrdma_dev_ops = { + .query_device = pvrdma_query_device, + .query_port = pvrdma_query_port, + .query_gid = pvrdma_query_gid, + .query_pkey = pvrdma_query_pkey, + .modify_port = pvrdma_modify_port, + .alloc_ucontext = pvrdma_alloc_ucontext, + .dealloc_ucontext = pvrdma_dealloc_ucontext, + .mmap = pvrdma_mmap, + .alloc_pd = pvrdma_alloc_pd, + .dealloc_pd = pvrdma_dealloc_pd, + .create_ah = pvrdma_create_ah, + .destroy_ah = pvrdma_destroy_ah, + .create_qp = pvrdma_create_qp, + .modify_qp = pvrdma_modify_qp, + .query_qp = pvrdma_query_qp, + .destroy_qp = pvrdma_destroy_qp, + .post_send = pvrdma_post_send, + .post_recv = pvrdma_post_recv, + .create_cq = pvrdma_create_cq, + .destroy_cq = pvrdma_destroy_cq, + .poll_cq = pvrdma_poll_cq, + .req_notify_cq = pvrdma_req_notify_cq, + .get_dma_mr = pvrdma_get_dma_mr, + .reg_user_mr = pvrdma_reg_user_mr, + .dereg_mr = pvrdma_dereg_mr, + .alloc_mr = pvrdma_alloc_mr, + .map_mr_sg = pvrdma_map_mr_sg, + .add_gid = pvrdma_add_gid, + .del_gid = pvrdma_del_gid, + .get_netdev = pvrdma_get_netdev, + .get_port_immutable = pvrdma_port_immutable, + .get_link_layer = pvrdma_port_link_layer, + .get_dev_fw_str = pvrdma_get_fw_ver_str, +}; + +static struct ib_device_ops pvrdma_dev_srq_ops = { + .create_srq = pvrdma_create_srq, + .modify_srq = pvrdma_modify_srq, + .query_srq = pvrdma_query_srq, + .destroy_srq = pvrdma_destroy_srq, +}; + static int pvrdma_register_device(struct pvrdma_dev *dev) { int ret = -1; @@ -228,6 +271,8 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) dev->ib_dev.get_link_layer = pvrdma_port_link_layer; dev->ib_dev.get_dev_fw_str = pvrdma_get_fw_ver_str; + ib_set_device_ops(&dev->ib_dev, &pvrdma_dev_ops); + mutex_init(&dev->port_mutex); spin_lock_init(&dev->desc_lock); @@ -256,6 +301,7 @@ static int pvrdma_register_device(struct pvrdma_dev *dev) dev->ib_dev.modify_srq = pvrdma_modify_srq; dev->ib_dev.query_srq = pvrdma_query_srq; dev->ib_dev.destroy_srq = pvrdma_destroy_srq; + ib_set_device_ops(&dev->ib_dev, &pvrdma_dev_srq_ops); dev->srq_tbl = kcalloc(dev->dsr->caps.max_srq, sizeof(struct pvrdma_srq *),