From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9650D5F1F for ; Mon, 19 Mar 2018 09:05:31 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2018 01:05:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,329,1517904000"; d="scan'208";a="26029590" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by orsmga007.jf.intel.com with ESMTP; 19 Mar 2018 01:05:29 -0700 Date: Mon, 19 Mar 2018 16:03:55 +0800 From: Tiwei Bie To: Jens Freimann Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com Message-ID: <20180319080354.67eitmyraiqve3v2@debian> References: <20180316152120.13199-1-jfreimann@redhat.com> <20180316152120.13199-2-jfreimann@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180316152120.13199-2-jfreimann@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 01/17] net/virtio: vring init for packed queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Mar 2018 08:05:33 -0000 On Fri, Mar 16, 2018 at 04:21:04PM +0100, Jens Freimann wrote: > Add and initialize descriptor data structures. > > Signed-off-by: Jens Freimann > --- [...] > --- a/drivers/net/virtio/virtio_ring.h > +++ b/drivers/net/virtio/virtio_ring.h > @@ -9,6 +9,7 @@ > > #include > > + There is no need to add this blank line. > /* This marks a buffer as continuing via the next field. */ > #define VRING_DESC_F_NEXT 1 > /* This marks a buffer as write-only (otherwise read-only). */ > @@ -54,11 +55,23 @@ struct vring_used { > struct vring_used_elem ring[0]; > }; [...] > struct vring { > unsigned int num; > struct vring_desc *desc; > struct vring_avail *avail; > struct vring_used *used; > + struct vring_desc_packed *desc_packed; Maybe it's better to use anonymous union here. > }; > > /* The standard layout for the ring is a continuous chunk of memory which > @@ -95,10 +108,13 @@ struct vring { > #define vring_avail_event(vr) (*(uint16_t *)&(vr)->used->ring[(vr)->num]) > > static inline size_t > -vring_size(unsigned int num, unsigned long align) > +vring_size(struct virtio_hw *hw, unsigned int num, unsigned long align) > { > size_t size; > > + if (vtpci_packed_queue(hw)) > + return num * sizeof(struct vring_desc_packed); > + Besides the descriptors, the ring also contains event suppression structures. Thanks