From patchwork Tue Oct 9 18:45: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: 10633153 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 14EF516B1 for ; Tue, 9 Oct 2018 18:46:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AF8C294F9 for ; Tue, 9 Oct 2018 18:46:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F374C294FD; Tue, 9 Oct 2018 18:46:54 +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 A0B06294FA for ; Tue, 9 Oct 2018 18:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbeJJCFN (ORCPT ); Tue, 9 Oct 2018 22:05:13 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54168 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbeJJCFN (ORCPT ); Tue, 9 Oct 2018 22:05:13 -0400 Received: by mail-wm1-f66.google.com with SMTP id y11-v6so2895910wma.3 for ; Tue, 09 Oct 2018 11:46:52 -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=o22LruJlQbcpQm5R5egUfci5o/4tvJ2Avfn5OS0Boc0=; b=Q2/yqAkD8gGCvnfQA4DTHcJnEltxWV5sWOqHtQgMwfFmhKrZyitEe6Gn5X+4ndap5S 9jkeGtxTCzvMA7ACe5265JvA6tfpCoRt9qGLSD2F2TAudv17RKJIHQuPT0kjIGgY8zcD CC9zufWOdHbsK5MPPc2C5b9R36FnubLY7kAZbaoL3YiS2wVw9kXAmQVUgyz6MPOs77st ycYpCnPboo2mWuYl0Nji6sLV14ZLWjumxRg0UKHsAjpE29wy56Kryn3N+HfbqngwqUsx sCrxM36x6ylAW3u5s841F/xjnQn2GgKWfsPiUp8GaL0Ft7ReA4EiHIBiZjpYm+M9V6on r5tg== 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=o22LruJlQbcpQm5R5egUfci5o/4tvJ2Avfn5OS0Boc0=; b=uGlpRdiXsY62WQFtpVVv+wGK7sIIb1M6JjXbopueNwsTZ89ECEpM7gG8jOfab6y7DX XB1teLmN4HGfPZAyf1wsAKDZ2TC7TswU/oRHw2w25gEx0OVnxieSosWuekKHbAwKawYo al7oFz+5w011M34qUoIXvgOMtP1umsbpH33gcN55YHgbBWyAf5RhS8s2aMhwU3D4BDz7 lNtZuWnsHkEwRe4s5wEUiLKIhItemBz/PlhFcI9gBqNZvcKIYmOBDaCnQ81AHNuHLI3O i2uootyr+AIBSJgnM5jKz1z/n5/4LJnONr+Ragxlww+iYru9+P5cEnFizNCDmPYamBZQ dQGg== X-Gm-Message-State: ABuFfojdlfTbIAmlKOg6i1/FGoOkoElpLsaYqDAeXp8Ko+ucGSxRCbsB 4KLej/OJVPLAg+lHgHQaza6T9J97 X-Google-Smtp-Source: ACcGV632I7duIi7VN8v92qts/+BNjD3VVvvhLMwLC0rKKA0sNCREM6Tpwr6kuRgs7qKTxN/cPrzaBA== X-Received: by 2002:a1c:a505:: with SMTP id o5-v6mr2257423wme.53.1539110811923; Tue, 09 Oct 2018 11:46:51 -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.46.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 11:46:51 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next 05/18] RDMA/hfi1: Initialize ib_device_ops struct Date: Tue, 9 Oct 2018 21:45:34 +0300 Message-Id: <20181009184547.5907-6-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/hfi1/verbs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index bc7f00ba1988..c63f331dbf7a 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c @@ -1610,6 +1610,15 @@ static int get_hw_stats(struct ib_device *ibdev, struct rdma_hw_stats *stats, return count; } +static struct ib_device_ops hfi1_dev_ops = { + .modify_device = modify_device, + .alloc_hw_stats = alloc_hw_stats, + .get_hw_stats = get_hw_stats, + .alloc_rdma_netdev = hfi1_vnic_alloc_rn, + .process_mad = hfi1_process_mad, + .get_dev_fw_str = hfi1_get_dev_fw_str, +}; + /** * hfi1_register_ib_device - register our device with the infiniband core * @dd: the device data structure @@ -1662,6 +1671,8 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd) 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));