From patchwork Mon Nov 5 11:35:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10667893 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 C9D221751 for ; Mon, 5 Nov 2018 11:36:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8C9628DB6 for ; Mon, 5 Nov 2018 11:36:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACED829789; Mon, 5 Nov 2018 11:36:05 +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 554D728DB6 for ; Mon, 5 Nov 2018 11:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728718AbeKEUzV (ORCPT ); Mon, 5 Nov 2018 15:55:21 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38112 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727254AbeKEUzV (ORCPT ); Mon, 5 Nov 2018 15:55:21 -0500 Received: by mail-wr1-f67.google.com with SMTP id d10-v6so9120703wrs.5 for ; Mon, 05 Nov 2018 03:36:03 -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; bh=0cJKLZR37DzMrRyhQV9FACq55OFKrKS11Nc3efO0DyY=; b=BS3ypvv0EXDXgwzSA3gq+JRyMwNZtU1oSlKkrUA3qgsxcVZK0ej5XK4UEDOwv4u/qf 0lIxesyjoP+vsDN0UAbpm5FoCsRRzf+nU/YusRpPU3+Cy3f7MRnbU8BCyePASZA16wOD ggO1vLo2Wx9vsRzAmLfZN7C5sdhZUCf9U9VnYK0xhN68oZCn2ZKTD0u+HR8q+77l4ekr 6KG9p2oNS7Xj22wFVdiIZOp9pw2XezZp/+mImRECyp2FsZ9V5UVz5roMlZa1u4fZDTzU 4Aq6shjys8CDl2oJkH4p1Qw6/VGoNdAhdiN7gFddBjXzQIlotEKQSmIZUExQMIldUjCW 0qUQ== 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=0cJKLZR37DzMrRyhQV9FACq55OFKrKS11Nc3efO0DyY=; b=X7+3416omeIDKEybPxFncONq15LcPU4mcExnrVrwP76CHvy99ToylJzdGXeYRTf42Z VCyJIJPVQXq9cf+GGMwg5rscRUUiA86lANaM4cSAlNEUPsmXhsCRaCcno12ZwdXUJMEk Yi88SvttFxv3KZv+ygispumN7YzfQ6korY9Ac8+tR2AZs+HEEuAAaAi/UdP/6FWZ7W1D K2o3MdDBvo5HJwRmpy6s0aL2pZ8YFoLkWVYkvWsZ72yxNSxkyiWefo7QAfw+fkwRPhFx E8cqTBST5wM7KJNptdwe/kgQWbm9EwJnNMMT6qrOq8nJ/UKWEiUGhGHgI+DhT5lZPJrk grRA== X-Gm-Message-State: AGRZ1gLdHGWjfqFRSs+8C+ttY3ViqlVXRAEjp2HJ73C4Dk1jNk+aQIht KqTfjdAH05sLItraJAbQvF4= X-Google-Smtp-Source: AJdET5dQRan9t8H8mWc9SUywCMr0YnaugomnSaQEdbYluqrmuJ81ETSjauRvEM2Sh1lsZ1ypQ/rvxQ== X-Received: by 2002:a5d:5146:: with SMTP id u6-v6mr19225053wrt.299.1541417762354; Mon, 05 Nov 2018 03:36:02 -0800 (PST) Received: from kheib-workstation.redhat.com ([192.116.94.216]) by smtp.gmail.com with ESMTPSA id z18-v6sm10762147wru.83.2018.11.05.03.36.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Nov 2018 03:36:01 -0800 (PST) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next v3 14/20] RDMA/qib: Initialize ib_device_ops struct Date: Mon, 5 Nov 2018 13:35:22 +0200 Message-Id: <20181105113528.8317-15-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20181105113528.8317-1-kamalheib1@gmail.com> References: <20181105113528.8317-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/hw/qib/qib_verbs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 4b0f5761a646..b756ab613a9a 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c @@ -1496,6 +1496,13 @@ static void qib_fill_device_attr(struct qib_devdata *dd) dd->verbs_dev.rdi.wc_opcode = ib_qib_wc_opcode; } +static const struct ib_device_ops qib_dev_ops = { + /* Device operations */ + .modify_device = qib_modify_device, + /* MAD operations */ + .process_mad = qib_process_mad, +}; + /** * qib_register_ib_device - register our device with the infiniband core * @dd: the device data structure @@ -1558,8 +1565,6 @@ int qib_register_ib_device(struct qib_devdata *dd) ibdev->node_guid = ppd->guid; ibdev->phys_port_cnt = dd->num_pports; ibdev->dev.parent = &dd->pcidev->dev; - ibdev->modify_device = qib_modify_device; - ibdev->process_mad = qib_process_mad; snprintf(ibdev->node_desc, sizeof(ibdev->node_desc), "Intel Infiniband HCA %s", init_utsname()->nodename); @@ -1627,6 +1632,7 @@ int qib_register_ib_device(struct qib_devdata *dd) } rdma_set_device_sysfs_group(&dd->verbs_dev.rdi.ibdev, &qib_attr_group); + ib_set_device_ops(ibdev, &qib_dev_ops); ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_QIB); if (ret) goto err_tx;