From nobody Fri May 17 06:07:30 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1712590527; cv=none; d=zohomail.com; s=zohoarc; b=fMGB86FFZlQawztoZz+LI1SEibBCAQVM3SnR8ISzY+4svcUdUaLtsjRGNrFas5k+2uuNJRUenILo5dXPlvjKR/gW2B7v3Ia5/TM7Xs0XpG1Y6Q6Vmk61A4b7QgteozPq2ghZswRrdzg4mlFqkMmur2D+42M2cEHOiRRJH+eVMvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712590527; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fxTG5H+k9GuEV1QiH20UEngvezOU2CY6pKWF9qduMa8=; b=bd1/eBoNo2TkCVnKB2/GesdnIT3tQVfeK8TX80QWukOCxg4Rdb3BP6sO3llB4WD7CMQiKez1kHslfeRt7O962/PIcOTCTK5VHHTQmOocJqR0glQWrFR0Zca41TCDHI3yqTvHEPFBYK9fTqCn/WK/jBgPfEHyF3C2HwrJkhhJ38U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712590527748979.5227182394908; Mon, 8 Apr 2024 08:35:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtr19-0008DZ-Lo; Mon, 08 Apr 2024 11:34:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr0x-000896-6G; Mon, 08 Apr 2024 11:34:31 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr0v-0006rO-Ep; Mon, 08 Apr 2024 11:34:30 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 438ENpoX028680; Mon, 8 Apr 2024 15:34:16 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xaxedk1rk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:15 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 438ESwuF032371; Mon, 8 Apr 2024 15:34:14 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu60dau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:14 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 438FUlUu008521; Mon, 8 Apr 2024 15:34:13 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-195-157.vpn.oracle.com [10.39.195.157]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3xavu60d7m-2; Mon, 08 Apr 2024 15:34:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=fxTG5H+k9GuEV1QiH20UEngvezOU2CY6pKWF9qduMa8=; b=YpIdkTDg30RKAtWQmF6/TyC52wPJGVkbgBJ/GvteDF7dGmKcY881GwJjhhLLal9TYzYa yGGyjsMMi19N+9LuJOiI84R506C0jv8Sx/I7bjWhzqmOtYj17Kjuya8f1NrVB+dl9o3/ FBeuILL035v5sCqH5+VDOw+cTLGSjd+DGCbjh1QvT+KR0Ahg1b8K2VFzss1OuabD6I6G a50foKxJCQHFp5RI/00WSaE9uF/9FXxD/tQGNX2VzQgsm3Bmpy/YZtxR3euqnNdojKPO cxi04045MfKbbx4sTbKJtB2vX3H0Vjkf0KLiUO5wjypQ0BDIPyOyehy2XT7thq9FNKAD EQ== From: Jonah Palmer To: qemu-devel@nongnu.org Cc: mst@redhat.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, jasowang@redhat.com, pbonzini@redhat.com, fam@euphon.net, eperezma@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org, schalla@marvell.com, leiyang@redhat.com, virtio-fs@lists.linux.dev, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com Subject: [RFC v3 1/6] virtio: Add bool to VirtQueueElement Date: Mon, 8 Apr 2024 11:34:03 -0400 Message-Id: <20240408153408.3527586-2-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240408153408.3527586-1-jonah.palmer@oracle.com> References: <20240408153408.3527586-1-jonah.palmer@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_13,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404080120 X-Proofpoint-GUID: k8vp9plj5_NjByBtSI8kFoZ1z8-8OjcA X-Proofpoint-ORIG-GUID: k8vp9plj5_NjByBtSI8kFoZ1z8-8OjcA Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1712590528217100001 Content-Type: text/plain; charset="utf-8" Add the boolean 'filled' member to the VirtQueueElement structure. The use of this boolean will signify if the element has been written to the used / descriptor ring or not. This boolean is used to support the VIRTIO_F_IN_ORDER feature. Signed-off-by: Jonah Palmer Tested-by: Lei Yang --- include/hw/virtio/virtio.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index b3c74a1bca..9034719f1d 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -71,6 +71,7 @@ typedef struct VirtQueueElement unsigned int ndescs; unsigned int out_num; unsigned int in_num; + bool filled; hwaddr *in_addr; hwaddr *out_addr; struct iovec *in_sg; --=20 2.39.3 From nobody Fri May 17 06:07:30 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1712590580; cv=none; d=zohomail.com; s=zohoarc; b=YRPlJZXazsj/8nAOYiPFWSf8t62DDLhD1VQIK5En1f9LoUbGq02EBgA7RqNYbASjCl1iNifxEQ5QrVOJgdQa3KSfEMtAoi5Hb3DFhtTC9JVZss4URB+uNRs3g0J2LyeBZvLrCIYk8ugr6On2m61v0gKKcvIylOmnmmu+6TalgLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712590580; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XYRkQ3kyoUOhCM8Tp/MmT2rsc5+r6mX0RGkbovirnJM=; b=PFbCFqYKjmLLeOS9cdW2uVzzjQSJqX2mOICcexhzez6WPeZsQaQKa2cDwm4p3oHjYQZp2cMRUfKs9GhBRSkY35PXQqt+E6DW0h2x2pnjCUuEHOVAoc75cwA83Kha/TS7qFCMElRo3Ye7W517kSXzAiFgv8lrOeYi7fIj+qtpOAI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712590580523876.8493123136586; Mon, 8 Apr 2024 08:36:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtr1A-0008Ds-ON; Mon, 08 Apr 2024 11:34:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr18-0008DL-MT; Mon, 08 Apr 2024 11:34:42 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr17-0006sQ-1h; Mon, 08 Apr 2024 11:34:42 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 438ENqxa028719; Mon, 8 Apr 2024 15:34:18 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xaxedk1rm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:17 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 438FJ1Z0032329; Mon, 8 Apr 2024 15:34:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu60dc9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:16 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 438FUlUw008521; Mon, 8 Apr 2024 15:34:16 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-195-157.vpn.oracle.com [10.39.195.157]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3xavu60d7m-3; Mon, 08 Apr 2024 15:34:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=XYRkQ3kyoUOhCM8Tp/MmT2rsc5+r6mX0RGkbovirnJM=; b=Ipj/PZ3wmwJrWQjAfKtM/f2TdtspacLdWGg/Uog1Lw6CTv8gHLLvS6pd9rwXc0LCKKy4 O6Z6ON2CP45QDW7RurK6RBKNpUa18zArDSr+VPo8iQlOMgEXR+Fv/jTDAeYsaiU91xVw E/yFDzsqcKAhYD28b1rvrsRS3oe8PavcU7MYrwwiAfuAMUEiYvwnWhTs7WDRB6gNU8Jm EPfectdpVvF+uLzx5QGJC5QOs3pFWwfEWVaacfngu5r41iWQ3Rhe+jpS4byeQZjc9VYb 4QzVB33Bi7ndR73JNsA2E7TbiuqoeL8ABsEejxYcR8Q/QRuHEkEheCul37+vR5PV65bD Cg== From: Jonah Palmer To: qemu-devel@nongnu.org Cc: mst@redhat.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, jasowang@redhat.com, pbonzini@redhat.com, fam@euphon.net, eperezma@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org, schalla@marvell.com, leiyang@redhat.com, virtio-fs@lists.linux.dev, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com Subject: [RFC v3 2/6] virtio: virtqueue_pop - VIRTIO_F_IN_ORDER support Date: Mon, 8 Apr 2024 11:34:04 -0400 Message-Id: <20240408153408.3527586-3-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240408153408.3527586-1-jonah.palmer@oracle.com> References: <20240408153408.3527586-1-jonah.palmer@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_13,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404080120 X-Proofpoint-GUID: hlv1tKxKCk15TNEl6kaAm9pZasse5Mfr X-Proofpoint-ORIG-GUID: hlv1tKxKCk15TNEl6kaAm9pZasse5Mfr Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1712590582606100007 Content-Type: text/plain; charset="utf-8" Add VIRTIO_F_IN_ORDER feature support in virtqueue_split_pop and virtqueue_packed_pop. VirtQueueElements popped from the available/descritpor ring are added to the VirtQueue's used_elems array in-order and in the same fashion as they would be added the used and descriptor rings, respectively. This will allow us to keep track of the current order, what elements have been written, as well as an element's essential data after being processed. Signed-off-by: Jonah Palmer Tested-by: Lei Yang --- hw/virtio/virtio.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index fb6b4ccd83..3ad58100b2 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1497,7 +1497,7 @@ static void *virtqueue_alloc_element(size_t sz, unsig= ned out_num, unsigned in_nu =20 static void *virtqueue_split_pop(VirtQueue *vq, size_t sz) { - unsigned int i, head, max; + unsigned int i, j, head, max; VRingMemoryRegionCaches *caches; MemoryRegionCache indirect_desc_cache; MemoryRegionCache *desc_cache; @@ -1530,6 +1530,8 @@ static void *virtqueue_split_pop(VirtQueue *vq, size_= t sz) goto done; } =20 + j =3D vq->last_avail_idx; + if (!virtqueue_get_head(vq, vq->last_avail_idx++, &head)) { goto done; } @@ -1621,6 +1623,12 @@ static void *virtqueue_split_pop(VirtQueue *vq, size= _t sz) elem->in_sg[i] =3D iov[out_num + i]; } =20 + if (virtio_vdev_has_feature(vdev, VIRTIO_F_IN_ORDER)) { + vq->used_elems[j].index =3D elem->index; + vq->used_elems[j].len =3D elem->len; + vq->used_elems[j].ndescs =3D elem->ndescs; + } + vq->inuse++; =20 trace_virtqueue_pop(vq, elem, elem->in_num, elem->out_num); @@ -1749,6 +1757,13 @@ static void *virtqueue_packed_pop(VirtQueue *vq, siz= e_t sz) =20 elem->index =3D id; elem->ndescs =3D (desc_cache =3D=3D &indirect_desc_cache) ? 1 : elem_e= ntries; + + if (virtio_vdev_has_feature(vdev, VIRTIO_F_IN_ORDER)) { + vq->used_elems[vq->last_avail_idx].index =3D elem->index; + vq->used_elems[vq->last_avail_idx].len =3D elem->len; + vq->used_elems[vq->last_avail_idx].ndescs =3D elem->ndescs; + } + vq->last_avail_idx +=3D elem->ndescs; vq->inuse +=3D elem->ndescs; =20 --=20 2.39.3 From nobody Fri May 17 06:07:30 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1712590548; cv=none; d=zohomail.com; s=zohoarc; b=OTj211KT35DVHxLqczBYL+d8bbJyqRUizMagixVFBaUZwguQurCFo3CWsRAFeV69IJW7J8cNCjJBI4K/385c4WXU+y+F/MafRlZKd6oa+bLUxIoIwt4xgcrZ7FoBbWBzajzL97Erpt7A3jIFOK14FkcPAXGC4nVSqhqKBDzI18k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712590548; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hqZDBT6khwb4SZoBPhPhcAKg3Samj7WhUu/ZWIeOnuc=; b=h61Tqf3hJFBU87VDUD6Vs9ZrCf5oI30CWD8MsvF8c7AVUoZX0oAnkLCKOSj1dTFdWIFaAXqu/llu34OmqQD8oipEnWhsSYCWuJ59n39jWhoZ5/V4JL+AdfLjNec0epClZ9CtQPOrlMAqLI6V65uVfmaHOSBYZPikHVzvW9GT85I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712590548986932.3039397570805; Mon, 8 Apr 2024 08:35:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtr17-0008Cg-Gw; Mon, 08 Apr 2024 11:34:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr10-0008BC-V8; Mon, 08 Apr 2024 11:34:35 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr0x-0006rg-NB; Mon, 08 Apr 2024 11:34:34 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 438ENwOe027269; Mon, 8 Apr 2024 15:34:20 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xaw6431hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:20 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 438FCQHX032536; Mon, 8 Apr 2024 15:34:19 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu60ddu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:18 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 438FUlV0008521; Mon, 8 Apr 2024 15:34:18 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-195-157.vpn.oracle.com [10.39.195.157]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3xavu60d7m-4; Mon, 08 Apr 2024 15:34:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=hqZDBT6khwb4SZoBPhPhcAKg3Samj7WhUu/ZWIeOnuc=; b=G0JVYDBXVFji6IiXFxAFJItTmQLDGP6NV8m63DZbyGtZSU9P6BRivYuc6aAgBz139sqm S9chMnq5gs9Um7Lx/vMUQBVc6VnVvsEtABaHhBn2S0xdLOLngpp1W8EuMx1dO+/gAhG2 ocuNTpRtCG/+JRJ6fpqi4XHy8/rRjDIQgdQa9qdRubkozaVmDLN4lfOsbQbz4CgU+AWx a6XPko7jkJqpi18j/gR6wc0k37zSOnKUvCDgyAKzuRIPI/ngbFhjfdIZGXMLxGp+nucG THp9t1XHMCniHf6SMgYk2xPyq3z3lJo3KP1gw5Ud5JS6JmHXiV38JGTKPvSrDqul0yi9 2A== From: Jonah Palmer To: qemu-devel@nongnu.org Cc: mst@redhat.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, jasowang@redhat.com, pbonzini@redhat.com, fam@euphon.net, eperezma@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org, schalla@marvell.com, leiyang@redhat.com, virtio-fs@lists.linux.dev, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com Subject: [RFC v3 3/6] virtio: virtqueue_ordered_fill - VIRTIO_F_IN_ORDER support Date: Mon, 8 Apr 2024 11:34:05 -0400 Message-Id: <20240408153408.3527586-4-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240408153408.3527586-1-jonah.palmer@oracle.com> References: <20240408153408.3527586-1-jonah.palmer@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_13,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404080120 X-Proofpoint-GUID: hIllOrDlZrhLoe_0OiMojFJuidtOFML1 X-Proofpoint-ORIG-GUID: hIllOrDlZrhLoe_0OiMojFJuidtOFML1 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1712590550314100001 Content-Type: text/plain; charset="utf-8" Add VIRTIO_F_IN_ORDER feature support for virtqueue_fill operations. The goal of the virtqueue_fill operation when the VIRTIO_F_IN_ORDER feature has been negotiated is to search for this now-used element, set its length, and mark the element as filled in the VirtQueue's used_elems array. By marking the element as filled, it will indicate that this element is ready to be flushed, so long as the element is in-order. Signed-off-by: Jonah Palmer Tested-by: Lei Yang --- hw/virtio/virtio.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 3ad58100b2..0730f26f74 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -872,6 +872,28 @@ static void virtqueue_packed_fill(VirtQueue *vq, const= VirtQueueElement *elem, vq->used_elems[idx].ndescs =3D elem->ndescs; } =20 +static void virtqueue_ordered_fill(VirtQueue *vq, const VirtQueueElement *= elem, + unsigned int len) +{ + unsigned int i =3D vq->used_idx; + + /* Search for element in vq->used_elems */ + while (i !=3D vq->last_avail_idx) { + /* Found element, set length and mark as filled */ + if (vq->used_elems[i].index =3D=3D elem->index) { + vq->used_elems[i].len =3D len; + vq->used_elems[i].filled =3D true; + break; + } + + i +=3D vq->used_elems[i].ndescs; + + if (i >=3D vq->vring.num) { + i -=3D vq->vring.num; + } + } +} + static void virtqueue_packed_fill_desc(VirtQueue *vq, const VirtQueueElement *elem, unsigned int idx, @@ -922,7 +944,9 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueEleme= nt *elem, return; } =20 - if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) { + if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_IN_ORDER)) { + virtqueue_ordered_fill(vq, elem, len); + } else if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) { virtqueue_packed_fill(vq, elem, len, idx); } else { virtqueue_split_fill(vq, elem, len, idx); --=20 2.39.3 From nobody Fri May 17 06:07:30 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1712590535; cv=none; d=zohomail.com; s=zohoarc; b=U/T+rYI9DGKv5Z6U3QpvC0+WuKldQrq4btRoLIP9aTqFxtwx4qgKrVUmtiDDRd8KofRSmojSKZb3V5yBCbMukDhlMyHPji11eqRl7X1WqacoAAedU96O0JOUw+2XBBuHdPd1foPPDCqZLsFt9fNZT43qAJdHP4RF1EPnqqHzBWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712590535; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2anHYm4YrsDyprFeqE6snborl7f1ZCSTS1qZP4wR4Kw=; b=HMDf9c3c6lNwj2yHhKlrxFrPc/Sqybg16mIc5O0vVfWNxDfwlGRd9moUBm0kfj0L9DVRGd45mdLANruZeKIBL2R1ebtreCjJVQQ5+qQuIzPHBMFlwhwV2tisBvDaitSHeZyozfj+BtDtGLNvQpr46/9o9UGqbSRPH8vqaoE+qxA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171259053564039.864644869300264; Mon, 8 Apr 2024 08:35:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtr1T-0008IF-FY; Mon, 08 Apr 2024 11:35:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr1N-0008Gs-5r; Mon, 08 Apr 2024 11:34:57 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr1G-0006tX-PQ; Mon, 08 Apr 2024 11:34:55 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 438ENwrY014631; Mon, 8 Apr 2024 15:34:22 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xavtf31mm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:22 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 438FRrQ1032535; Mon, 8 Apr 2024 15:34:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu60dfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:21 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 438FUlV2008521; Mon, 8 Apr 2024 15:34:20 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-195-157.vpn.oracle.com [10.39.195.157]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3xavu60d7m-5; Mon, 08 Apr 2024 15:34:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=2anHYm4YrsDyprFeqE6snborl7f1ZCSTS1qZP4wR4Kw=; b=V7Cd6iXdKoevlIWAsrOTlm6QsOF0KcPaIa4J2MllgBhrbvpwSqUMzOsF+0r1gEwZiVk7 PfL8B3MO+MlUDF89oWNBteZ4nPBultVH4Tnu3X3AHQtO4vUf2Dh2hBh6Ly/AI05Lvx0E iZiQQuiCnlx3TJ+TT9zcRB5v8GIqps2+drIxayVih3Q/rxUj1mZ7TtEvq48YMI0QQRJb GeFFwlOgxf97lPV433CLhlIhbA48DL96MUkCZXO3HlIe97ylPOr41Vx3uG+D3cTsba0X LVf+8NrPfj6H9N2B1k1/0t+xfhiFO3Z16ymcVgfkdLejoh9E4uWaDh91Cps7IlVZhk85 Lg== From: Jonah Palmer To: qemu-devel@nongnu.org Cc: mst@redhat.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, jasowang@redhat.com, pbonzini@redhat.com, fam@euphon.net, eperezma@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org, schalla@marvell.com, leiyang@redhat.com, virtio-fs@lists.linux.dev, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com Subject: [RFC v3 4/6] virtio: virtqueue_ordered_flush - VIRTIO_F_IN_ORDER support Date: Mon, 8 Apr 2024 11:34:06 -0400 Message-Id: <20240408153408.3527586-5-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240408153408.3527586-1-jonah.palmer@oracle.com> References: <20240408153408.3527586-1-jonah.palmer@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_13,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404080120 X-Proofpoint-GUID: q_EBODycqLhvjW8DxcBl_Tsaji4N8m7t X-Proofpoint-ORIG-GUID: q_EBODycqLhvjW8DxcBl_Tsaji4N8m7t Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1712590536207100001 Content-Type: text/plain; charset="utf-8" Add VIRTIO_F_IN_ORDER feature support for virtqueue_flush operations. The goal of the virtqueue_flush operation when the VIRTIO_F_IN_ORDER feature has been negotiated is to write elements to the used/descriptor ring in-order and then update used_idx. The function iterates through the VirtQueueElement used_elems array in-order starting at vq->used_idx. If the element is valid (filled), the element is written to the used/descriptor ring. This process continues until we find an invalid (not filled) element. If any elements were written, the used_idx is updated. Signed-off-by: Jonah Palmer Tested-by: Lei Yang --- hw/virtio/virtio.c | 75 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 0730f26f74..13451d0cae 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -997,6 +997,77 @@ static void virtqueue_packed_flush(VirtQueue *vq, unsi= gned int count) } } =20 +static void virtqueue_ordered_flush(VirtQueue *vq) +{ + unsigned int i =3D vq->used_idx; + unsigned int ndescs =3D 0; + uint16_t old =3D vq->used_idx; + bool packed; + VRingUsedElem uelem; + + packed =3D virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED); + + if (packed) { + if (unlikely(!vq->vring.desc)) { + return; + } + } else if (unlikely(!vq->vring.used)) { + return; + } + + /* First expected in-order element isn't ready, nothing to do */ + if (!vq->used_elems[i].filled) { + return; + } + + /* Write first expected in-order element to used ring (split VQs) */ + if (!packed) { + uelem.id =3D vq->used_elems[i].index; + uelem.len =3D vq->used_elems[i].len; + vring_used_write(vq, &uelem, i); + } + + ndescs +=3D vq->used_elems[i].ndescs; + i +=3D ndescs; + if (i >=3D vq->vring.num) { + i -=3D vq->vring.num; + } + + /* Search for more filled elements in-order */ + while (vq->used_elems[i].filled) { + if (packed) { + virtqueue_packed_fill_desc(vq, &vq->used_elems[i], ndescs, fal= se); + } else { + uelem.id =3D vq->used_elems[i].index; + uelem.len =3D vq->used_elems[i].len; + vring_used_write(vq, &uelem, i); + } + + vq->used_elems[i].filled =3D false; + ndescs +=3D vq->used_elems[i].ndescs; + i +=3D ndescs; + if (i >=3D vq->vring.num) { + i -=3D vq->vring.num; + } + } + + if (packed) { + virtqueue_packed_fill_desc(vq, &vq->used_elems[vq->used_idx], 0, t= rue); + vq->used_idx +=3D ndescs; + if (vq->used_idx >=3D vq->vring.num) { + vq->used_idx -=3D vq->vring.num; + vq->used_wrap_counter ^=3D 1; + vq->signalled_used_valid =3D false; + } + } else { + vring_used_idx_set(vq, i); + if (unlikely((int16_t)(i - vq->signalled_used) < (uint16_t)(i - ol= d))) { + vq->signalled_used_valid =3D false; + } + } + vq->inuse -=3D ndescs; +} + void virtqueue_flush(VirtQueue *vq, unsigned int count) { if (virtio_device_disabled(vq->vdev)) { @@ -1004,7 +1075,9 @@ void virtqueue_flush(VirtQueue *vq, unsigned int coun= t) return; } =20 - if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) { + if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_IN_ORDER)) { + virtqueue_ordered_flush(vq); + } else if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) { virtqueue_packed_flush(vq, count); } else { virtqueue_split_flush(vq, count); --=20 2.39.3 From nobody Fri May 17 06:07:30 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1712590580; cv=none; d=zohomail.com; s=zohoarc; b=WWcYnoIZ+AqYjuNDmN9pvc2eRmrpV5OIjcdMqBynIl3YmbrBftvgvWpGfjMYzejPBN/DXB/HrC3zwdYJDczCTXCi9W9aD5mStmEbgt4j+KE1z9CnuUfaIK0ouXzhLoWAgnaBh3ULCRgmvW44ZtvWSnw95YEaA4oRvd8/EN6eSK4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712590580; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=NCxxLo4RlxRydMdSCKc3FePLGo3S5WU5DOyvQHDa3kg=; b=jx88hQj7IKV9qvvS6R4HQfXvGIU4jesFiajf9MyFfBXL9Fc9KYFmDbeYtqrz6L/KANOo4mXMZSj4AaEuXBrXpbiwJf9/33qdawdMwPvHRiRBhf49j9W9gbiDNOhaRmKmEtRvhS8c9aBKLpvFogoizGwczC3n2mYMnwfSsEAZUWo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712590579964326.02247868459096; Mon, 8 Apr 2024 08:36:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtr1V-0008Ip-Dw; Mon, 08 Apr 2024 11:35:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr1J-0008G1-4O; Mon, 08 Apr 2024 11:34:53 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr1F-0006tP-7h; Mon, 08 Apr 2024 11:34:51 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 438ENpnU012252; Mon, 8 Apr 2024 15:34:24 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xax0uk0m5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:24 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 438EtZpp032420; Mon, 8 Apr 2024 15:34:23 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu60dgs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:23 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 438FUlV4008521; Mon, 8 Apr 2024 15:34:22 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-195-157.vpn.oracle.com [10.39.195.157]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3xavu60d7m-6; Mon, 08 Apr 2024 15:34:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2023-11-20; bh=NCxxLo4RlxRydMdSCKc3FePLGo3S5WU5DOyvQHDa3kg=; b=EAERG4OHqpmQlPoVYIdIvZDP84HhLAHPpxcv/4UhpuXhlNyUcN4oJoWzn11Ce67oAs8m KGKent4Q2S78C6mqdAA4jWgDluKxGCpwEkMzOoZqrInjVw1rt7Vva+QsHKAs96i/xo27 uo9M9iZkvvSri3djGPGpSv8sa1ibiOK/PL86Kxa9GtO/3zDPMBiCBPW/KhRLjJwLIecQ zLcKLUZFMqJRC9bcvgeGvR7I/PD83NRdak71uIrLAyvWII5K5AQYXi9EF1YOXwncB53u X3DVZ9MhTgeWU8DBxRF9YchWTsfZCma9W7czpxQDso5Xj2RFj7McwuELyW/Zy3GP1xZG FQ== To: qemu-devel@nongnu.org Cc: mst@redhat.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, jasowang@redhat.com, pbonzini@redhat.com, fam@euphon.net, eperezma@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org, schalla@marvell.com, leiyang@redhat.com, virtio-fs@lists.linux.dev, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com Subject: [RFC v3 5/6] vhost, vhost-user: Add VIRTIO_F_IN_ORDER to vhost feature bits Date: Mon, 8 Apr 2024 11:34:07 -0400 Message-Id: <20240408153408.3527586-6-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240408153408.3527586-1-jonah.palmer@oracle.com> References: <20240408153408.3527586-1-jonah.palmer@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_13,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404080120 X-Proofpoint-GUID: G-nRIukqlYhcEBQlu1pa09Jr1hiBkjyE X-Proofpoint-ORIG-GUID: G-nRIukqlYhcEBQlu1pa09Jr1hiBkjyE Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jonah Palmer From: Jonah Palmer via Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1712590582449100005 Add support for the VIRTIO_F_IN_ORDER feature across a variety of vhost devices. The inclusion of VIRTIO_F_IN_ORDER in the feature bits arrays for these devices ensures that the backend is capable of offering and providing support for this feature, and that it can be disabled if the backend does not support it. Acked-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Tested-by: Lei Yang --- hw/block/vhost-user-blk.c | 1 + hw/net/vhost_net.c | 2 ++ hw/scsi/vhost-scsi.c | 1 + hw/scsi/vhost-user-scsi.c | 1 + hw/virtio/vhost-user-fs.c | 1 + hw/virtio/vhost-user-vsock.c | 1 + net/vhost-vdpa.c | 1 + 7 files changed, 8 insertions(+) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 6a856ad51a..d176ed857e 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -51,6 +51,7 @@ static const int user_feature_bits[] =3D { VIRTIO_F_RING_PACKED, VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_RING_RESET, + VIRTIO_F_IN_ORDER, VHOST_INVALID_FEATURE_BIT }; =20 diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index fd1a93701a..eb0b1c06e5 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -48,6 +48,7 @@ static const int kernel_feature_bits[] =3D { VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_RING_PACKED, VIRTIO_F_RING_RESET, + VIRTIO_F_IN_ORDER, VIRTIO_NET_F_HASH_REPORT, VHOST_INVALID_FEATURE_BIT }; @@ -76,6 +77,7 @@ static const int user_feature_bits[] =3D { VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_RING_PACKED, VIRTIO_F_RING_RESET, + VIRTIO_F_IN_ORDER, VIRTIO_NET_F_RSS, VIRTIO_NET_F_HASH_REPORT, VIRTIO_NET_F_GUEST_USO4, diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index ae26bc19a4..40e7630191 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -38,6 +38,7 @@ static const int kernel_feature_bits[] =3D { VIRTIO_RING_F_EVENT_IDX, VIRTIO_SCSI_F_HOTPLUG, VIRTIO_F_RING_RESET, + VIRTIO_F_IN_ORDER, VHOST_INVALID_FEATURE_BIT }; =20 diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index a63b1f4948..1d59951ab7 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -36,6 +36,7 @@ static const int user_feature_bits[] =3D { VIRTIO_RING_F_EVENT_IDX, VIRTIO_SCSI_F_HOTPLUG, VIRTIO_F_RING_RESET, + VIRTIO_F_IN_ORDER, VHOST_INVALID_FEATURE_BIT }; =20 diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index cca2cd41be..9243dbb128 100644 --- a/hw/virtio/vhost-user-fs.c +++ b/hw/virtio/vhost-user-fs.c @@ -33,6 +33,7 @@ static const int user_feature_bits[] =3D { VIRTIO_F_RING_PACKED, VIRTIO_F_IOMMU_PLATFORM, VIRTIO_F_RING_RESET, + VIRTIO_F_IN_ORDER, =20 VHOST_INVALID_FEATURE_BIT }; diff --git a/hw/virtio/vhost-user-vsock.c b/hw/virtio/vhost-user-vsock.c index 9431b9792c..cc7e4e47b4 100644 --- a/hw/virtio/vhost-user-vsock.c +++ b/hw/virtio/vhost-user-vsock.c @@ -21,6 +21,7 @@ static const int user_feature_bits[] =3D { VIRTIO_RING_F_INDIRECT_DESC, VIRTIO_RING_F_EVENT_IDX, VIRTIO_F_NOTIFY_ON_EMPTY, + VIRTIO_F_IN_ORDER, VHOST_INVALID_FEATURE_BIT }; =20 diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 85e73dd6a7..ed3185acfa 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -62,6 +62,7 @@ const int vdpa_feature_bits[] =3D { VIRTIO_F_RING_PACKED, VIRTIO_F_RING_RESET, VIRTIO_F_VERSION_1, + VIRTIO_F_IN_ORDER, VIRTIO_NET_F_CSUM, VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, VIRTIO_NET_F_CTRL_MAC_ADDR, --=20 2.39.3 From nobody Fri May 17 06:07:30 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1712590567; cv=none; d=zohomail.com; s=zohoarc; b=PeIvE2E4ES2ppmpNM/xBglbYciC1HpSXKcehWIv6XZBd2e1e7PKeBFOWsSk9IgXXdFgOQUdLJljiybW9ZcJVWR/Cz5vpZulxcf3xtS2GtxRz5L9uaaIzx60BeQUOxqZXO5khzmREZqrQaEEtTSR6iBag/IaVvWctrE1/ezdS2uA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1712590567; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f29pbPDScm2dsH2p1VNwuN6r8JoPYGFvgZMG1tr/H1A=; b=EpKimiMv+wWkDjGc9UJNYcDh0h+1lCcol5/pxS3vrX6JWVVDebD5Rj9/FPqeQeCxSNZfcSsA/3JCyVvcZPI1QO3jKiZ0t+Ai+vt0P3+I31fWGCbVA4p/2/4aEsPW6DI1S0M1wLXw1YLlNXh5rNbX+vq4ikJm9j0p9njoCqee3Ic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1712590567670336.06478522123336; Mon, 8 Apr 2024 08:36:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtr1N-0008Gr-KZ; Mon, 08 Apr 2024 11:34:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr1E-0008F2-3U; Mon, 08 Apr 2024 11:34:48 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtr1B-0006ss-F4; Mon, 08 Apr 2024 11:34:46 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 438ENwV6014629; Mon, 8 Apr 2024 15:34:26 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xavtf31mv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:26 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 438FUGOE032401; Mon, 8 Apr 2024 15:34:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3xavu60dj6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Apr 2024 15:34:25 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 438FUlV6008521; Mon, 8 Apr 2024 15:34:24 GMT Received: from jonah-ol8.us.oracle.com (dhcp-10-39-195-157.vpn.oracle.com [10.39.195.157]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3xavu60d7m-7; Mon, 08 Apr 2024 15:34:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2023-11-20; bh=f29pbPDScm2dsH2p1VNwuN6r8JoPYGFvgZMG1tr/H1A=; b=HWdSj7jMPuY3ocomOWjIn3rJZthYyAZRhHKnt8ayUy+TQj0j7AIy5PfsbuV7kEVoN3L5 CPBZc97kI2QKCZS1nmmR0tZjFzmDavblxCGuRjTDwh23N/RpXrz8TMGmbzmanDljnZgP +oHfn8wbWUpQDB+hXjP6LoS2Bk8PWTLfuwanpxQqTU4OgGBCP1kU8npX1A1YOritd93w UROfsycikrkdyk4dmEZ8N0Ls3FMA/xnUr3cLMZmLfGGexK6C30+PLPAFcddPRdcaic1i E+VyeveOUbNH4E9M3KBSTwWcbtg1Rh5v3dFdTh+4Lx+HCGgpzG7z0e1lmeJ23Ei8do2k cg== From: Jonah Palmer To: qemu-devel@nongnu.org Cc: mst@redhat.com, raphael@enfabrica.net, kwolf@redhat.com, hreitz@redhat.com, jasowang@redhat.com, pbonzini@redhat.com, fam@euphon.net, eperezma@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org, schalla@marvell.com, leiyang@redhat.com, virtio-fs@lists.linux.dev, si-wei.liu@oracle.com, boris.ostrovsky@oracle.com, jonah.palmer@oracle.com Subject: [RFC v3 6/6] virtio: Add VIRTIO_F_IN_ORDER property definition Date: Mon, 8 Apr 2024 11:34:08 -0400 Message-Id: <20240408153408.3527586-7-jonah.palmer@oracle.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240408153408.3527586-1-jonah.palmer@oracle.com> References: <20240408153408.3527586-1-jonah.palmer@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-08_13,2024-04-05_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404080120 X-Proofpoint-GUID: RB0E5jbPopzzLIiexArsoIZr8oIpNFML X-Proofpoint-ORIG-GUID: RB0E5jbPopzzLIiexArsoIZr8oIpNFML Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.177.32; envelope-from=jonah.palmer@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1712590568299100001 Extend the virtio device property definitions to include the VIRTIO_F_IN_ORDER feature. The default state of this feature is disabled, allowing it to be explicitly enabled where it's supported. Acked-by: Eugenio P=C3=A9rez Signed-off-by: Jonah Palmer Tested-by: Lei Yang --- include/hw/virtio/virtio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 9034719f1d..43ea738e65 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -385,7 +385,9 @@ typedef struct VirtIORNGConf VirtIORNGConf; DEFINE_PROP_BIT64("packed", _state, _field, \ VIRTIO_F_RING_PACKED, false), \ DEFINE_PROP_BIT64("queue_reset", _state, _field, \ - VIRTIO_F_RING_RESET, true) + VIRTIO_F_RING_RESET, true), \ + DEFINE_PROP_BIT64("in_order", _state, _field, \ + VIRTIO_F_IN_ORDER, false) =20 hwaddr virtio_queue_get_desc_addr(VirtIODevice *vdev, int n); bool virtio_queue_enabled_legacy(VirtIODevice *vdev, int n); --=20 2.39.3