From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 3C1981B0FF for ; Thu, 25 Oct 2018 17:13:03 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9478D307D84F; Thu, 25 Oct 2018 15:13:02 +0000 (UTC) Received: from localhost (ovpn-116-124.ams2.redhat.com [10.36.116.124]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3159F1974A; Thu, 25 Oct 2018 15:12:50 +0000 (UTC) Date: Thu, 25 Oct 2018 17:12:48 +0200 From: Jens Freimann To: Maxime Coquelin Cc: Tiwei Bie , dev@dpdk.org, zhihong.wang@intel.com Message-ID: <20181025151248.pro7sewkv4tjkkgk@jenstp.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <931e66a9-5f22-e241-0cbe-4640698543ec@redhat.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 25 Oct 2018 15:13:02 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v9 1/8] 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: Thu, 25 Oct 2018 15:13:03 -0000 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. regards, Jens