From nobody Tue Feb 10 00:57:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1572118876; cv=none; d=zoho.com; s=zohoarc; b=c0ZvW6Atc61dhtmRuQAORi1wbcHV/+yU7zP+1tgdixcGpJg7IOo/XcalgU6AsgurSWbY3VLZ02wiYju/82E2wS/fzO5ivFPm73t+GvJ2BWK2sfgujNi5/AOOoIvxLaejw6XETN/+xkMglESSVlaxmPffpRMzRZcMhs7063GPyd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572118876; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pDtG8hQ8q6Mlk3UMU4vlbn/rUVIBUzxnFYpC4qiJNV0=; b=T0Z6jIXk8+MRkBzeFoL02uT/cvO79PkXPlDXKqJDzcwdEG8QogoEDsoasIHabbHVryAG/FOQWJNls9mb15QoqBOUuPy+QS0gKSudbvHKBhiaZkImSmbCEAk6UMtQ4hidATNi+T9hSFTNtdh3Di9ab/KTVPEiQ0TFdH17ehBZuts= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157211887601224.97146117322052; Sat, 26 Oct 2019 12:41:16 -0700 (PDT) Received: from localhost ([::1]:41672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iORw1-0002f1-Oi for importer@patchew.org; Sat, 26 Oct 2019 15:41:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50934) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iORuD-0000IW-H9 for qemu-devel@nongnu.org; Sat, 26 Oct 2019 15:39:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iORuC-00007m-Ht for qemu-devel@nongnu.org; Sat, 26 Oct 2019 15:39:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11370) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iORuA-00007G-Ik for qemu-devel@nongnu.org; Sat, 26 Oct 2019 15:39:18 -0400 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 800924E4E6 for ; Sat, 26 Oct 2019 19:39:16 +0000 (UTC) Received: by mail-qt1-f199.google.com with SMTP id y10so6351331qti.1 for ; Sat, 26 Oct 2019 12:39:16 -0700 (PDT) Received: from redhat.com (bzq-79-176-10-77.red.bezeqint.net. [79.176.10.77]) by smtp.gmail.com with ESMTPSA id n17sm1560141qke.53.2019.10.26.12.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Oct 2019 12:39:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=YCXv9pgk58V4PShzTuonhz/UO31YcgkrsArln+nUUE0=; b=gKeXKml0oY97yovaP+acnWvgSJDOGuv9fIMnm8wPpyTZ/dfmDqvFAt3HL1Ey6w8l9b hskv156CEhIL3o5elYE7CCJX261OQXVAWRixKHUgO73S83wPqrS3LJasNJaS5+gKuDNe 1LHuh8gST+2Uu6ZXI7DN92ZFwafsGQoVYqqt6EjvGu8MO9D+Uaa6/UIzCJWuIJ0v7keT Tslbkk0ly6RerYeWfWrpqCp907dOH7ASyOMnH47+QXNuOre9oBjxd2rSbs32Cqq/+US4 AcFY7NiJRl2Olr1WJd1JaHQAtzp21pbLzOStLr4W4fO4W39qYzCpHym2UtDrTy2TXjEg s/WA== X-Gm-Message-State: APjAAAWiLoxNeLj1YZS4WyelLnnfci56Wfhyj/JQywyvnIVYiHeUTsrw PjjxlOVsdx1zSFuQK1/BU+pr0j43U3oZouNkxNs7FdJbx5rNcdUHfgTKJ75I+PJdprhkAPAClrd pCb0bamjg6OeHkS8= X-Received: by 2002:ac8:2a83:: with SMTP id b3mr10116306qta.244.1572118755518; Sat, 26 Oct 2019 12:39:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjtDcojhYaxrdJh0jL789L5SunEhJ5xt5uB6qkIutetoy31Wk1jDYwb0PiRBj5QJS8VXak+Q== X-Received: by 2002:ac8:2a83:: with SMTP id b3mr10116289qta.244.1572118755373; Sat, 26 Oct 2019 12:39:15 -0700 (PDT) Date: Sat, 26 Oct 2019 15:39:10 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 01/25] virtio: basic structure for packed ring Message-ID: <20191026193824.11926-2-mst@redhat.com> References: <20191026193824.11926-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191026193824.11926-1-mst@redhat.com> X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent 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: 209.132.183.28 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Jens Freimann , Wei Xu , Eugenio =?utf-8?B?UMOpcmV6?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Wei Xu Define packed ring structure according to Qemu nomenclature, field data(wrap counter, etc) are also included. Signed-off-by: Wei Xu Signed-off-by: Jason Wang Signed-off-by: Eugenio P=C3=A9rez Reviewed-by: Jens Freimann Message-Id: <20191025083527.30803-2-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 527df03bfd..fdac203cdf 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -43,6 +43,13 @@ typedef struct VRingDesc uint16_t next; } VRingDesc; =20 +typedef struct VRingPackedDesc { + uint64_t addr; + uint32_t len; + uint16_t id; + uint16_t flags; +} VRingPackedDesc; + typedef struct VRingAvail { uint16_t flags; @@ -81,17 +88,25 @@ typedef struct VRing VRingMemoryRegionCaches *caches; } VRing; =20 +typedef struct VRingPackedDescEvent { + uint16_t off_wrap; + uint16_t flags; +} VRingPackedDescEvent ; + struct VirtQueue { VRing vring; =20 /* Next head to pop */ uint16_t last_avail_idx; + bool last_avail_wrap_counter; =20 /* Last avail_idx read from VQ. */ uint16_t shadow_avail_idx; + bool shadow_avail_wrap_counter; =20 uint16_t used_idx; + bool used_wrap_counter; =20 /* Last used index value we have signalled on */ uint16_t signalled_used; --=20 MST