From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 23:03:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,426,1534834800"; d="scan'208";a="244510423" Received: from btwcube1.sh.intel.com (HELO debian) ([10.67.104.158]) by orsmga004.jf.intel.com with ESMTP; 25 Oct 2018 23:03:16 -0700 Date: Fri, 26 Oct 2018 14:01:54 +0800 From: Tiwei Bie To: Jens Freimann Cc: Maxime Coquelin , dev@dpdk.org, zhihong.wang@intel.com 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 Content-Disposition: inline In-Reply-To: <20181025151248.pro7sewkv4tjkkgk@jenstp.localdomain> User-Agent: Mutt/1.10.1 (2018-07-13) 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: Fri, 26 Oct 2018 06:03:21 -0000 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.