From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521820674676443.2056254913741; Fri, 23 Mar 2018 08:57:54 -0700 (PDT) Received: from localhost ([::1]:38689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP4d-0003ja-SN for importer@patchew.org; Fri, 23 Mar 2018 11:57:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0G-0008Cg-ET for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0D-0007cn-G6 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:16 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54814 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0D-0007cY-Af for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC0B340201A6; Fri, 23 Mar 2018 15:53:12 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EC6D2023233; Fri, 23 Mar 2018 15:53:10 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:52:59 +0300 Message-Id: <20180323155306.83812-2-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:12 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 1/8] hw/rdma: Add Query QP operation 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yuval Shaia This operation is needed by rdma devices - implement it. Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 12 ++++++++++++ hw/rdma/rdma_backend.h | 2 ++ hw/rdma/rdma_rm.c | 18 ++++++++++++++++++ hw/rdma/rdma_rm.h | 3 +++ 4 files changed, 35 insertions(+) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index e306fba534..0beed77c27 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -646,6 +646,18 @@ int rdma_backend_qp_state_rts(RdmaBackendQP *qp, uint8= _t qp_type, return 0; } =20 +int rdma_backend_query_qp(RdmaBackendQP *qp, struct ibv_qp_attr *attr, + int attr_mask, struct ibv_qp_init_attr *init_att= r) +{ + if (!qp->ibqp) { + pr_dbg("QP1\n"); + attr->qp_state =3D IBV_QPS_RTS; + return 0; + } + + return ibv_query_qp(qp->ibqp, attr, attr_mask, init_attr); +} + void rdma_backend_destroy_qp(RdmaBackendQP *qp) { if (qp->ibqp) { diff --git a/hw/rdma/rdma_backend.h b/hw/rdma/rdma_backend.h index 68f2b05ca7..36218d1990 100644 --- a/hw/rdma/rdma_backend.h +++ b/hw/rdma/rdma_backend.h @@ -83,6 +83,8 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_dev= , RdmaBackendQP *qp, bool use_qkey); int rdma_backend_qp_state_rts(RdmaBackendQP *qp, uint8_t qp_type, uint32_t sq_psn, uint32_t qkey, bool use_qke= y); +int rdma_backend_query_qp(RdmaBackendQP *qp, struct ibv_qp_attr *attr, + int attr_mask, struct ibv_qp_init_attr *init_att= r); void rdma_backend_destroy_qp(RdmaBackendQP *qp); =20 void rdma_backend_post_send(RdmaBackendDev *backend_dev, diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index b5fc45ddab..43f73adecf 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -453,6 +453,24 @@ int rdma_rm_modify_qp(RdmaDeviceResources *dev_res, Rd= maBackendDev *backend_dev, return 0; } =20 +int rdma_rm_query_qp(RdmaDeviceResources *dev_res, RdmaBackendDev *backend= _dev, + uint32_t qp_handle, struct ibv_qp_attr *attr, + int attr_mask, struct ibv_qp_init_attr *init_attr) +{ + RdmaRmQP *qp; + + pr_dbg("qpn=3D%d\n", qp_handle); + + qp =3D rdma_rm_get_qp(dev_res, qp_handle); + if (!qp) { + return -EINVAL; + } + + pr_dbg("qp_type=3D%d\n", qp->qp_type); + + return rdma_backend_query_qp(&qp->backend_qp, attr, attr_mask, init_at= tr); +} + void rdma_rm_dealloc_qp(RdmaDeviceResources *dev_res, uint32_t qp_handle) { RdmaRmQP *qp; diff --git a/hw/rdma/rdma_rm.h b/hw/rdma/rdma_rm.h index be95c1b0f4..0528c1972b 100644 --- a/hw/rdma/rdma_rm.h +++ b/hw/rdma/rdma_rm.h @@ -59,6 +59,9 @@ int rdma_rm_modify_qp(RdmaDeviceResources *dev_res, RdmaB= ackendDev *backend_dev, union ibv_gid *dgid, uint32_t dqpn, enum ibv_qp_state qp_state, uint32_t qkey, uint32_t rq_psn, uint32_t sq_psn); +int rdma_rm_query_qp(RdmaDeviceResources *dev_res, RdmaBackendDev *backend= _dev, + uint32_t qp_handle, struct ibv_qp_attr *attr, + int attr_mask, struct ibv_qp_init_attr *init_attr); void rdma_rm_dealloc_qp(RdmaDeviceResources *dev_res, uint32_t qp_handle); =20 int rdma_rm_alloc_cqe_ctx(RdmaDeviceResources *dev_res, uint32_t *cqe_ctx_= id, --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521820794810128.41903314134208; Fri, 23 Mar 2018 08:59:54 -0700 (PDT) Received: from localhost ([::1]:38706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP6g-0006I9-3v for importer@patchew.org; Fri, 23 Mar 2018 11:59:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0H-0008Cp-2I for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0G-0007dr-5j for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54822 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0G-0007dZ-0f for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8210A40201A7; Fri, 23 Mar 2018 15:53:15 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1ADDA2023233; Fri, 23 Mar 2018 15:53:12 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:00 +0300 Message-Id: <20180323155306.83812-3-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:15 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 2/8] hw/rdma: Add support for Query QP verb to pvrdma device 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Yuval Shaia This IB verb is needed by some applications - implement it. Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum Signed-off-by: Marcel Apfelbaum --- hw/rdma/vmw/pvrdma_cmd.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index 293dfed29f..cf8c50af31 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -515,6 +515,28 @@ static int modify_qp(PVRDMADev *dev, union pvrdma_cmd_= req *req, return rsp->hdr.err; } =20 +static int query_qp(PVRDMADev *dev, union pvrdma_cmd_req *req, + union pvrdma_cmd_resp *rsp) +{ + struct pvrdma_cmd_query_qp *cmd =3D &req->query_qp; + struct pvrdma_cmd_query_qp_resp *resp =3D &rsp->query_qp_resp; + struct ibv_qp_init_attr init_attr; + + pr_dbg("qp_handle=3D%d\n", cmd->qp_handle); + + memset(rsp, 0, sizeof(*rsp)); + rsp->hdr.response =3D cmd->hdr.response; + rsp->hdr.ack =3D PVRDMA_CMD_QUERY_QP_RESP; + + rsp->hdr.err =3D rdma_rm_query_qp(&dev->rdma_dev_res, &dev->backend_de= v, + cmd->qp_handle, + (struct ibv_qp_attr *)&resp->attrs, -1, + &init_attr); + + pr_dbg("ret=3D%d\n", rsp->hdr.err); + return rsp->hdr.err; +} + static int destroy_qp(PVRDMADev *dev, union pvrdma_cmd_req *req, union pvrdma_cmd_resp *rsp) { @@ -636,7 +658,7 @@ static struct cmd_handler cmd_handlers[] =3D { {PVRDMA_CMD_DESTROY_CQ, destroy_cq}, {PVRDMA_CMD_CREATE_QP, create_qp}, {PVRDMA_CMD_MODIFY_QP, modify_qp}, - {PVRDMA_CMD_QUERY_QP, NULL}, + {PVRDMA_CMD_QUERY_QP, query_qp}, {PVRDMA_CMD_DESTROY_QP, destroy_qp}, {PVRDMA_CMD_CREATE_UC, create_uc}, {PVRDMA_CMD_DESTROY_UC, destroy_uc}, --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521820520385896.7191320496249; Fri, 23 Mar 2018 08:55:20 -0700 (PDT) Received: from localhost ([::1]:38673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP2F-0001UG-GW for importer@patchew.org; Fri, 23 Mar 2018 11:55:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0K-0008En-4N for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0I-0007f8-Nv for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54830 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0I-0007ez-Hw for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:18 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E39D40201A6; Fri, 23 Mar 2018 15:53:18 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAEAF2023233; Fri, 23 Mar 2018 15:53:15 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:01 +0300 Message-Id: <20180323155306.83812-4-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:18 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 3/8] rdma: fix up include directives 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Michael S. Tsirkin" Our rule right now is to use <> for external headers only. RDMA code violates that, fix it up. Signed-off-by: Michael S. Tsirkin Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marcel Apfelbaum Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 6 +++--- hw/rdma/rdma_backend.h | 2 +- hw/rdma/rdma_backend_defs.h | 2 +- hw/rdma/rdma_rm.c | 6 +++--- hw/rdma/rdma_rm.h | 2 +- hw/rdma/rdma_utils.h | 6 +++--- hw/rdma/vmw/pvrdma.h | 8 ++++---- hw/rdma/vmw/pvrdma_cmd.c | 8 ++++---- hw/rdma/vmw/pvrdma_dev_ring.c | 8 ++++---- hw/rdma/vmw/pvrdma_dev_ring.h | 2 +- hw/rdma/vmw/pvrdma_main.c | 24 ++++++++++++------------ hw/rdma/vmw/pvrdma_qp_ops.c | 4 ++-- 12 files changed, 39 insertions(+), 39 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 0beed77c27..57f40d99a3 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -13,9 +13,9 @@ * */ =20 -#include -#include -#include +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qapi/error.h" =20 #include =20 diff --git a/hw/rdma/rdma_backend.h b/hw/rdma/rdma_backend.h index 36218d1990..505cad7e0e 100644 --- a/hw/rdma/rdma_backend.h +++ b/hw/rdma/rdma_backend.h @@ -16,7 +16,7 @@ #ifndef RDMA_BACKEND_H #define RDMA_BACKEND_H =20 -#include +#include "qapi/error.h" #include "rdma_rm_defs.h" #include "rdma_backend_defs.h" =20 diff --git a/hw/rdma/rdma_backend_defs.h b/hw/rdma/rdma_backend_defs.h index 837e32419c..ff5cfc26eb 100644 --- a/hw/rdma/rdma_backend_defs.h +++ b/hw/rdma/rdma_backend_defs.h @@ -17,7 +17,7 @@ #define RDMA_BACKEND_DEFS_H =20 #include -#include +#include "qemu/thread.h" =20 typedef struct RdmaDeviceResources RdmaDeviceResources; =20 diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index 43f73adecf..6d88ac5d23 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -13,9 +13,9 @@ * */ =20 -#include -#include -#include +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "cpu.h" =20 #include "rdma_utils.h" #include "rdma_backend.h" diff --git a/hw/rdma/rdma_rm.h b/hw/rdma/rdma_rm.h index 0528c1972b..b4e04cc7b4 100644 --- a/hw/rdma/rdma_rm.h +++ b/hw/rdma/rdma_rm.h @@ -16,7 +16,7 @@ #ifndef RDMA_RM_H #define RDMA_RM_H =20 -#include +#include "qapi/error.h" #include "rdma_backend_defs.h" #include "rdma_rm_defs.h" =20 diff --git a/hw/rdma/rdma_utils.h b/hw/rdma/rdma_utils.h index cdac910e24..3dc07891bc 100644 --- a/hw/rdma/rdma_utils.h +++ b/hw/rdma/rdma_utils.h @@ -17,9 +17,9 @@ #ifndef RDMA_UTILS_H #define RDMA_UTILS_H =20 -#include -#include -#include +#include "qemu/osdep.h" +#include "hw/pci/pci.h" +#include "sysemu/dma.h" =20 #define pr_info(fmt, ...) \ fprintf(stdout, "%s: %-20s (%3d): " fmt, "pvrdma", __func__, __LINE__= ,\ diff --git a/hw/rdma/vmw/pvrdma.h b/hw/rdma/vmw/pvrdma.h index b05f94a473..8c173cb824 100644 --- a/hw/rdma/vmw/pvrdma.h +++ b/hw/rdma/vmw/pvrdma.h @@ -16,14 +16,14 @@ #ifndef PVRDMA_PVRDMA_H #define PVRDMA_PVRDMA_H =20 -#include -#include +#include "hw/pci/pci.h" +#include "hw/pci/msix.h" =20 #include "../rdma_backend_defs.h" #include "../rdma_rm_defs.h" =20 -#include -#include +#include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h" +#include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api= .h" #include "pvrdma_dev_ring.h" =20 /* BARs */ diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index cf8c50af31..0646f87ff2 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -13,9 +13,9 @@ * */ =20 -#include -#include -#include +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "cpu.h" #include #include "hw/hw.h" #include "hw/pci/pci.h" @@ -26,7 +26,7 @@ #include "../rdma_utils.h" =20 #include "pvrdma.h" -#include +#include "standard-headers/rdma/vmw_pvrdma-abi.h" =20 static void *pvrdma_map_to_pdir(PCIDevice *pdev, uint64_t pdir_dma, uint32_t nchunks, size_t length) diff --git a/hw/rdma/vmw/pvrdma_dev_ring.c b/hw/rdma/vmw/pvrdma_dev_ring.c index ec309dad55..ff19a9ea16 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.c +++ b/hw/rdma/vmw/pvrdma_dev_ring.c @@ -13,12 +13,12 @@ * */ =20 -#include -#include -#include +#include "qemu/osdep.h" +#include "hw/pci/pci.h" +#include "cpu.h" =20 #include "../rdma_utils.h" -#include +#include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_ring.h" #include "pvrdma_dev_ring.h" =20 int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, diff --git a/hw/rdma/vmw/pvrdma_dev_ring.h b/hw/rdma/vmw/pvrdma_dev_ring.h index 02a590b86d..2d0461f367 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.h +++ b/hw/rdma/vmw/pvrdma_dev_ring.h @@ -16,7 +16,7 @@ #ifndef PVRDMA_DEV_RING_H #define PVRDMA_DEV_RING_H =20 -#include +#include "qemu/typedefs.h" =20 #define MAX_RING_NAME_SZ 32 =20 diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 99787812ba..25ea02af62 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -13,16 +13,16 @@ * */ =20 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/hw.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_ids.h" +#include "hw/pci/msi.h" +#include "hw/pci/msix.h" +#include "hw/qdev-core.h" +#include "hw/qdev-properties.h" +#include "cpu.h" #include "trace.h" =20 #include "../rdma_rm.h" @@ -31,8 +31,8 @@ =20 #include #include "pvrdma.h" -#include -#include +#include "standard-headers/rdma/vmw_pvrdma-abi.h" +#include "standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api= .h" #include "pvrdma_qp_ops.h" =20 static Property pvrdma_dev_properties[] =3D { diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c index f0a1f9eb02..a693c06a11 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.c +++ b/hw/rdma/vmw/pvrdma_qp_ops.c @@ -13,14 +13,14 @@ * */ =20 -#include +#include "qemu/osdep.h" =20 #include "../rdma_utils.h" #include "../rdma_rm.h" #include "../rdma_backend.h" =20 #include "pvrdma.h" -#include +#include "standard-headers/rdma/vmw_pvrdma-abi.h" #include "pvrdma_qp_ops.h" =20 typedef struct CompHandlerCtx { --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15218205277641010.3134857891774; Fri, 23 Mar 2018 08:55:27 -0700 (PDT) Received: from localhost ([::1]:38674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP2M-0001bL-UL for importer@patchew.org; Fri, 23 Mar 2018 11:55:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0M-0008GL-O4 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0L-0007hP-Ep for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60836 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0L-0007gh-8v for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:21 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B54778182D2E; Fri, 23 Mar 2018 15:53:20 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 951C42023233; Fri, 23 Mar 2018 15:53:18 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:02 +0300 Message-Id: <20180323155306.83812-5-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 15:53:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 15:53:20 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 4/8] make: switch from -I to -iquote 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: "Michael S. Tsirkin" Our rule right now is to use <> for external headers, "" for internal ones. The idea was to avoid conflicts between e.g. a system file named and an internal one by the same name. Unfortunately we use -I compiler flag so it does not help: a system file doing #include will still pick up ours first. To fix, switch to -iquote which is supported by both gcc and clang and only affects #include "" directives. As a side effect, this catches any future uses of #include <> for internal headers. Suggested-by: Stefan Weil Signed-off-by: Michael S. Tsirkin Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Marcel Apfelbaum Signed-off-by: Marcel Apfelbaum --- Makefile.target | 4 ++-- configure | 16 ++++++++-------- rules.mak | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.target b/Makefile.target index 6549481096..d0ec77a307 100644 --- a/Makefile.target +++ b/Makefile.target @@ -11,9 +11,9 @@ $(call set-vpath, $(SRC_PATH):$(BUILD_DIR)) ifdef CONFIG_LINUX QEMU_CFLAGS +=3D -I../linux-headers endif -QEMU_CFLAGS +=3D -I.. -I$(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H +QEMU_CFLAGS +=3D -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH)= -DNEED_CPU_H =20 -QEMU_CFLAGS+=3D-I$(SRC_PATH)/include +QEMU_CFLAGS+=3D-iquote $(SRC_PATH)/include =20 ifdef CONFIG_USER_ONLY # user emulator name diff --git a/configure b/configure index f156805981..8376cb151a 100755 --- a/configure +++ b/configure @@ -534,7 +534,7 @@ QEMU_CFLAGS=3D"-fno-strict-aliasing -fno-common -fwrapv= $QEMU_CFLAGS" QEMU_CFLAGS=3D"-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CF= LAGS" QEMU_CFLAGS=3D"-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS=3D"-D_GNU_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE = $QEMU_CFLAGS" -QEMU_INCLUDES=3D"-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/accel/tcg -I\$(SRC_PATH= )/include" +QEMU_INCLUDES=3D"-iquote . -iquote \$(SRC_PATH) -iquote \$(SRC_PATH)/accel= /tcg -iquote \$(SRC_PATH)/include" if test "$debug_info" =3D "yes"; then CFLAGS=3D"-g $CFLAGS" LDFLAGS=3D"-g $LDFLAGS" @@ -6600,19 +6600,19 @@ if test "$vxhs" =3D "yes" ; then fi =20 if test "$tcg_interpreter" =3D "yes"; then - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" elif test "$ARCH" =3D "sparc64" ; then - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" elif test "$ARCH" =3D "s390x" ; then - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" elif test "$ARCH" =3D "x86_64" -o "$ARCH" =3D "x32" ; then - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" elif test "$ARCH" =3D "ppc64" ; then - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" else - QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" + QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" fi -QEMU_INCLUDES=3D"-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" +QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg $QEMU_INCLUDES" =20 echo "TOOLS=3D$tools" >> $config_host_mak echo "ROMS=3D$roms" >> $config_host_mak diff --git a/rules.mak b/rules.mak index 6e943335f3..93a07027b0 100644 --- a/rules.mak +++ b/rules.mak @@ -29,7 +29,7 @@ QEMU_DGFLAGS +=3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d # dir, one absolute and the other relative to the compiler working # directory. These are the same for target-independent files, but # different for target-dependent ones. -QEMU_LOCAL_INCLUDES =3D -I$(BUILD_DIR)/$(@D) -I$(@D) +QEMU_LOCAL_INCLUDES =3D -iquote $(BUILD_DIR)/$(@D) -iquote $(@D) =20 WL_U :=3D -Wl,-u, find-symbols =3D $(if $1, $(sort $(shell $(NM) -P -g $1 | $2))) --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521820959241555.8468553861778; Fri, 23 Mar 2018 09:02:39 -0700 (PDT) Received: from localhost ([::1]:38782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP9J-0008TX-VA for importer@patchew.org; Fri, 23 Mar 2018 12:02:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0R-0008Rb-SY for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0N-0007jR-Su for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60842 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0N-0007im-Mq for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3AC648151D46; Fri, 23 Mar 2018 15:53:23 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 195A82023233; Fri, 23 Mar 2018 15:53:20 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:03 +0300 Message-Id: <20180323155306.83812-6-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 15:53:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 23 Mar 2018 15:53:23 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 5/8] hw/rdma: fix clang compilation errors 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fix some enum castings and extra parentheses. Reported-by: Michael S. Tsirkin Signed-off-by: Marcel Apfelbaum Message-Id: <20180321140316.96045-1-marcel@redhat.com> Reviewed-by: Yuval Shaia --- hw/rdma/vmw/pvrdma_cmd.c | 5 +++-- hw/rdma/vmw/pvrdma_main.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index 0646f87ff2..5bd4643f2d 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -73,7 +73,7 @@ static void *pvrdma_map_to_pdir(PCIDevice *pdev, uint64_t= pdir_dma, tbl_idx =3D 1; addr_idx =3D 1; while (addr_idx < nchunks) { - if ((tbl_idx =3D=3D (TARGET_PAGE_SIZE / sizeof(uint64_t)))) { + if (tbl_idx =3D=3D TARGET_PAGE_SIZE / sizeof(uint64_t)) { tbl_idx =3D 0; dir_idx++; pr_dbg("Mapping to table %d\n", dir_idx); @@ -507,7 +507,8 @@ static int modify_qp(PVRDMADev *dev, union pvrdma_cmd_r= eq *req, rsp->hdr.err =3D rdma_rm_modify_qp(&dev->rdma_dev_res, &dev->backend_d= ev, cmd->qp_handle, cmd->attr_mask, (union ibv_gid *)&cmd->attrs.ah_attr.grh.= dgid, - cmd->attrs.dest_qp_num, cmd->attrs.qp_sta= te, + cmd->attrs.dest_qp_num, + (enum ibv_qp_state)cmd->attrs.qp_state, cmd->attrs.qkey, cmd->attrs.rq_psn, cmd->attrs.sq_psn); =20 diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 25ea02af62..44de6a4a29 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -91,7 +91,7 @@ static int init_dev_ring(PvrdmaRing *ring, struct pvrdma_= ring **ring_state, goto out_free_tbl; } /* RX ring is the second */ - (struct pvrdma_ring *)(*ring_state)++; + (*ring_state)++; rc =3D pvrdma_ring_init(ring, name, pci_dev, (struct pvrdma_ring *)*ring_state, (num_pages - 1) * TARGET_PAGE_SIZE / @@ -292,7 +292,7 @@ static void init_ports(PVRDMADev *dev, Error **errp) memset(dev->rdma_dev_res.ports, 0, sizeof(dev->rdma_dev_res.ports)); =20 for (i =3D 0; i < MAX_PORTS; i++) { - dev->rdma_dev_res.ports[i].state =3D PVRDMA_PORT_DOWN; + dev->rdma_dev_res.ports[i].state =3D IBV_PORT_DOWN; =20 dev->rdma_dev_res.ports[i].pkey_tbl =3D g_malloc0(sizeof(*dev->rdma_dev_res.ports[i].pkey_tbl) * --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521820531857417.8017675462846; Fri, 23 Mar 2018 08:55:31 -0700 (PDT) Received: from localhost ([::1]:38675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP2Q-0001ek-Cy for importer@patchew.org; Fri, 23 Mar 2018 11:55:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0R-0008RX-S7 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0Q-0007pJ-Gt for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56326 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0Q-0007og-B6 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:26 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C74D8406F96D; Fri, 23 Mar 2018 15:53:25 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 935E12023233; Fri, 23 Mar 2018 15:53:23 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:04 +0300 Message-Id: <20180323155306.83812-7-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 23 Mar 2018 15:53:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 23 Mar 2018 15:53:25 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 6/8] hw/rdma: Change host_virt to void * 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Yuval Shaia To avoid compilation warnings on 32-bit machines: rdma_backend.c: In function 'rdma_backend_create_mr': rdma_backend.c:409:37: error: cast to pointer from integer of different size [-Werror=3Dint-to-pointer-cast] mr->ibmr =3D ibv_reg_mr(pd->ibpd, (void *)addr, length, access); Reported-by: Eric Blake Signed-off-by: Yuval Shaia Reviewed-by: Eric Blake Tested-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180322095220.9976-2-yuval.shaia@oracle.com> Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 8 ++++---- hw/rdma/rdma_backend.h | 2 +- hw/rdma/rdma_rm.c | 10 +++++----- hw/rdma/rdma_rm_defs.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 57f40d99a3..b1d2913b2c 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -222,7 +222,7 @@ static int build_host_sge_array(RdmaDeviceResources *rd= ma_dev_res, return VENDOR_ERR_INVLKEY | ssge[ssge_idx].lkey; } =20 - dsge->addr =3D mr->user_mr.host_virt + ssge[ssge_idx].addr - + dsge->addr =3D (uintptr_t)mr->user_mr.host_virt + ssge[ssge_idx].a= ddr - mr->user_mr.guest_start; dsge->length =3D ssge[ssge_idx].length; dsge->lkey =3D rdma_backend_mr_lkey(&mr->backend_mr); @@ -401,12 +401,12 @@ void rdma_backend_destroy_pd(RdmaBackendPD *pd) } } =20 -int rdma_backend_create_mr(RdmaBackendMR *mr, RdmaBackendPD *pd, uint64_t = addr, +int rdma_backend_create_mr(RdmaBackendMR *mr, RdmaBackendPD *pd, void *add= r, size_t length, int access) { - pr_dbg("addr=3D0x%lx\n", addr); + pr_dbg("addr=3D0x%p\n", addr); pr_dbg("len=3D%ld\n", length); - mr->ibmr =3D ibv_reg_mr(pd->ibpd, (void *)addr, length, access); + mr->ibmr =3D ibv_reg_mr(pd->ibpd, addr, length, access); if (mr->ibmr) { pr_dbg("lkey=3D0x%x\n", mr->ibmr->lkey); pr_dbg("rkey=3D0x%x\n", mr->ibmr->rkey); diff --git a/hw/rdma/rdma_backend.h b/hw/rdma/rdma_backend.h index 505cad7e0e..3cd636dd88 100644 --- a/hw/rdma/rdma_backend.h +++ b/hw/rdma/rdma_backend.h @@ -61,7 +61,7 @@ int rdma_backend_query_port(RdmaBackendDev *backend_dev, int rdma_backend_create_pd(RdmaBackendDev *backend_dev, RdmaBackendPD *pd); void rdma_backend_destroy_pd(RdmaBackendPD *pd); =20 -int rdma_backend_create_mr(RdmaBackendMR *mr, RdmaBackendPD *pd, uint64_t = addr, +int rdma_backend_create_mr(RdmaBackendMR *mr, RdmaBackendPD *pd, void *add= r, size_t length, int access); void rdma_backend_destroy_mr(RdmaBackendMR *mr); =20 diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index 6d88ac5d23..b4938169b6 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -146,7 +146,7 @@ int rdma_rm_alloc_mr(RdmaDeviceResources *dev_res, uint= 32_t pd_handle, RdmaRmMR *mr; int ret =3D 0; RdmaRmPD *pd; - uint64_t addr; + void *addr; size_t length; =20 pd =3D rdma_rm_get_pd(dev_res, pd_handle); @@ -165,10 +165,10 @@ int rdma_rm_alloc_mr(RdmaDeviceResources *dev_res, ui= nt32_t pd_handle, /* TODO: This is my guess but not so sure that this needs to be * done */ length =3D TARGET_PAGE_SIZE; - addr =3D (uint64_t)g_malloc(length); + addr =3D g_malloc(length); } else { - mr->user_mr.host_virt =3D (uint64_t) host_virt; - pr_dbg("host_virt=3D0x%lx\n", mr->user_mr.host_virt); + mr->user_mr.host_virt =3D host_virt; + pr_dbg("host_virt=3D0x%p\n", mr->user_mr.host_virt); mr->user_mr.length =3D guest_length; pr_dbg("length=3D0x%lx\n", guest_length); mr->user_mr.guest_start =3D guest_start; @@ -216,7 +216,7 @@ void rdma_rm_dealloc_mr(RdmaDeviceResources *dev_res, u= int32_t mr_handle) =20 if (mr) { rdma_backend_destroy_mr(&mr->backend_mr); - munmap((void *)mr->user_mr.host_virt, mr->user_mr.length); + munmap(mr->user_mr.host_virt, mr->user_mr.length); res_tbl_dealloc(&dev_res->mr_tbl, mr_handle); } } diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h index 6522dca68f..fc646da61f 100644 --- a/hw/rdma/rdma_rm_defs.h +++ b/hw/rdma/rdma_rm_defs.h @@ -56,7 +56,7 @@ typedef struct RdmaRmCQ { } RdmaRmCQ; =20 typedef struct RdmaRmUserMR { - uint64_t host_virt; + void *host_virt; uint64_t guest_start; size_t length; } RdmaRmUserMR; --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521820684436550.8699136801354; Fri, 23 Mar 2018 08:58:04 -0700 (PDT) Received: from localhost ([::1]:38690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP4t-0003zb-8R for importer@patchew.org; Fri, 23 Mar 2018 11:58:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0T-00005i-J0 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0S-0007rK-O4 for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54836 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0S-0007qu-Jr for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AAEC40201A6; Fri, 23 Mar 2018 15:53:28 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A4982023233; Fri, 23 Mar 2018 15:53:25 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:05 +0300 Message-Id: <20180323155306.83812-8-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 23 Mar 2018 15:53:28 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 7/8] hw/rdma: Use correct print format in CHK_ATTR macro 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Yuval Shaia Macro should not cast the given variable to u64 instead it should use the supplied format argument (fmt). Reported-by: Eric Blake Signed-off-by: Yuval Shaia Reviewed-by: Eric Blake Tested-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180322095220.9976-3-yuval.shaia@oracle.com> Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index b1d2913b2c..1dbb17bd2e 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -668,8 +668,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp) #define CHK_ATTR(req, dev, member, fmt) ({ \ pr_dbg("%s=3D"fmt","fmt"\n", #member, dev.member, req->member); \ if (req->member > dev.member) { \ - warn_report("%s =3D 0x%lx is higher than host device capability 0x= %lx", \ - #member, (uint64_t)req->member, (uint64_t)dev.member);= \ + warn_report("%s =3D "fmt" is higher than host device capability "f= mt, \ + #member, req->member, dev.member); \ req->member =3D dev.member; \ } \ pr_dbg("%s=3D"fmt"\n", #member, req->member); }) --=20 2.13.5 From nobody Sat Apr 27 23:48:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152182069987085.82503337558103; Fri, 23 Mar 2018 08:58:19 -0700 (PDT) Received: from localhost ([::1]:38692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP58-0004CX-Lx for importer@patchew.org; Fri, 23 Mar 2018 11:58:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezP0X-0000Hj-Bi for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezP0V-0007vS-Hu for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53476 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ezP0V-0007us-Bb for qemu-devel@nongnu.org; Fri, 23 Mar 2018 11:53:31 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C26D0BD87; Fri, 23 Mar 2018 15:53:30 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-21.ams2.redhat.com [10.36.116.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71D472023233; Fri, 23 Mar 2018 15:53:28 +0000 (UTC) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Fri, 23 Mar 2018 18:53:06 +0300 Message-Id: <20180323155306.83812-9-marcel@redhat.com> In-Reply-To: <20180323155306.83812-1-marcel@redhat.com> References: <20180323155306.83812-1-marcel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 23 Mar 2018 15:53:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 23 Mar 2018 15:53:30 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'marcel@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH PULL 8/8] hw/rdma: Fix 32-bit compilation 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: , Cc: peter.maydell@linaro.org, mst@redhat.com, f4bug@amsat.org, yuval.shaia@oracle.com, stefanha@redhat.com, marcel@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Yuval Shaia Use the correct printf formats, so that a 32-bit compile doesn't spit out lots of warnings about %lx being incompatible with uint64_t. Suggested-by: Eric Blake Signed-off-by: Yuval Shaia Reviewed-by: Eric Blake Tested-by: Eric Blake Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180322095220.9976-4-yuval.shaia@oracle.com> Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_backend.c | 21 +++++++++++---------- hw/rdma/rdma_rm.c | 4 ++-- hw/rdma/rdma_utils.c | 6 +++--- hw/rdma/vmw/pvrdma_cmd.c | 8 ++++---- hw/rdma/vmw/pvrdma_dev_ring.c | 6 +++--- hw/rdma/vmw/pvrdma_dev_ring.h | 2 +- hw/rdma/vmw/pvrdma_main.c | 25 +++++++++++++------------ hw/rdma/vmw/pvrdma_qp_ops.c | 6 +++--- 8 files changed, 40 insertions(+), 38 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 1dbb17bd2e..5c7b3d8949 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -62,12 +62,13 @@ static void poll_cq(RdmaDeviceResources *rdma_dev_res, = struct ibv_cq *ibcq) pr_dbg("Got %d completion(s) from cq %p\n", ne, ibcq); =20 for (i =3D 0; i < ne; i++) { - pr_dbg("wr_id=3D0x%lx\n", wc[i].wr_id); + pr_dbg("wr_id=3D0x%" PRIx64 "\n", wc[i].wr_id); pr_dbg("status=3D%d\n", wc[i].status); =20 bctx =3D rdma_rm_get_cqe_ctx(rdma_dev_res, wc[i].wr_id); if (unlikely(!bctx)) { - pr_dbg("Error: Failed to find ctx for req %ld\n", wc[i].wr= _id); + pr_dbg("Error: Failed to find ctx for req %" PRId64 "\n", + wc[i].wr_id); continue; } pr_dbg("Processing %s CQE\n", bctx->is_tx_req ? "send" : "recv= "); @@ -176,7 +177,7 @@ static struct ibv_ah *create_ah(RdmaBackendDev *backend= _dev, struct ibv_pd *pd, g_hash_table_insert(ah_hash, ah_key, ah); } else { g_bytes_unref(ah_key); - pr_dbg("ibv_create_ah failed for gid <%lx %lx>\n", + pr_dbg("Fail to create AH for gid <0x%" PRIx64 ", 0x%" PRIx64 = ">\n", be64_to_cpu(dgid->global.subnet_prefix), be64_to_cpu(dgid->global.interface_id)); } @@ -227,8 +228,8 @@ static int build_host_sge_array(RdmaDeviceResources *rd= ma_dev_res, dsge->length =3D ssge[ssge_idx].length; dsge->lkey =3D rdma_backend_mr_lkey(&mr->backend_mr); =20 - pr_dbg("ssge->addr=3D0x%lx\n", (uint64_t)ssge[ssge_idx].addr); - pr_dbg("dsge->addr=3D0x%lx\n", dsge->addr); + pr_dbg("ssge->addr=3D0x%" PRIx64 "\n", ssge[ssge_idx].addr); + pr_dbg("dsge->addr=3D0x%" PRIx64 "\n", dsge->addr); pr_dbg("dsge->length=3D%d\n", dsge->length); pr_dbg("dsge->lkey=3D0x%x\n", dsge->lkey); =20 @@ -405,7 +406,7 @@ int rdma_backend_create_mr(RdmaBackendMR *mr, RdmaBacke= ndPD *pd, void *addr, size_t length, int access) { pr_dbg("addr=3D0x%p\n", addr); - pr_dbg("len=3D%ld\n", length); + pr_dbg("len=3D%zu\n", length); mr->ibmr =3D ibv_reg_mr(pd->ibpd, addr, length, access); if (mr->ibmr) { pr_dbg("lkey=3D0x%x\n", mr->ibmr->lkey); @@ -562,7 +563,7 @@ int rdma_backend_qp_state_rtr(RdmaBackendDev *backend_d= ev, RdmaBackendQP *qp, =20 switch (qp_type) { case IBV_QPT_RC: - pr_dbg("dgid=3D0x%lx,%lx\n", + pr_dbg("dgid=3D0x%" PRIx64 ",%" PRIx64 "\n", be64_to_cpu(ibv_gid.global.subnet_prefix), be64_to_cpu(ibv_gid.global.interface_id)); pr_dbg("dqpn=3D0x%x\n", dqpn); @@ -681,7 +682,7 @@ static int init_device_caps(RdmaBackendDev *backend_dev, return -EIO; } =20 - CHK_ATTR(dev_attr, backend_dev->dev_attr, max_mr_size, "%ld"); + CHK_ATTR(dev_attr, backend_dev->dev_attr, max_mr_size, "%" PRId64); CHK_ATTR(dev_attr, backend_dev->dev_attr, max_qp, "%d"); CHK_ATTR(dev_attr, backend_dev->dev_attr, max_sge, "%d"); CHK_ATTR(dev_attr, backend_dev->dev_attr, max_qp_wr, "%d"); @@ -794,9 +795,9 @@ int rdma_backend_init(RdmaBackendDev *backend_dev, ret =3D -EIO; goto out_destroy_comm_channel; } - pr_dbg("subnet_prefix=3D0x%lx\n", + pr_dbg("subnet_prefix=3D0x%" PRIx64 "\n", be64_to_cpu(backend_dev->gid.global.subnet_prefix)); - pr_dbg("interface_id=3D0x%lx\n", + pr_dbg("interface_id=3D0x%" PRIx64 "\n", be64_to_cpu(backend_dev->gid.global.interface_id)); =20 snprintf(thread_name, sizeof(thread_name), "rdma_comp_%s", diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index b4938169b6..51a47d7292 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -170,9 +170,9 @@ int rdma_rm_alloc_mr(RdmaDeviceResources *dev_res, uint= 32_t pd_handle, mr->user_mr.host_virt =3D host_virt; pr_dbg("host_virt=3D0x%p\n", mr->user_mr.host_virt); mr->user_mr.length =3D guest_length; - pr_dbg("length=3D0x%lx\n", guest_length); + pr_dbg("length=3D%zu\n", guest_length); mr->user_mr.guest_start =3D guest_start; - pr_dbg("guest_start=3D0x%lx\n", mr->user_mr.guest_start); + pr_dbg("guest_start=3D0x%" PRIx64 "\n", mr->user_mr.guest_start); =20 length =3D mr->user_mr.length; addr =3D mr->user_mr.host_virt; diff --git a/hw/rdma/rdma_utils.c b/hw/rdma/rdma_utils.c index 0e5caffd40..d713f635f1 100644 --- a/hw/rdma/rdma_utils.c +++ b/hw/rdma/rdma_utils.c @@ -27,8 +27,8 @@ void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, d= ma_addr_t plen) =20 p =3D pci_dma_map(dev, addr, &len, DMA_DIRECTION_TO_DEVICE); if (!p) { - pr_dbg("Fail in pci_dma_map, addr=3D0x%llx, len=3D%ld\n", - (long long unsigned int)addr, len); + pr_dbg("Fail in pci_dma_map, addr=3D0x%" PRIx64 ", len=3D%" PRId64= "\n", + addr, len); return NULL; } =20 @@ -37,7 +37,7 @@ void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, d= ma_addr_t plen) return NULL; } =20 - pr_dbg("0x%llx -> %p (len=3D%ld)\n", (long long unsigned int)addr, p, = len); + pr_dbg("0x%" PRIx64 " -> %p (len=3D% " PRId64 ")\n", addr, p, len); =20 return p; } diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c index 5bd4643f2d..99019d8741 100644 --- a/hw/rdma/vmw/pvrdma_cmd.c +++ b/hw/rdma/vmw/pvrdma_cmd.c @@ -85,7 +85,7 @@ static void *pvrdma_map_to_pdir(PCIDevice *pdev, uint64_t= pdir_dma, } } =20 - pr_dbg("guest_dma[%d]=3D0x%lx\n", addr_idx, tbl[tbl_idx]); + pr_dbg("guest_dma[%d]=3D0x%" PRIx64 "\n", addr_idx, tbl[tbl_idx]); =20 curr_page =3D rdma_pci_dma_map(pdev, (dma_addr_t)tbl[tbl_idx], TARGET_PAGE_SIZE); @@ -285,7 +285,7 @@ static int create_cq_ring(PCIDevice *pci_dev , PvrdmaRi= ng **ring, goto out_free_ring; } =20 - sprintf(ring_name, "cq_ring_%lx", pdir_dma); + sprintf(ring_name, "cq_ring_%" PRIx64, pdir_dma); rc =3D pvrdma_ring_init(r, ring_name, pci_dev, &r->ring_state[1], cqe, sizeof(struct pvrdma_cqe), /* first page is ring state */ @@ -415,7 +415,7 @@ static int create_qp_rings(PCIDevice *pci_dev, uint64_t= pdir_dma, wqe_sz =3D pow2ceil(sizeof(struct pvrdma_sq_wqe_hdr) + sizeof(struct pvrdma_sge) * smax_sge - 1); =20 - sprintf(ring_name, "qp_sring_%lx", pdir_dma); + sprintf(ring_name, "qp_sring_%" PRIx64, pdir_dma); rc =3D pvrdma_ring_init(sr, ring_name, pci_dev, sr->ring_state, scqe, wqe_sz, (dma_addr_t *)&tbl[1], spages); if (rc) { @@ -426,7 +426,7 @@ static int create_qp_rings(PCIDevice *pci_dev, uint64_t= pdir_dma, rr->ring_state =3D &sr->ring_state[1]; wqe_sz =3D pow2ceil(sizeof(struct pvrdma_rq_wqe_hdr) + sizeof(struct pvrdma_sge) * rmax_sge - 1); - sprintf(ring_name, "qp_rring_%lx", pdir_dma); + sprintf(ring_name, "qp_rring_%" PRIx64, pdir_dma); rc =3D pvrdma_ring_init(rr, ring_name, pci_dev, rr->ring_state, rcqe, wqe_sz, (dma_addr_t *)&tbl[1 + spages], rp= ages); if (rc) { diff --git a/hw/rdma/vmw/pvrdma_dev_ring.c b/hw/rdma/vmw/pvrdma_dev_ring.c index ff19a9ea16..01247fc041 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.c +++ b/hw/rdma/vmw/pvrdma_dev_ring.c @@ -23,7 +23,7 @@ =20 int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, struct pvrdma_ring *ring_state, uint32_t max_elems, - size_t elem_sz, dma_addr_t *tbl, dma_addr_t npages) + size_t elem_sz, dma_addr_t *tbl, uint32_t npages) { int i; int rc =3D 0; @@ -35,8 +35,8 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, = PCIDevice *dev, ring->ring_state =3D ring_state; ring->max_elems =3D max_elems; ring->elem_sz =3D elem_sz; - pr_dbg("ring->elem_sz=3D%ld\n", ring->elem_sz); - pr_dbg("npages=3D%ld\n", npages); + pr_dbg("ring->elem_sz=3D%zu\n", ring->elem_sz); + pr_dbg("npages=3D%d\n", npages); /* TODO: Give a moment to think if we want to redo driver settings atomic_set(&ring->ring_state->prod_tail, 0); atomic_set(&ring->ring_state->cons_head, 0); diff --git a/hw/rdma/vmw/pvrdma_dev_ring.h b/hw/rdma/vmw/pvrdma_dev_ring.h index 2d0461f367..411d244603 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.h +++ b/hw/rdma/vmw/pvrdma_dev_ring.h @@ -32,7 +32,7 @@ typedef struct PvrdmaRing { =20 int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, struct pvrdma_ring *ring_state, uint32_t max_elems, - size_t elem_sz, dma_addr_t *tbl, dma_addr_t npages); + size_t elem_sz, dma_addr_t *tbl, uint32_t npages); void *pvrdma_ring_next_elem_read(PvrdmaRing *ring); void pvrdma_ring_read_inc(PvrdmaRing *ring); void *pvrdma_ring_next_elem_write(PvrdmaRing *ring); diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 44de6a4a29..c552248c90 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -236,7 +236,7 @@ static void init_dsr_dev_caps(PVRDMADev *dev) dsr =3D dev->dsr_info.dsr; =20 dsr->caps.fw_ver =3D PVRDMA_FW_VERSION; - pr_dbg("fw_ver=3D0x%lx\n", dsr->caps.fw_ver); + pr_dbg("fw_ver=3D0x%" PRIx64 "\n", dsr->caps.fw_ver); =20 dsr->caps.mode =3D PVRDMA_DEVICE_MODE_ROCE; pr_dbg("mode=3D%d\n", dsr->caps.mode); @@ -261,11 +261,10 @@ static void init_dsr_dev_caps(PVRDMADev *dev) pr_dbg("gid_tbl_len=3D%d\n", dsr->caps.gid_tbl_len); =20 dsr->caps.sys_image_guid =3D 0; - pr_dbg("sys_image_guid=3D%lx\n", dsr->caps.sys_image_guid); + pr_dbg("sys_image_guid=3D%" PRIx64 "\n", dsr->caps.sys_image_guid); =20 dsr->caps.node_guid =3D cpu_to_be64(dev->node_guid); - pr_dbg("node_guid=3D%llx\n", - (long long unsigned int)be64_to_cpu(dsr->caps.node_guid)); + pr_dbg("node_guid=3D%" PRIx64 "\n", be64_to_cpu(dsr->caps.node_guid)); =20 dsr->caps.phys_port_cnt =3D MAX_PORTS; pr_dbg("phys_port_cnt=3D%d\n", dsr->caps.phys_port_cnt); @@ -343,8 +342,8 @@ static void regs_write(void *opaque, hwaddr addr, uint6= 4_t val, unsigned size) /* pr_dbg("addr=3D0x%lx, val=3D0x%x, size=3D%d\n", addr, (uint32_t)val= , size); */ =20 if (set_reg_val(dev, addr, val)) { - pr_err("Error trying to set REG value, addr=3D0x%lx, val=3D0x%lx\n= ", - (uint64_t)addr, val); + pr_err("Fail to set REG value, addr=3D0x%" PRIx64 ", val=3D0x%" PR= Ix64 "\n", + addr, val); return; } =20 @@ -373,7 +372,7 @@ static void regs_write(void *opaque, hwaddr addr, uint6= 4_t val, unsigned size) } break; case PVRDMA_REG_IMR: - pr_dbg("Interrupt mask=3D0x%lx\n", val); + pr_dbg("Interrupt mask=3D0x%" PRIx64 "\n", val); dev->interrupt_mask =3D val; break; case PVRDMA_REG_REQUEST: @@ -404,7 +403,8 @@ static void uar_write(void *opaque, hwaddr addr, uint64= _t val, unsigned size) =20 switch (addr & 0xFFF) { /* Mask with 0xFFF as each UC gets page */ case PVRDMA_UAR_QP_OFFSET: - pr_dbg("UAR QP command, addr=3D0x%x, val=3D0x%lx\n", (uint32_t)add= r, val); + pr_dbg("UAR QP command, addr=3D0x%" PRIx64 ", val=3D0x%" PRIx64 "\= n", + (uint64_t)addr, val); if (val & PVRDMA_UAR_QP_SEND) { pvrdma_qp_send(dev, val & PVRDMA_UAR_HANDLE_MASK); } @@ -420,16 +420,17 @@ static void uar_write(void *opaque, hwaddr addr, uint= 64_t val, unsigned size) !!(val & PVRDMA_UAR_CQ_ARM_SOL)); } if (val & PVRDMA_UAR_CQ_ARM_SOL) { - pr_dbg("UAR_CQ_ARM_SOL (%ld)\n", val & PVRDMA_UAR_HANDLE_MASK); + pr_dbg("UAR_CQ_ARM_SOL (%" PRIx64 ")\n", + val & PVRDMA_UAR_HANDLE_MASK); } if (val & PVRDMA_UAR_CQ_POLL) { - pr_dbg("UAR_CQ_POLL (%ld)\n", val & PVRDMA_UAR_HANDLE_MASK); + pr_dbg("UAR_CQ_POLL (%" PRIx64 ")\n", val & PVRDMA_UAR_HANDLE_= MASK); pvrdma_cq_poll(&dev->rdma_dev_res, val & PVRDMA_UAR_HANDLE_MAS= K); } break; default: - pr_err("Unsupported command, addr=3D0x%lx, val=3D0x%lx\n", - (uint64_t)addr, val); + pr_err("Unsupported command, addr=3D0x%" PRIx64 ", val=3D0x%" PRIx= 64 "\n", + addr, val); break; } } diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c index a693c06a11..750ade6c31 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.c +++ b/hw/rdma/vmw/pvrdma_qp_ops.c @@ -102,7 +102,7 @@ static void pvrdma_qp_ops_comp_handler(int status, unsi= gned int vendor_err, CompHandlerCtx *comp_ctx =3D (CompHandlerCtx *)ctx; =20 pr_dbg("cq_handle=3D%d\n", comp_ctx->cq_handle); - pr_dbg("wr_id=3D%ld\n", comp_ctx->cqe.wr_id); + pr_dbg("wr_id=3D%" PRIx64 "\n", comp_ctx->cqe.wr_id); pr_dbg("status=3D%d\n", status); pr_dbg("vendor_err=3D0x%x\n", vendor_err); comp_ctx->cqe.status =3D status; @@ -143,7 +143,7 @@ int pvrdma_qp_send(PVRDMADev *dev, uint32_t qp_handle) while (wqe) { CompHandlerCtx *comp_ctx; =20 - pr_dbg("wr_id=3D%ld\n", wqe->hdr.wr_id); + pr_dbg("wr_id=3D%" PRIx64 "\n", wqe->hdr.wr_id); =20 /* Prepare CQE */ comp_ctx =3D g_malloc(sizeof(CompHandlerCtx)); @@ -187,7 +187,7 @@ int pvrdma_qp_recv(PVRDMADev *dev, uint32_t qp_handle) while (wqe) { CompHandlerCtx *comp_ctx; =20 - pr_dbg("wr_id=3D%ld\n", wqe->hdr.wr_id); + pr_dbg("wr_id=3D%" PRIx64 "\n", wqe->hdr.wr_id); =20 /* Prepare CQE */ comp_ctx =3D g_malloc(sizeof(CompHandlerCtx)); --=20 2.13.5