From patchwork Sun Aug 5 15:35:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10556185 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 67119139A for ; Sun, 5 Aug 2018 15:47:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C4E29178 for ; Sun, 5 Aug 2018 15:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45DDC291F9; Sun, 5 Aug 2018 15:47:19 +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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D6BB729178 for ; Sun, 5 Aug 2018 15:47:18 +0000 (UTC) Received: from localhost ([::1]:59033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmLFW-0008Tg-5v for patchwork-qemu-devel@patchwork.kernel.org; Sun, 05 Aug 2018 11:47:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fmL4q-0007EY-8G for qemu-devel@nongnu.org; Sun, 05 Aug 2018 11:36:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fmL4p-0006YD-AU for qemu-devel@nongnu.org; Sun, 05 Aug 2018 11:36:16 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fmL4p-0006XS-2R for qemu-devel@nongnu.org; Sun, 05 Aug 2018 11:36:15 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w75FZESn130005; Sun, 5 Aug 2018 15:36:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=kNpXj6xlSMGv5oM4YMxy5zuuiLZnRVHbjcqrLgGqA4s=; b=Cc8edP1GhpF3UV1T2XriPW1XI+jxYEqlQFnvnf6o0mUdrJFMQUB4E4QLr2ubRqstrjOj EBeX7CP6UbmPTtYVHez3KGYJkRT9UBgVd7T1ub6FBYb7LYteHXOrXNO3vvLo3sfya9W6 4Hhy6Da1QhXTXlJ3BkFTc+mnSMvfOBTmb+m3/Axp6Ib8KkihL1vHS1qQsf7yBsvWIQrR QNvPd6RVi7EkmA+ZatQKJrlCy5ykoQ7vb0bjR2D/loHxOCBc/wqJYCcg3J6pQ8kWGisN 7dTjC0n8Pvtgl/vyhUbuAUrNu3Qzohne0lgsv7aXY5CTJD1SQikVHaVOpxXIFBLtWdSV fA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2kn3jstccx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 Aug 2018 15:36:13 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w75FaCK4010786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 5 Aug 2018 15:36:12 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w75FaBBP029378; Sun, 5 Aug 2018 15:36:11 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 05 Aug 2018 08:36:11 -0700 From: Yuval Shaia To: qemu-devel@nongnu.org, yuval.shaia@oracle.com, marcel.apfelbaum@gmail.com Date: Sun, 5 Aug 2018 18:35:18 +0300 Message-Id: <20180805153518.2983-14-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180805153518.2983-1-yuval.shaia@oracle.com> References: <20180805153518.2983-1-yuval.shaia@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8975 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808050173 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 Subject: [Qemu-devel] [PATCH v2 13/13] hw/rdma: Add reference to pci_dev in backend_dev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The field backend_dev->dev is not initialized, fix it. Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 6 +++++- hw/rdma/rdma_backend.h | 2 +- hw/rdma/vmw/pvrdma_main.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index d29acc505b..d7a4bbd91f 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -744,7 +744,7 @@ static int init_device_caps(RdmaBackendDev *backend_dev, return 0; } -int rdma_backend_init(RdmaBackendDev *backend_dev, +int rdma_backend_init(RdmaBackendDev *backend_dev, PCIDevice *pdev, RdmaDeviceResources *rdma_dev_res, const char *backend_device_name, uint8_t port_num, uint8_t backend_gid_idx, struct ibv_device_attr *dev_attr, @@ -756,6 +756,10 @@ int rdma_backend_init(RdmaBackendDev *backend_dev, struct ibv_device **dev_list; struct ibv_port_attr port_attr; + memset(backend_dev, 0, sizeof(*backend_dev)); + + backend_dev->dev = pdev; + backend_dev->backend_gid_idx = backend_gid_idx; backend_dev->port_num = port_num; backend_dev->rdma_dev_res = rdma_dev_res; diff --git a/hw/rdma/rdma_backend.h b/hw/rdma/rdma_backend.h index 3049a73962..86e8fe8ab6 100644 --- a/hw/rdma/rdma_backend.h +++ b/hw/rdma/rdma_backend.h @@ -46,7 +46,7 @@ static inline uint32_t rdma_backend_mr_rkey(const RdmaBackendMR *mr) return mr->ibmr ? mr->ibmr->rkey : 0; } -int rdma_backend_init(RdmaBackendDev *backend_dev, +int rdma_backend_init(RdmaBackendDev *backend_dev, PCIDevice *pdev, RdmaDeviceResources *rdma_dev_res, const char *backend_device_name, uint8_t port_num, uint8_t backend_gid_idx, struct ibv_device_attr *dev_attr, diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 3d448bffc4..ca5fa8d981 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -611,7 +611,7 @@ static void pvrdma_realize(PCIDevice *pdev, Error **errp) goto out; } - rc = rdma_backend_init(&dev->backend_dev, &dev->rdma_dev_res, + rc = rdma_backend_init(&dev->backend_dev, pdev, &dev->rdma_dev_res, dev->backend_device_name, dev->backend_port_num, dev->backend_gid_idx, &dev->dev_attr, errp); if (rc) {