From patchwork Sun Oct 21 12:49:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10650789 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 F161314DE for ; Sun, 21 Oct 2018 12:50:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E11C028765 for ; Sun, 21 Oct 2018 12:50:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5B802877B; Sun, 21 Oct 2018 12:50:37 +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 6FC9B28765 for ; Sun, 21 Oct 2018 12:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727603AbeJUVEt (ORCPT ); Sun, 21 Oct 2018 17:04:49 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38399 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727676AbeJUVEt (ORCPT ); Sun, 21 Oct 2018 17:04:49 -0400 Received: by mail-wr1-f66.google.com with SMTP id d10-v6so2370152wrs.5 for ; Sun, 21 Oct 2018 05:50:35 -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=i2bcLm4nTuBGqXQR5Ttd2oa2F4f+ImtpVZWeGL8ooXY=; b=GORhUlhHzOg1YyyS1nI8xzpGLQkIkbgX2024oMBhu6HSK7UbRK8UWxmBm6kbJNepJk bQuYnjxs7rAh3JcL2DRwK42eznjSapViv1OsKQOnhdTh0kBmpKUinn9ZIGgE2lqMzOBA 1LaLC3Dg6/T7CLx20WfJ/ktBvRrMG9CwwlDy0Xj7yb/uztqcXE8DTgj6CTk2Ah6O6txC WbKP4PmmiBgV+ZaI1AL3CYerpqycx2aJvI3eQgra3eHE5mDZFEwpi1i93f6j/wC3bGd9 ZAOkCcG6w4HNG+Ax8duBJeSE4lLpdOWZkWTgpzqNAdmJ2ruDAdFR0qi/qPWgl+HGnFRa tRxA== 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=i2bcLm4nTuBGqXQR5Ttd2oa2F4f+ImtpVZWeGL8ooXY=; b=LOBk92rctoZCDZyrS1yp89OwG4uwmgAsyyU59XUzlY+I+SHY4mPXF9Ff4k7Jw/tLlT 7eyE8jzzvckYmkxJ3JvQzoF4pQfg7oFaK/JVZAVTFhgMfqOFctb78AbSWhzNyRgq7dPE 3Id+ROAn0h8JmogWioWc3B21KbNMNSEAc7+TZ1aen+AfDWHMaGBZXF2UHIfCgJHMMS0c rlSMRbB/cYmsLkJFzxppRHWe8FFy7veWWANFa+bgTDhxhulY0bugEDoArP5/Ek1E28JL jTmChZbsOMesCTEoJ+iWLY7C2w/wDn6Rd7POufPUuu6XaTvOKFWHOXfh3/Xoql2W5+ci ItlA== X-Gm-Message-State: ABuFfoiGThIVdTB1WCrmF8GM2btOc9j3MNjCQmDmT3G1jauy4UEq4IT7 ryST5tsNUQvfBLUBJXGnQjY= X-Google-Smtp-Source: ACcGV60ROH5EpsRfr/VQpt+AODhfSKEtf9IEEhcMxUFpINXM97fXgI1xVSoBs66o1Mu7E25ROnr2tg== X-Received: by 2002:adf:9c8b:: with SMTP id d11-v6mr16859791wre.11.1540126234425; Sun, 21 Oct 2018 05:50:34 -0700 (PDT) Received: from kheib-workstation.redhat.com ([192.116.94.216]) by smtp.gmail.com with ESMTPSA id v76-v6sm14375380wmd.32.2018.10.21.05.50.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Oct 2018 05:50:33 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next v2 17/18] RDMA/rxe: Initialize ib_device_ops struct Date: Sun, 21 Oct 2018 15:49:52 +0300 Message-Id: <20181021124953.11558-18-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20181021124953.11558-1-kamalheib1@gmail.com> References: <20181021124953.11558-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 using ib_set_device_ops(). Signed-off-by: Kamal Heib --- drivers/infiniband/sw/rxe/rxe_verbs.c | 90 ++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c index 9c19f2027511..ba1472e87c15 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.c +++ b/drivers/infiniband/sw/rxe/rxe_verbs.c @@ -1157,6 +1157,52 @@ static const struct attribute_group rxe_attr_group = { .attrs = rxe_dev_attributes, }; +static const struct ib_device_ops rxe_dev_ops = { + .query_device = rxe_query_device, + .modify_device = rxe_modify_device, + .query_port = rxe_query_port, + .modify_port = rxe_modify_port, + .get_link_layer = rxe_get_link_layer, + .get_netdev = rxe_get_netdev, + .query_pkey = rxe_query_pkey, + .alloc_ucontext = rxe_alloc_ucontext, + .dealloc_ucontext = rxe_dealloc_ucontext, + .mmap = rxe_mmap, + .get_port_immutable = rxe_port_immutable, + .alloc_pd = rxe_alloc_pd, + .dealloc_pd = rxe_dealloc_pd, + .create_ah = rxe_create_ah, + .modify_ah = rxe_modify_ah, + .query_ah = rxe_query_ah, + .destroy_ah = rxe_destroy_ah, + .create_srq = rxe_create_srq, + .modify_srq = rxe_modify_srq, + .query_srq = rxe_query_srq, + .destroy_srq = rxe_destroy_srq, + .post_srq_recv = rxe_post_srq_recv, + .create_qp = rxe_create_qp, + .modify_qp = rxe_modify_qp, + .query_qp = rxe_query_qp, + .destroy_qp = rxe_destroy_qp, + .post_send = rxe_post_send, + .post_recv = rxe_post_recv, + .create_cq = rxe_create_cq, + .destroy_cq = rxe_destroy_cq, + .resize_cq = rxe_resize_cq, + .poll_cq = rxe_poll_cq, + .peek_cq = rxe_peek_cq, + .req_notify_cq = rxe_req_notify_cq, + .get_dma_mr = rxe_get_dma_mr, + .reg_user_mr = rxe_reg_user_mr, + .dereg_mr = rxe_dereg_mr, + .alloc_mr = rxe_alloc_mr, + .map_mr_sg = rxe_map_mr_sg, + .attach_mcast = rxe_attach_mcast, + .detach_mcast = rxe_detach_mcast, + .get_hw_stats = rxe_ib_get_hw_stats, + .alloc_hw_stats = rxe_ib_alloc_hw_stats, +}; + int rxe_register_device(struct rxe_dev *rxe) { int err; @@ -1211,49 +1257,7 @@ int rxe_register_device(struct rxe_dev *rxe) | BIT_ULL(IB_USER_VERBS_CMD_DETACH_MCAST) ; - dev->query_device = rxe_query_device; - dev->modify_device = rxe_modify_device; - dev->query_port = rxe_query_port; - dev->modify_port = rxe_modify_port; - dev->get_link_layer = rxe_get_link_layer; - dev->get_netdev = rxe_get_netdev; - dev->query_pkey = rxe_query_pkey; - dev->alloc_ucontext = rxe_alloc_ucontext; - dev->dealloc_ucontext = rxe_dealloc_ucontext; - dev->mmap = rxe_mmap; - dev->get_port_immutable = rxe_port_immutable; - dev->alloc_pd = rxe_alloc_pd; - dev->dealloc_pd = rxe_dealloc_pd; - dev->create_ah = rxe_create_ah; - dev->modify_ah = rxe_modify_ah; - dev->query_ah = rxe_query_ah; - dev->destroy_ah = rxe_destroy_ah; - dev->create_srq = rxe_create_srq; - dev->modify_srq = rxe_modify_srq; - dev->query_srq = rxe_query_srq; - dev->destroy_srq = rxe_destroy_srq; - dev->post_srq_recv = rxe_post_srq_recv; - dev->create_qp = rxe_create_qp; - dev->modify_qp = rxe_modify_qp; - dev->query_qp = rxe_query_qp; - dev->destroy_qp = rxe_destroy_qp; - dev->post_send = rxe_post_send; - dev->post_recv = rxe_post_recv; - dev->create_cq = rxe_create_cq; - dev->destroy_cq = rxe_destroy_cq; - dev->resize_cq = rxe_resize_cq; - dev->poll_cq = rxe_poll_cq; - dev->peek_cq = rxe_peek_cq; - dev->req_notify_cq = rxe_req_notify_cq; - dev->get_dma_mr = rxe_get_dma_mr; - dev->reg_user_mr = rxe_reg_user_mr; - dev->dereg_mr = rxe_dereg_mr; - dev->alloc_mr = rxe_alloc_mr; - dev->map_mr_sg = rxe_map_mr_sg; - dev->attach_mcast = rxe_attach_mcast; - dev->detach_mcast = rxe_detach_mcast; - dev->get_hw_stats = rxe_ib_get_hw_stats; - dev->alloc_hw_stats = rxe_ib_alloc_hw_stats; + ib_set_device_ops(dev, &rxe_dev_ops); tfm = crypto_alloc_shash("crc32", 0, 0); if (IS_ERR(tfm)) {