From nobody Tue Feb 10 17:31:14 2026 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15416936152401000.1615021929889; Thu, 8 Nov 2018 08:13:35 -0800 (PST) Received: from localhost ([::1]:57670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKmw1-0000Vg-NU for importer@patchew.org; Thu, 08 Nov 2018 11:13:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKmrc-0004oU-1q for qemu-devel@nongnu.org; Thu, 08 Nov 2018 11:09:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKmrY-0000Qr-R1 for qemu-devel@nongnu.org; Thu, 08 Nov 2018 11:09:00 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:54100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gKmrY-0000QQ-GL for qemu-devel@nongnu.org; Thu, 08 Nov 2018 11:08:56 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA8G4DsS150931; Thu, 8 Nov 2018 16:08:54 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2nh3mq2c5w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 08 Nov 2018 16:08:54 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wA8G8mel031419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 8 Nov 2018 16:08:49 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA8G8l60027121; Thu, 8 Nov 2018 16:08:48 GMT Received: from localhost.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 08 Nov 2018 08:08:47 -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=ucVthYl/eKN2dgCkdRXiPumv7+8qKgtMrnLm0e2nLCk=; b=0eu10XeQHxb/7DtiogsZaeULu0oTfvSU6skUg1TZbpN77ZLaPFTcuQs+L7dRSqx5xY7d Z/5hUHy2NDks9OFlJqlRv+vqxpsbhYLVL+fymqiHR1MzSRIOP8mtpDy05SlDJbuugt6w +yH0C3bJrZlcfDPXvIVerr/RVA6IErMhWai27S6LTt4OJd3d1sAygCZ8TLD8GnyjMg7w ffS6ZiMLaN7KJP537MXS5m30agc9KNX6yK7cVdjeSQej7ger3ymw6rW6ou2e/dmVCrAt /cIjkCPiK79A8cwD45n6iiVLebAt/Y4uGgZJeony4qUUZMJo7zIDC11MaXAigpCC+C/p 4Q== 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 Date: Thu, 8 Nov 2018 18:07:58 +0200 Message-Id: <20181108160818.5485-3-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181108160818.5485-1-yuval.shaia@oracle.com> References: <20181108160818.5485-1-yuval.shaia@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9071 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=666 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811080135 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 141.146.126.78 Subject: [Qemu-devel] [PATCH v2 02/22] 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