Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1943051imm; Wed, 16 May 2018 05:35:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoxSNeWyLGM3tHBY3QybG6kFjql+n1eGhxjm5oNEjwq8Aiu2gMyxY+x9R/PthYkDN9ncgK7 X-Received: by 2002:a63:9c3:: with SMTP id 186-v6mr608094pgj.357.1526474139259; Wed, 16 May 2018 05:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526474139; cv=none; d=google.com; s=arc-20160816; b=0lTsFTwGmiD5OvAmwwIWdxWpvtbZai2sd3mW3aQAbktUYFSY7Q/rqMnRz8Xb08mmV4 QTt+QJdBBZs5+w+xa8C8mW5B1L7t3ixh2YwlX1E4VRGcI1Cxdgpsze8WWTxEf8vXtFwx 79a4iRqndb4bfjrpW1ICPYexVxjgbroZueUJzu7TepiyNG6G04r64lZX5Jt01SETGyBR 0ZjLBdUYy9oArcNmGwjPqbPZlFR0WGNc7DfU7x8QdXOw9Yglck1V7e1V2V1N10Ee/MrL MN+GEV4Cxet+DVudso9L+2GB4ZDCoo4KRz7kp5YRkoRPKZoGmR4M4XfbUd43QI8hZOVW yXyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XQiju91Dq0Tb84C63W+bOWVkod4vnBXd5kmA4vyJrQ4=; b=B473qanFwPTDsDjpik9vBZvEOrfKGiWk7XptMdNocjHReZUw1Dc57F8kO5CC27x9kj gPegLPmP3g4C5bLtguJx1hjgJtmrKXQ+HPXZoD/sDiBVbL8auJbf+vzwpY0W0sIEJYgC 226GdyK/DirIKOvJBVrdB6kvAfDQQICEmztz+9S+gM8pDihQvclRXr/ma8q92fS5PRdS bS1qLLAP8p4KyEhoYbX8ghVotYORvaVH6WfuQBZj4DoMUNpG0bOeQkneJ7tPiahVkA3j Of1vh8+AL15IDbdCogBckmW9IMhMay78J68SlIPxsewRoYOU9/e/zGyLQ+Jaiv+tM479 MfFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3-v6si2360849plq.87.2018.05.16.05.35.25; Wed, 16 May 2018 05:35:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752686AbeEPMdG (ORCPT + 99 others); Wed, 16 May 2018 08:33:06 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55472 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752610AbeEPMdC (ORCPT ); Wed, 16 May 2018 08:33:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C696859A3; Wed, 16 May 2018 12:33:01 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-64.pek2.redhat.com [10.72.12.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C136215CDA7; Wed, 16 May 2018 12:32:56 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com Cc: kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jfreimann@redhat.com, wexu@redhat.com, tiwei.bie@intel.com Subject: [RFC V4 PATCH 6/8] virtio: introduce packed ring defines Date: Wed, 16 May 2018 20:32:19 +0800 Message-Id: <1526473941-16199-7-git-send-email-jasowang@redhat.com> In-Reply-To: <1526473941-16199-1-git-send-email-jasowang@redhat.com> References: <1526473941-16199-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 16 May 2018 12:33:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Wed, 16 May 2018 12:33:01 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Jason Wang --- include/uapi/linux/virtio_config.h | 9 +++++++++ include/uapi/linux/virtio_ring.h | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index 308e209..5903d51 100644 --- a/include/uapi/linux/virtio_config.h +++ b/include/uapi/linux/virtio_config.h @@ -71,4 +71,13 @@ * this is for compatibility with legacy systems. */ #define VIRTIO_F_IOMMU_PLATFORM 33 + +#define VIRTIO_F_RING_PACKED 34 + +/* + * This feature indicates that all buffers are used by the device in + * the same order in which they have been made available. + */ +#define VIRTIO_F_IN_ORDER 35 + #endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h index 6d5d5fa..e297580 100644 --- a/include/uapi/linux/virtio_ring.h +++ b/include/uapi/linux/virtio_ring.h @@ -43,6 +43,8 @@ #define VRING_DESC_F_WRITE 2 /* This means the buffer contains a list of buffer descriptors. */ #define VRING_DESC_F_INDIRECT 4 +#define VRING_DESC_F_AVAIL 7 +#define VRING_DESC_F_USED 15 /* The Host uses this in used->flags to advise the Guest: don't kick me when * you add a buffer. It's unreliable, so it's simply an optimization. Guest @@ -62,6 +64,17 @@ * at the end of the used ring. Guest should ignore the used->flags field. */ #define VIRTIO_RING_F_EVENT_IDX 29 +struct vring_desc_packed { + /* Buffer Address. */ + __virtio64 addr; + /* Buffer Length. */ + __virtio32 len; + /* Buffer ID. */ + __virtio16 id; + /* The flags depending on descriptor type. */ + __virtio16 flags; +}; + /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ struct vring_desc { /* Address (guest-physical). */ -- 2.7.4