From nobody Thu Nov 6 19:43:57 2025 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542890042810819.5623734016311; Thu, 22 Nov 2018 04:34:02 -0800 (PST) Received: from localhost ([::1]:45543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPoBA-0000QH-MB for importer@patchew.org; Thu, 22 Nov 2018 07:33:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPntp-0000O3-Gs for qemu-devel@nongnu.org; Thu, 22 Nov 2018 07:16:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPnsL-0007y3-8q for qemu-devel@nongnu.org; Thu, 22 Nov 2018 07:14:35 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:57200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gPnsL-0007t3-0B for qemu-devel@nongnu.org; Thu, 22 Nov 2018 07:14:29 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wAMCE1tT027037; Thu, 22 Nov 2018 12:14:26 GMT Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2ntbmqxhpf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Nov 2018 12:14:26 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wAMCEKUZ031372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Nov 2018 12:14:20 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wAMCEJjR009025; Thu, 22 Nov 2018 12:14:20 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Nov 2018 04:14:19 -0800 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=alwWU6gNwr0kHeqiYfaHXj7SlqfLYrB8DJ+fgx2smJg=; b=T2zjWGN1RarBdB/w3MGvyhOksSKScukg+l2h/fW1DNNiXZLu9TnOepKeLkB4mr9gRXLF dGD/F6TTeV3CnPUImKjLw9fJDZ4Zdpf4K0LTmUdmWEE8TssnTTWRSuaq8sQPWLDRM3iG ori2xBzu4r2T5vqnEjU92re/bkD/eCMZ9XVCbQj1Y4eLh/4RTL+mH04CCqLhg1UXuS7h cJj5Gr4WMKE/XU17KC4AZw1KaQscLDpuru2xgcUZf1o3Jno+/Qi1I3gMs7sWx7zC3oX2 qsrM+Fsi0x13Tu7as0+w1Lj9W6wzR50oZgNV8CRINsmss1L3q2EevR8CIKMClI3chYEh CA== From: Yuval Shaia To: yuval.shaia@oracle.com, marcel.apfelbaum@gmail.com, dmitry.fleytman@gmail.com, jasowang@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, shamir.rabinovitch@oracle.com, cohuck@redhat.com Date: Thu, 22 Nov 2018 14:13:40 +0200 Message-Id: <20181122121402.13764-3-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181122121402.13764-1-yuval.shaia@oracle.com> References: <20181122121402.13764-1-yuval.shaia@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9084 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=547 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811220111 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [PATCH v5 02/24] hw/rdma: Add ability to force notification without re-arm 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Upon completion of incoming packet the device pushes CQE to driver's RX ring and notify the driver (msix). While for data-path incoming packets the driver needs the ability to control whether it wished to receive interrupts or not, for control-path packets such as incoming MAD the driver needs to be notified anyway, it even do not need to re-arm the notification bit. Enhance the notification field to support this. Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum --- hw/rdma/rdma_rm.c | 12 ++++++++++-- hw/rdma/rdma_rm_defs.h | 8 +++++++- hw/rdma/vmw/pvrdma_qp_ops.c | 6 ++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index 8d59a42cd1..4f10fcabcc 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -263,7 +263,7 @@ int rdma_rm_alloc_cq(RdmaDeviceResources *dev_res, Rdma= BackendDev *backend_dev, } =20 cq->opaque =3D opaque; - cq->notify =3D false; + cq->notify =3D CNT_CLEAR; =20 rc =3D rdma_backend_create_cq(backend_dev, &cq->backend_cq, cqe); if (rc) { @@ -291,7 +291,10 @@ void rdma_rm_req_notify_cq(RdmaDeviceResources *dev_re= s, uint32_t cq_handle, return; } =20 - cq->notify =3D notify; + if (cq->notify !=3D CNT_SET) { + cq->notify =3D notify ? CNT_ARM : CNT_CLEAR; + } + pr_dbg("notify=3D%d\n", cq->notify); } =20 @@ -349,6 +352,11 @@ int rdma_rm_alloc_qp(RdmaDeviceResources *dev_res, uin= t32_t pd_handle, return -EINVAL; } =20 + if (qp_type =3D=3D IBV_QPT_GSI) { + scq->notify =3D CNT_SET; + rcq->notify =3D CNT_SET; + } + qp =3D res_tbl_alloc(&dev_res->qp_tbl, &rm_qpn); if (!qp) { return -ENOMEM; diff --git a/hw/rdma/rdma_rm_defs.h b/hw/rdma/rdma_rm_defs.h index 7228151239..9b399063d3 100644 --- a/hw/rdma/rdma_rm_defs.h +++ b/hw/rdma/rdma_rm_defs.h @@ -49,10 +49,16 @@ typedef struct RdmaRmPD { uint32_t ctx_handle; } RdmaRmPD; =20 +typedef enum CQNotificationType { + CNT_CLEAR, + CNT_ARM, + CNT_SET, +} CQNotificationType; + typedef struct RdmaRmCQ { RdmaBackendCQ backend_cq; void *opaque; - bool notify; + CQNotificationType notify; } RdmaRmCQ; =20 /* MR (DMA region) */ diff --git a/hw/rdma/vmw/pvrdma_qp_ops.c b/hw/rdma/vmw/pvrdma_qp_ops.c index c668afd0ed..762700a205 100644 --- a/hw/rdma/vmw/pvrdma_qp_ops.c +++ b/hw/rdma/vmw/pvrdma_qp_ops.c @@ -89,8 +89,10 @@ static int pvrdma_post_cqe(PVRDMADev *dev, uint32_t cq_h= andle, pvrdma_ring_write_inc(&dev->dsr_info.cq); =20 pr_dbg("cq->notify=3D%d\n", cq->notify); - if (cq->notify) { - cq->notify =3D false; + if (cq->notify !=3D CNT_CLEAR) { + if (cq->notify =3D=3D CNT_ARM) { + cq->notify =3D CNT_CLEAR; + } post_interrupt(dev, INTR_VEC_CMD_COMPLETION_Q); } =20 --=20 2.17.2