Received: by 10.223.185.116 with SMTP id b49csp5391254wrg; Tue, 27 Feb 2018 12:29:19 -0800 (PST) X-Google-Smtp-Source: AH8x224Vn4rTl1FLZitxEo8cSv/mphzL74YlKPaKybtlGVK6KK9pBso+ZwJgv2ULvdr7FXb9EFkm X-Received: by 10.98.134.10 with SMTP id x10mr15283628pfd.78.1519763359360; Tue, 27 Feb 2018 12:29:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519763359; cv=none; d=google.com; s=arc-20160816; b=02JNwih1wgVywjbk8ajwC6AOLexcZW/GTS+yuONBwGnUZ9HcZ28f7E/8npsqdBOATV BM3YEGLLKptxuyUNOyD0PVHiXJ6CU6YjEGDRX5pAhYiMnh5dmD5mUiVOqPOD/qtOOh+y 5EbXApLW8GyLhUHa2G2gi/m7AvQRryfIXKPVbddUS23oddMZXhFSVojSc+LSHiTBJXRS j+4rWzcUMM+HA0ZfhFYCJrqMoHnIBt+tk/Gn1espsdnxUDkfAbfFgny7u8psWQCKFbOq xkfCg+SofdtV9wwbdfeD4FDknCPvm0HXVbY0wuloiV+lNN3bg7pmBabHYE4bUyKhOwtU xZPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gRRoF29mW0RbiB8N/kNt7PHOTVZTIazrCJk2Yni1cKs=; b=MWX3Yeh66VsKvMmwlo69uGToH/O5KaNQDnPTq/F+RiSILmZw1zBIzuXGLdf/chFwap n0vBiDSRFCiS2rWqhLZ2NYlnIvyuMxktCYQUorBkQH8oDk2lbf8yvm92AcFbz8s1CfrY yZpd+przH8TyNu61mCEeNQaZqgpfoAHVPPpOTRDqaWUfqWF4ebX6xI7h6sJx9UyeGwiC OwTugREcWKNMGhLStqfzy9sWXkxwuUrSiYk/JznfyIAEWa52w057YQ2svadHt/Pu4Zer yoZLHo0bg5Nq7y+iK66NxTgJ2OdfyVwOG60rPch42AjgCNA1DY1nc+UAXXUHsHr4v89O yfXw== 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 b195si7434532pga.552.2018.02.27.12.29.04; Tue, 27 Feb 2018 12:29:19 -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 S1751927AbeB0U2V (ORCPT + 99 others); Tue, 27 Feb 2018 15:28:21 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43378 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751628AbeB0U2T (ORCPT ); Tue, 27 Feb 2018 15:28:19 -0500 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 5A46240363BE; Tue, 27 Feb 2018 20:28:19 +0000 (UTC) Received: from redhat.com (ovpn-123-220.rdu2.redhat.com [10.10.123.220]) by smtp.corp.redhat.com (Postfix) with SMTP id F364120A846E; Tue, 27 Feb 2018 20:28:18 +0000 (UTC) Date: Tue, 27 Feb 2018 22:28:18 +0200 From: "Michael S. Tsirkin" To: Jens Freimann Cc: Tiwei Bie , 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: <20180227222806-mutt-send-email-mst@kernel.org> References: <20180223111801.15240-1-tiwei.bie@intel.com> <20180223111801.15240-2-tiwei.bie@intel.com> <20180227085458.h5dytkwaeczrrijr@dhcp-192-241.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180227085458.h5dytkwaeczrrijr@dhcp-192-241.str.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.5]); Tue, 27 Feb 2018 20:28:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 27 Feb 2018 20:28:19 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 27, 2018 at 09:54:58AM +0100, Jens Freimann wrote: > 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 I changed that now :) > > + > > +/* > > + * 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