From patchwork Tue Oct 9 18:45:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10633151 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 C994F933 for ; Tue, 9 Oct 2018 18:46:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFB15294F9 for ; Tue, 9 Oct 2018 18:46:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3FDF2953E; 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 6048C294F9 for ; Tue, 9 Oct 2018 18:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727151AbeJJCFN (ORCPT ); Tue, 9 Oct 2018 22:05:13 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40495 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbeJJCFM (ORCPT ); Tue, 9 Oct 2018 22:05:12 -0400 Received: by mail-wr1-f65.google.com with SMTP id d2-v6so2955192wro.7 for ; Tue, 09 Oct 2018 11:46:51 -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=uwhcXmKUX4U8ipwdVYogTbCzTk6jrQFDLMcECgp8Vyw=; b=PowwT4SX1tU2909FcBtMHdgK9+MmErFXAoY2NY9Qt85q1CRL5v7tggE6uCZ2E7c97G 9gmFlJlpULhPm/rron5wu3v/k4621Zl9npK7GkqXvp26RGarYv98D1V07YmFJnnzQN5W RFS4FfijdjL7V4FTLNmlZ91tGwuXCnV1cexXO+SXYKaP07UX3j9OOBQRtvWBEUcfemEM HZAuDf/yZ1fjh4iF1J4kp30z9aus1CqXIeba2QLKt4AxmmETRgZH0Tdw3Fm6paq/zsi3 SksKTdcHp/3Pd7I/ugbKQbZPAVPjlDZZ1qlwlur8+g1Y5RBsx/4SgfOBqOLC1Jm/15qW MYOw== 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=uwhcXmKUX4U8ipwdVYogTbCzTk6jrQFDLMcECgp8Vyw=; b=sLLSQFLCEaSfErFPc2wh4gPpld50SkCmKg2Ag/D2F/Y4MIn+m0FjGLIJkugJp2XeTR 85NR+XDoyAnfDLbp1gPbiHxZrZYET4hgdx1LKpfXKTlxITxou5saZF8UL8b8JiV0iRwS ElxQoegwdMEdYV8Yl8kiBJVNNV/lM9Zsh9GpHCJ0OInnJ5ILlc8gCEKJeGtThcJCFvWW ZO2K1RW5OLX8Phu/kmJS+WFQoOqQLxmFIj9b7khcEuWTcjQ4Egr0BQcuE4ReBtS8U0Qv /SFvW12HhNc/v+0lgYjL+A9prxQqbYLFc3iv104ek7wBHSMaInBHhLEwYwtG9yYmU+VR HTaw== X-Gm-Message-State: ABuFfojOO+0PVtpyAUX7H3Eh4QWE9HBV9p9hnNBSp0PpF7cQL6cUyEej juY0omO9qQrwRp3gnWKkxbCdgLr0 X-Google-Smtp-Source: ACcGV61o/cp1ngAZwhfkE+kAEGwcwfJxXqN6omRjt/pl83hEGDFS1j6WHk69POFl9edclalnV9cqEQ== X-Received: by 2002:a5d:4ec8:: with SMTP id s8-v6mr19693642wrv.32.1539110810754; Tue, 09 Oct 2018 11:46:50 -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.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 11:46:50 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next 04/18] RDMA/cxgb4: Initialize ib_device_ops struct Date: Tue, 9 Oct 2018 21:45:33 +0300 Message-Id: <20181009184547.5907-5-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/cxgb4/provider.c | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 416f8d1af610..66bf1aae4021 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -527,6 +527,44 @@ static int fill_res_entry(struct sk_buff *msg, struct rdma_restrack_entry *res) c4iw_restrack_funcs[res->type](msg, res) : 0; } +static struct ib_device_ops c4iw_dev_ops = { + .query_device = c4iw_query_device, + .query_port = c4iw_query_port, + .query_pkey = c4iw_query_pkey, + .query_gid = c4iw_query_gid, + .alloc_ucontext = c4iw_alloc_ucontext, + .dealloc_ucontext = c4iw_dealloc_ucontext, + .mmap = c4iw_mmap, + .alloc_pd = c4iw_allocate_pd, + .dealloc_pd = c4iw_deallocate_pd, + .create_qp = c4iw_create_qp, + .modify_qp = c4iw_ib_modify_qp, + .query_qp = c4iw_ib_query_qp, + .destroy_qp = c4iw_destroy_qp, + .create_srq = c4iw_create_srq, + .modify_srq = c4iw_modify_srq, + .destroy_srq = c4iw_destroy_srq, + .create_cq = c4iw_create_cq, + .destroy_cq = c4iw_destroy_cq, + .poll_cq = c4iw_poll_cq, + .get_dma_mr = c4iw_get_dma_mr, + .reg_user_mr = c4iw_reg_user_mr, + .dereg_mr = c4iw_dereg_mr, + .alloc_mw = c4iw_alloc_mw, + .dealloc_mw = c4iw_dealloc_mw, + .alloc_mr = c4iw_alloc_mr, + .map_mr_sg = c4iw_map_mr_sg, + .req_notify_cq = c4iw_arm_cq, + .post_send = c4iw_post_send, + .post_recv = c4iw_post_receive, + .post_srq_recv = c4iw_post_srq_recv, + .alloc_hw_stats = c4iw_alloc_stats, + .get_hw_stats = c4iw_get_mib, + .get_port_immutable = c4iw_port_immutable, + .get_dev_fw_str = get_dev_fw_str, + .get_netdev = get_netdev, +}; + void c4iw_register_device(struct work_struct *work) { int ret; @@ -626,6 +664,7 @@ void c4iw_register_device(struct work_struct *work) sizeof(dev->ibdev.iwcm->ifname)); dev->ibdev.driver_id = RDMA_DRIVER_CXGB4; + ib_set_device_ops(&dev->ibdev, &c4iw_dev_ops); ret = ib_register_device(&dev->ibdev, "cxgb4_%d", NULL); if (ret) goto err_kfree_iwcm;