From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v9 1/8] net/virtio: vring init for packed queues Date: Fri, 26 Oct 2018 14:01:54 +0800 Message-ID: <20181026060154.GB31861@debian> References: <20181024143236.21271-1-jfreimann@redhat.com> <20181024143236.21271-2-jfreimann@redhat.com> <20181025092115.GA22179@debian> <20181025134737.vzstdn5td7b55nej@jenstp.localdomain> <931e66a9-5f22-e241-0cbe-4640698543ec@redhat.com> <20181025151248.pro7sewkv4tjkkgk@jenstp.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Maxime Coquelin , dev@dpdk.org, zhihong.wang@intel.com To: Jens Freimann Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C13E55592 for ; Fri, 26 Oct 2018 08:03:18 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20181025151248.pro7sewkv4tjkkgk@jenstp.localdomain> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Oct 25, 2018 at 05:12:48PM +0200, Jens Freimann wrote: > On Thu, Oct 25, 2018 at 03:51:19PM +0200, Maxime Coquelin wrote: > > > > > > On 10/25/18 3:48 PM, Jens Freimann wrote: > > > On Thu, Oct 25, 2018 at 05:21:15PM +0800, Tiwei Bie wrote: > > > > On Wed, Oct 24, 2018 at 04:32:29PM +0200, Jens Freimann wrote: > > > > > Signed-off-by: Jens Freimann > > > > > ??struct vring { > > > > > ???????? unsigned int num; > > > > > -?????? struct vring_desc?? *desc; > > > > > -?????? struct vring_avail *avail; > > > > > -?????? struct vring_used?? *used; > > > > > +?????? union { > > > > > +?????????????? struct vring_desc_packed *desc_packed; > > > > > +?????????????? struct vring_desc *desc; > > > > > +?????? }; > > > > > +?????? union { > > > > > +?????????????? struct vring_avail *avail; > > > > > +?????????????? struct vring_packed_desc_event *driver_event; > > > > > +?????? }; > > > > > +?????? union { > > > > > +?????????????? struct vring_used?? *used; > > > > > +?????????????? struct vring_packed_desc_event *device_event; > > > > > +?????? }; > > > > > ??}; > > > > > > > > > > > > > We should define a new `vring` structure for packed ring. > > > > > > I think it was requested to have it as a union before, but I can do > > > it. > > > > I guess oyu vcan have a union between struct vring and struct > > vring_packed? > > Like this? > > struct vring { > unsigned int num; > union { > struct vring_split *split; > _ struct vring_packed *packed; > }; > }; > > We will have to write vq->vq_ring.split.avail->flags and > vq->vq_ring.packed.desc[xx] and similar things in a lot of places, no? > > Should we just add both vring_split and vring_packed to struct > virtqueue instead? Only one of them will have memory allocated per virtqueue > anyway. Yeah, we can add both to struct virtqueue.