From patchwork Mon Dec 10 19:09:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10722261 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 DAB8E18A7 for ; Mon, 10 Dec 2018 19:10:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB6842A6B1 for ; Mon, 10 Dec 2018 19:10:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF48C2A779; Mon, 10 Dec 2018 19:10:29 +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 6E31C2A6B1 for ; Mon, 10 Dec 2018 19:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbeLJTK2 (ORCPT ); Mon, 10 Dec 2018 14:10:28 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50471 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728813AbeLJTK2 (ORCPT ); Mon, 10 Dec 2018 14:10:28 -0500 Received: by mail-wm1-f67.google.com with SMTP id n190so12188089wmd.0 for ; Mon, 10 Dec 2018 11:10:26 -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=GsGL/d5xvOi07yXDF1bZ3pzkFP4JXaHlMpKFDodv9oE=; b=F27e1oJ6NF7bl7sZYHUZ1yaKJc8+ntmlpw14Om2LAVtmbnNGxlr/aR5j/lF0ou/l0x r+N3kb4S/vHh5jd81dPz1l5XNKdJe63YNiNAADbZAOp9JlNu4HProESqBKYaBPBSn3L/ hJWNU1+MpHeA6ucsIag1Bx2GHjUD0XexS7mjsseKHjahlIn6W/Y6jE7KKv+qLpSqcGYl OM8OZj50SHMPaRY6lfXs/Q2vYB8Y4LW0b+q1EkmXYbK38TgvGk6hqmx1Gz8gNpl0JZ37 ropCK3K0jDt1YxiqZWjxPVxeeJC0ARNBGKLWBvhh0X/0OQ8VahmmuF+zeot2s1/gVaEg Pd8w== 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=GsGL/d5xvOi07yXDF1bZ3pzkFP4JXaHlMpKFDodv9oE=; b=QxzzKy9I0HENYPcj0Xvfof6UQ+Ekb0C733cdfOg+kLg/qNitJzYgm7aZvZHLLAX3H1 GuvyGrplsFHGq0ka3kICD7yOBAOgOGRQBVc1QBfahR18HzY8m1l+qkoKpDc84VTl4ASH WURYJq93GZBLIzto0A1CiB0G99bl5AfyA9oI5RgX8/cCaY1E2lwugy+W3q0czsk+IDFy v77VNLhriaffQLR0eC3Zva6HIYxNzcAFtSbkYYYIsDj1U0ESYxxuRHBE/ZuoYg7FeF3a NXmEi0gf9WBl05UA8MytoQWUKGBXJ5stBjn1PrdfJYl8XbSxjKJS0MA89hjtzvSE502w MT8g== X-Gm-Message-State: AA+aEWYB/B6k//43qnqBJ9MmK8VIdaXsJDV1M0ppXF2vur3N9jycbBKY 512URCg0pstNcfYsz0eHO72Fi2Qo X-Google-Smtp-Source: AFSGD/UdDT46bqcBXP+BupfKYWMo2moxIxVsyFITZHWyqRP5XzdCVr/zwBZEjsrep0S7UAovEUiXDg== X-Received: by 2002:a1c:5d4f:: with SMTP id r76-v6mr11786167wmb.25.1544469026107; Mon, 10 Dec 2018 11:10:26 -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.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 11:10:25 -0800 (PST) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next v5 06/20] RDMA/hfi1: Initialize ib_device_ops struct Date: Mon, 10 Dec 2018 21:09:34 +0200 Message-Id: <20181210190948.6892-7-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/hfi1/verbs.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index 48e11e510358..b861bc1d5414 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c @@ -1616,6 +1616,16 @@ static int get_hw_stats(struct ib_device *ibdev, struct rdma_hw_stats *stats, return count; } +static const struct ib_device_ops hfi1_dev_ops = { + .alloc_hw_stats = alloc_hw_stats, + .alloc_rdma_netdev = hfi1_vnic_alloc_rn, + .get_dev_fw_str = hfi1_get_dev_fw_str, + .get_hw_stats = get_hw_stats, + .modify_device = modify_device, + /* keep process mad in the driver */ + .process_mad = hfi1_process_mad, +}; + /** * hfi1_register_ib_device - register our device with the infiniband core * @dd: the device data structure @@ -1659,14 +1669,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) ibdev->owner = THIS_MODULE; ibdev->phys_port_cnt = dd->num_pports; ibdev->dev.parent = &dd->pcidev->dev; - ibdev->modify_device = modify_device; - ibdev->alloc_hw_stats = alloc_hw_stats; - ibdev->get_hw_stats = get_hw_stats; - ibdev->alloc_rdma_netdev = hfi1_vnic_alloc_rn; - /* keep process mad in the driver */ - ibdev->process_mad = hfi1_process_mad; - ibdev->get_dev_fw_str = hfi1_get_dev_fw_str; + ib_set_device_ops(ibdev, &hfi1_dev_ops); strlcpy(ibdev->node_desc, init_utsname()->nodename, sizeof(ibdev->node_desc));