From patchwork Mon Dec 10 19:09:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10722265 X-Patchwork-Delegate: jgg@ziepe.ca 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 598993E9D for ; Mon, 10 Dec 2018 19:10:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 496002A87C for ; Mon, 10 Dec 2018 19:10:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E5E82A779; Mon, 10 Dec 2018 19:10:32 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB 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 BF4EE2A954 for ; Mon, 10 Dec 2018 19:10:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729247AbeLJTKb (ORCPT ); Mon, 10 Dec 2018 14:10:31 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33603 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728734AbeLJTKb (ORCPT ); Mon, 10 Dec 2018 14:10:31 -0500 Received: by mail-wr1-f68.google.com with SMTP id c14so11692894wrr.0 for ; Mon, 10 Dec 2018 11:10:29 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=zadQaJ3pBwpmFZF+ljIRpmDFXgDnb/gWUshKVHaZPF8=; b=jdVQqUAKJa7iI1QCC+zjQ6y5hXXq5vER/wgAtj9yXk25mTNrfhR9WotLYZH7O8mAIR xBqkOkS3aYHfkAa6PbIAumlBf4YUASQ7YvV/BVAN/qFmPv8/GdIF0nJLLWwNmPN+ITZ9 m4l4uPRaY8mo4eizNK2LMAcPPnlnwDozSUfW15niyWSsZ8Ubh//Cb6VcFzWGK87irPwa 0B5qeyyo93MCg5ZB2hcA+xREZstJ1SncPlf/wSnQUf4ninJn2gxx4QCCpPJ950KjFHM2 nROl1uL1KCgr/OCMc9kIt4lhWu+WjMmqcfAeBHScj/2RWtAd9f48tyu22uO+QkOwIEpj UhBA== 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:mime-version:content-transfer-encoding; bh=zadQaJ3pBwpmFZF+ljIRpmDFXgDnb/gWUshKVHaZPF8=; b=FiXdKcB7DtLeaLYQQsr9eHR0eNUelhRjSZZQJXhuO+lvp+s8zBO/m5dwf7VQWNM4ve DIbeJqMqv2ErwvvJO7IYWgnNOSylPWWhVY7sA2MC0OYcG5ZMplHQBlKwCuLqb1mAabql mNcaLJY6IuQ7z6ibJt29kvIadoGCQL2S9ejk+Zqpn8CrcqojUkIw3wUDaxwJOQiIyA7q k3CFSn23HSWADt0BK3SygJpRifgh5ipp9nVYcXU55AVMVZyXv0LAic04vn28nbCSJX46 6wPVgnTt3qm+QFRT4MMxIvzxSS/zfJIEfOybD3+TQi1qmVnJV7w0A0JpwR2QGNrRM4u9 WaFg== X-Gm-Message-State: AA+aEWaINw4VWVm2D63Kji4xWKGGJeVeejXH9FtCJnBSBuJ/iqLPWCj7 SpZyRwQbaPlSYibSBmtGIxs= X-Google-Smtp-Source: AFSGD/X85aLkcYZGQSH01BCJWx/3lsEx3GCpgJbdhKfr8NLl+URY+Y9XZhlbFwO7wDPFoFF5SU8Rfg== X-Received: by 2002:adf:ce02:: with SMTP id p2mr11914146wrn.185.1544469028789; Mon, 10 Dec 2018 11:10:28 -0800 (PST) Received: from kheib-workstation.redhat.com (bzq-109-64-38-215.red.bezeqint.net. [109.64.38.215]) by smtp.gmail.com with ESMTPSA id o5sm33847657wmg.25.2018.12.10.11.10.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 11:10:28 -0800 (PST) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next v5 08/20] RDMA/i40iw: Initialize ib_device_ops struct Date: Mon, 10 Dec 2018 21:09:36 +0200 Message-Id: <20181210190948.6892-9-kamalheib1@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181210190948.6892-1-kamalheib1@gmail.com> References: <20181210190948.6892-1-kamalheib1@gmail.com> MIME-Version: 1.0 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 using ib_set_device_ops(). Signed-off-by: Kamal Heib --- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 63 ++++++++++++----------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c index a773d1edf7fd..9e42ac2db3ca 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c @@ -2721,6 +2721,39 @@ static int i40iw_query_pkey(struct ib_device *ibdev, return 0; } +static const struct ib_device_ops i40iw_dev_ops = { + .alloc_hw_stats = i40iw_alloc_hw_stats, + .alloc_mr = i40iw_alloc_mr, + .alloc_pd = i40iw_alloc_pd, + .alloc_ucontext = i40iw_alloc_ucontext, + .create_cq = i40iw_create_cq, + .create_qp = i40iw_create_qp, + .dealloc_pd = i40iw_dealloc_pd, + .dealloc_ucontext = i40iw_dealloc_ucontext, + .dereg_mr = i40iw_dereg_mr, + .destroy_cq = i40iw_destroy_cq, + .destroy_qp = i40iw_destroy_qp, + .drain_rq = i40iw_drain_rq, + .drain_sq = i40iw_drain_sq, + .get_dev_fw_str = i40iw_get_dev_fw_str, + .get_dma_mr = i40iw_get_dma_mr, + .get_hw_stats = i40iw_get_hw_stats, + .get_port_immutable = i40iw_port_immutable, + .map_mr_sg = i40iw_map_mr_sg, + .mmap = i40iw_mmap, + .modify_qp = i40iw_modify_qp, + .poll_cq = i40iw_poll_cq, + .post_recv = i40iw_post_recv, + .post_send = i40iw_post_send, + .query_device = i40iw_query_device, + .query_gid = i40iw_query_gid, + .query_pkey = i40iw_query_pkey, + .query_port = i40iw_query_port, + .query_qp = i40iw_query_qp, + .reg_user_mr = i40iw_reg_user_mr, + .req_notify_cq = i40iw_req_notify_cq, +}; + /** * i40iw_init_rdma_device - initialization of iwarp device * @iwdev: iwarp device @@ -2767,30 +2800,6 @@ static struct i40iw_ib_device *i40iw_init_rdma_device(struct i40iw_device *iwdev iwibdev->ibdev.phys_port_cnt = 1; iwibdev->ibdev.num_comp_vectors = iwdev->ceqs_count; iwibdev->ibdev.dev.parent = &pcidev->dev; - iwibdev->ibdev.query_port = i40iw_query_port; - iwibdev->ibdev.query_pkey = i40iw_query_pkey; - iwibdev->ibdev.query_gid = i40iw_query_gid; - iwibdev->ibdev.alloc_ucontext = i40iw_alloc_ucontext; - iwibdev->ibdev.dealloc_ucontext = i40iw_dealloc_ucontext; - iwibdev->ibdev.mmap = i40iw_mmap; - iwibdev->ibdev.alloc_pd = i40iw_alloc_pd; - iwibdev->ibdev.dealloc_pd = i40iw_dealloc_pd; - iwibdev->ibdev.create_qp = i40iw_create_qp; - iwibdev->ibdev.modify_qp = i40iw_modify_qp; - iwibdev->ibdev.query_qp = i40iw_query_qp; - iwibdev->ibdev.destroy_qp = i40iw_destroy_qp; - iwibdev->ibdev.create_cq = i40iw_create_cq; - iwibdev->ibdev.destroy_cq = i40iw_destroy_cq; - iwibdev->ibdev.get_dma_mr = i40iw_get_dma_mr; - iwibdev->ibdev.reg_user_mr = i40iw_reg_user_mr; - iwibdev->ibdev.dereg_mr = i40iw_dereg_mr; - iwibdev->ibdev.alloc_hw_stats = i40iw_alloc_hw_stats; - iwibdev->ibdev.get_hw_stats = i40iw_get_hw_stats; - iwibdev->ibdev.query_device = i40iw_query_device; - iwibdev->ibdev.drain_sq = i40iw_drain_sq; - iwibdev->ibdev.drain_rq = i40iw_drain_rq; - iwibdev->ibdev.alloc_mr = i40iw_alloc_mr; - iwibdev->ibdev.map_mr_sg = i40iw_map_mr_sg; iwibdev->ibdev.iwcm = kzalloc(sizeof(*iwibdev->ibdev.iwcm), GFP_KERNEL); if (!iwibdev->ibdev.iwcm) { ib_dealloc_device(&iwibdev->ibdev); @@ -2807,12 +2816,6 @@ static struct i40iw_ib_device *i40iw_init_rdma_device(struct i40iw_device *iwdev iwibdev->ibdev.iwcm->destroy_listen = i40iw_destroy_listen; memcpy(iwibdev->ibdev.iwcm->ifname, netdev->name, sizeof(iwibdev->ibdev.iwcm->ifname)); - iwibdev->ibdev.get_port_immutable = i40iw_port_immutable; - iwibdev->ibdev.get_dev_fw_str = i40iw_get_dev_fw_str; - iwibdev->ibdev.poll_cq = i40iw_poll_cq; - iwibdev->ibdev.req_notify_cq = i40iw_req_notify_cq; - iwibdev->ibdev.post_send = i40iw_post_send; - iwibdev->ibdev.post_recv = i40iw_post_recv; return iwibdev; }