Received: by 10.223.185.116 with SMTP id b49csp4708830wrg; Tue, 27 Feb 2018 00:56:55 -0800 (PST) X-Google-Smtp-Source: AG47ELtXxYI+qK4b+23kblVu6f+6yC78BGn34aJtUPqlP6RAzAjwsyZTukTveE7GENiJITjhcFBq X-Received: by 2002:a17:902:599b:: with SMTP id p27-v6mr8616723pli.289.1519721815543; Tue, 27 Feb 2018 00:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519721815; cv=none; d=google.com; s=arc-20160816; b=tKwIuqzuSDUWp17C7wztK7KhLgkbCwZEKGgs8EqUk3GnBPRORsZcXpZkZ/4GU8JZt0 WuphHztCIuCjTtQYR+alBOvbnYegxjFiALWrMe14X2t0m8OyC2LrhgBitEpnYEIbpEGw HLfFJQgOG7pl2ItRYxhmBnbst/JUrd1NllMIa1cExiot6kBAeIDkUF6DHJzuya5hqfb+ w4CBQj9d7rPEwhD8Gl08moffezFjYSunddXZubaq8IBA3GSE4DUQ8AAm0zgsOXUxXwt2 B/zEK9q/srhGH4K8QOe5RrA2Uh09jwPb8reD9qvSrjpDJjJMjI/ZHNiNkvRw5sHE1ou6 Aryw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=2kyE2VUnp/lFO3bz9Jj1bZcINuKo8w1+GXZW9uU+5Ag=; b=bNH24oEVlGL9vd2FlE9+TpLfNHT3KI1en9Lsln2hSpUkqsrXV6OztMeVvcHSPMyC37 JUjdsAyzEgWz+1at+7tZcBcgr+X7Fjvd1jGyrrKQXDJxV0ADLQ8S6PUdjGS3p0YiPmXn y9diPMPLegX4FcbAGO5PX9zRqY6XUhK8lmRuvWHozQc6RAkXLLkZ/oopFb7xpVvbBvdP jvlmnlj1uzjHdvhAlJe6rGCBaTjiXc8Bg0LLD19PRg5j1AkoV4lMdk+Z7z/3fMLzNzGK 88kQ42G6cXbwjrDV6g9M4gqDsnjGgX8eBhsIXQncgDhKtr/U6gaVMV/i4u4i201a6Bk8 TJ0w== 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 b8-v6si8258297ple.246.2018.02.27.00.56.40; Tue, 27 Feb 2018 00:56:55 -0800 (PST) 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 S1752475AbeB0Iz1 (ORCPT + 99 others); Tue, 27 Feb 2018 03:55:27 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752392AbeB0IzF (ORCPT ); Tue, 27 Feb 2018 03:55:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CED88D776; Tue, 27 Feb 2018 08:55:04 +0000 (UTC) Received: from localhost (dhcp-192-241.str.redhat.com [10.33.192.241]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AEB781C733; Tue, 27 Feb 2018 08:54:59 +0000 (UTC) Date: Tue, 27 Feb 2018 09:54:58 +0100 From: Jens Freimann To: Tiwei Bie Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jasowang@redhat.com, wexu@redhat.com Subject: Re: [PATCH RFC 1/2] virtio: introduce packed ring defines Message-ID: <20180227085458.h5dytkwaeczrrijr@dhcp-192-241.str.redhat.com> References: <20180223111801.15240-1-tiwei.bie@intel.com> <20180223111801.15240-2-tiwei.bie@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180223111801.15240-2-tiwei.bie@intel.com> User-Agent: NeoMutt/20171215 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Feb 2018 08:55:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 27 Feb 2018 08:55:04 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jfreimann@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 07:18:00PM +0800, Tiwei Bie wrote: >Signed-off-by: Tiwei Bie >--- > include/uapi/linux/virtio_config.h | 18 +++++++++- > include/uapi/linux/virtio_ring.h | 68 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 85 insertions(+), 1 deletion(-) > >diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h >index 308e2096291f..e3d077ef5207 100644 >--- a/include/uapi/linux/virtio_config.h >+++ b/include/uapi/linux/virtio_config.h >@@ -49,7 +49,7 @@ > * transport being used (eg. virtio_ring), the rest are per-device feature > * bits. */ > #define VIRTIO_TRANSPORT_F_START 28 >-#define VIRTIO_TRANSPORT_F_END 34 >+#define VIRTIO_TRANSPORT_F_END 37 > > #ifndef VIRTIO_CONFIG_NO_LEGACY > /* Do we get callbacks when the ring is completely used, even if we've >@@ -71,4 +71,20 @@ > * this is for compatibility with legacy systems. > */ > #define VIRTIO_F_IOMMU_PLATFORM 33 >+ >+/* This feature indicates support for the packed virtqueue layout. */ >+#define VIRTIO_F_RING_PACKED 34 Spec says VIRTIO_F_PACKED_RING not RING_PACKED >+ >+/* >+ * 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 >+ >+/* >+ * This feature indicates that drivers pass extra data (besides >+ * identifying the Virtqueue) in their device notifications. >+ */ >+#define VIRTIO_F_NOTIFICATION_DATA 36 >+ > #endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ >diff --git a/include/uapi/linux/virtio_ring.h b/include/uapi/linux/virtio_ring.h >index 6d5d5faa989b..77b1d4aeef72 100644 >--- a/include/uapi/linux/virtio_ring.h >+++ b/include/uapi/linux/virtio_ring.h >@@ -44,6 +44,9 @@ > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > >+#define VRING_DESC_F_AVAIL(b) ((b) << 7) >+#define VRING_DESC_F_USED(b) ((b) << 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 > * will still kick if it's out of buffers. */ >@@ -104,6 +107,36 @@ struct vring { > struct vring_used *used; > }; > >+struct vring_packed_desc_event { >+ /* Descriptor Event Offset */ >+ __virtio16 desc_event_off : 15, >+ /* Descriptor Event Wrap Counter */ >+ desc_event_wrap : 1; >+ /* Descriptor Event Flags */ >+ __virtio16 desc_event_flags : 2; >+}; Where would the virtqueue number go in driver notifications? regards, Jens