Received: by 10.213.65.68 with SMTP id h4csp991313imn; Sun, 25 Mar 2018 20:41:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELuoOoWcyDqsaFzbxnR33zlNs8bnpC8/jYyeSpxZx/dR7wa7fnKviZ6XTxeriLy46v4Kmj27 X-Received: by 2002:a17:902:a589:: with SMTP id az9-v6mr38540869plb.283.1522035684579; Sun, 25 Mar 2018 20:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522035684; cv=none; d=google.com; s=arc-20160816; b=jbu3oBD9a3eQPFlIcdc32SLW4b5EfavD7nrG999wS+hdDc6ZAI2rf547NDnDPzHt9a /i2AKwGVFvLeDbqyuUheZnc+bcpPRU8519zhiWqmVd9vbkzrQyoDFEZVhStG/uEnOuU0 Fuf5PMG9T265bA1lkl/WA8X4bk+gr5W2RgmWkvXiEaWwmm6R3FSC3wAvK+d8fvTMOPvK kNS3aixONo0K+ai5sJddm2ydKnC5EY7KoQ7zEAX77X2qRw3r39a31JENufocpgQHhkt6 4HXhXz7TLrImeDUyxad7RsaC3jyDZBjIBvkAV2szQemqFt9l0Xxu6CUY9fuuhEiYNYcP z8sA== 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=ktQJdLH6IaEoXPHAxbaEgxt0OMA+Rd9bkn12Nd9KMME5qoiVy8JIury+t2hwDLqRvU O9loy05Kd480gUQ7SvHPi5R56vIYgUmzGp5/brclnonOeD12vrERYpWkDhOw3drZhCJJ UFJhmkzEcjZVsrZPnl1UAGT6+BBVqh6kIp53IvAePahEu90iQxQHzu4FEGAV2JkGu48J aYM0pjIw+D7JRQl0VJVP16+8uUbvKs91jkmTU43NgxB1n4jYh9NeQwn2L/4UusZm3iHA XkQacQcSwEecKsvohzu4pWPZHsFYEnezHHT70dT6IogzpsWj9VnjNuiLZt3DGM3TPWiL FktQ== 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 y62si11108937pfd.52.2018.03.25.20.41.10; Sun, 25 Mar 2018 20:41:24 -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 S1752356AbeCZDkB (ORCPT + 99 others); Sun, 25 Mar 2018 23:40:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752311AbeCZDj6 (ORCPT ); Sun, 25 Mar 2018 23:39:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D09A64072459; Mon, 26 Mar 2018 03:39:57 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-110.pek2.redhat.com [10.72.12.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3108111DD01; Mon, 26 Mar 2018 03:39:52 +0000 (UTC) From: Jason Wang To: mst@redhat.com, virtualization@lists.linux-foundation.org Cc: kvm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Wang Subject: [RFC PATCH V2 6/8] virtio: introduce packed ring defines Date: Mon, 26 Mar 2018 11:38:51 +0800 Message-Id: <1522035533-11786-7-git-send-email-jasowang@redhat.com> In-Reply-To: <1522035533-11786-1-git-send-email-jasowang@redhat.com> References: <1522035533-11786-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 26 Mar 2018 03:39:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 26 Mar 2018 03:39:57 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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