From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yliu@fridaylinux.org>
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 03C171B7F5
 for <dev@dpdk.org>; Mon, 29 Jan 2018 15:24:57 +0100 (CET)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 8E0F420D7E;
 Mon, 29 Jan 2018 09:24:57 -0500 (EST)
Received: from frontend2 ([10.202.2.161])
 by compute1.internal (MEProxy); Mon, 29 Jan 2018 09:24:57 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org;
 h=cc:content-type:date:from:in-reply-to:message-id:mime-version
 :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm2; bh=1T3CZyX3cKf3QrENUmtBYX1yMM+jRTiU6jbxgKfMHpY=; b=Xoh4/lV2
 6zUBC/heKzwC19MPR65jP69pncCt3Sr64tXVxYE+KMLo0/NsdEKeHzpylqgOcbou
 +ts3ZMQyIq8h5ajMTgPdTSyuhSD6Limbv3CA372WQwMsuRA78XfA2hmePbdkHIbO
 TdUfjTByDf+nnO3h9crdapFfwXm57KLAS1e/InQIIHGyZp37evJzxaOVEeA8AQzh
 p1r60ULuB2Dz7o1KLemMEU4ajVxhIhC7+Sf2+22KqY+snDUvK3ASmDXMMVpwtXCE
 tr+/r5cSBQ/Of0dLiPUZgaKrUCxDSdZKboblyLluTAaPrVveRpvHl1okSnfDMvWA
 sI1k0vRk6k27qw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; bh=1T3CZyX3cKf3QrENUmtBYX1yMM+jR
 TiU6jbxgKfMHpY=; b=T44HHxmgV7ifce8k8y2ZufmiNL0suDneG5/wK09dLARm5
 6aPnbj6oj6Ib0HlyUlz8A+YrUkqHjjy3vG+sxWyvz+sZLJAIP9KVbd/fsArtEZ3z
 Up0NNZPECY57Ap182t9JYMzp0GemuypAebTQ89vnKjiuJYPDq/og+/5Cd1KgaO1e
 QHOzMkttqYMJOpag7vDqIjJvawv9lwUsXWaaMqtIIt7H9rTe20qT+w6J5LH8k36Q
 Nf2EL2XmpOhrzH4AhvWMUk9jxTnJFcnb7TPCYH59dtPDK+jVGFSir/5cZ7WSn+5F
 c50FbW4WJa7fbCwqZPAC113rSq5A6hrKvZ1MoJkSw==
X-ME-Sender: <xms:uS5vWtlQ1XY15WseGLf4Srbnqj1V0n3BfH7WWlAK4dbQ_FVt7g0qQA>
Received: from yliu-mob (unknown [220.177.86.229])
 by mail.messagingengine.com (Postfix) with ESMTPA id 4410A241E0;
 Mon, 29 Jan 2018 09:24:55 -0500 (EST)
Date: Mon, 29 Jan 2018 22:24:49 +0800
From: Yuanhan Liu <yliu@fridaylinux.org>
To: Jens Freimann <jfreimann@redhat.com>
Cc: dev@dpdk.org, tiwei.bie@intel.com, maxime.coquelin@redhat.com,
 mst@redhat.com
Message-ID: <20180129142449.GL29540@yliu-mob>
References: <20180129141143.13437-1-jfreimann@redhat.com>
 <20180129141143.13437-10-jfreimann@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20180129141143.13437-10-jfreimann@redhat.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Subject: Re: [dpdk-dev] [PATCH 09/14] vhost: add virtio 1.1 defines
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 29 Jan 2018 14:24:58 -0000

On Mon, Jan 29, 2018 at 03:11:38PM +0100, Jens Freimann wrote:
> This should actually be in the kernel header file, but it isn't
> yet. For now let's use our own headers.
> 
> Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> ---
>  lib/librte_vhost/vhost.h      |  4 +++-
>  lib/librte_vhost/virtio-1.1.h | 20 ++++++++++++++++++++
>  2 files changed, 23 insertions(+), 1 deletion(-)
>  create mode 100644 lib/librte_vhost/virtio-1.1.h
> 
> diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
> index e52a9b69c..152e8bce1 100644
> --- a/lib/librte_vhost/vhost.h
> +++ b/lib/librte_vhost/vhost.h
> @@ -167,7 +167,9 @@ struct vhost_msg {
>  #ifndef VIRTIO_F_VERSION_1
>   #define VIRTIO_F_VERSION_1 32
>  #endif
> -
> +#ifndef VIRTIO_F_PACKED
> + #define VIRTIO_F_PACKED 34
> +#endif
>  #define VHOST_USER_F_PROTOCOL_FEATURES	30
>  
>  /* Features supported by this builtin vhost-user net driver. */
> diff --git a/lib/librte_vhost/virtio-1.1.h b/lib/librte_vhost/virtio-1.1.h
> new file mode 100644
> index 000000000..5ca0bc33f
> --- /dev/null
> +++ b/lib/librte_vhost/virtio-1.1.h
> @@ -0,0 +1,20 @@
> +#ifndef __VIRTIO_1_1_H
> +#define __VIRTIO_1_1_H
> +
> +#define VRING_DESC_F_NEXT       1
> +#define VRING_DESC_F_WRITE      2
> +#define VRING_DESC_F_INDIRECT   4
> +
> +#define VIRTQ_DESC_F_AVAIL      7
> +#define VIRTQ_DESC_F_USED      15
> +#define DESC_USED               (1ULL << VIRTQ_DESC_F_USED)
> +#define DESC_AVAIL              (1ULL << VIRTQ_DESC_F_AVAIL)
> +
> +struct vring_desc_1_1 {

Is it how it's named in the spec? If not, I'm wondering "vring_desc_packed"
might be a better name?

If so, we could rename others, like rename "_dequeue_1_1" to "_dequeue_packed".

	--yliu

> +	uint64_t addr;
> +	uint32_t len;
> +	uint16_t index;
> +	uint16_t flags;
> +};
> +
> +#endif /* __VIRTIO_1_1_H */
> -- 
> 2.14.3