From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 40E841B8BE for ; Sat, 30 Jun 2018 04:18:14 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 19:18:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,288,1526367600"; d="scan'208";a="236764643" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.228]) by orsmga005.jf.intel.com with ESMTP; 29 Jun 2018 19:18:09 -0700 Date: Sat, 30 Jun 2018 10:18:11 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: zhihong.wang@intel.com, jfreimann@redhat.com, dev@dpdk.org, mst@redhat.com, jasowang@redhat.com, wexu@redhat.com, Yuanhan Liu , Jens Freimann Message-ID: <20180630021811.GA5533@debian> References: <20180622134327.18973-1-maxime.coquelin@redhat.com> <20180622134327.18973-4-maxime.coquelin@redhat.com> <20180629155929.GC31010@debian> <33a0f9cb-d672-826a-2587-5e91b83ade2f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <33a0f9cb-d672-826a-2587-5e91b83ade2f@redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) Subject: Re: [dpdk-dev] [PATCH v5 03/15] vhost: vring address setup 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: Sat, 30 Jun 2018 02:18:15 -0000 On Fri, Jun 29, 2018 at 06:34:09PM +0200, Maxime Coquelin wrote: > On 06/29/2018 05:59 PM, Tiwei Bie wrote: > > On Fri, Jun 22, 2018 at 03:43:15PM +0200, Maxime Coquelin wrote: [...] > > > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > > > index 34a614c97..671b4b3bf 100644 > > > --- a/lib/librte_vhost/vhost.h > > > +++ b/lib/librte_vhost/vhost.h > > > @@ -84,7 +84,10 @@ struct log_cache_entry { > > > * Structure contains variables relevant to RX/TX virtqueues. > > > */ > > > struct vhost_virtqueue { > > > - struct vring_desc *desc; > > > + union { > > > + struct vring_desc *desc; > > > + struct vring_desc_packed *desc_packed; > > > + }; > > > struct vring_avail *avail; > > > struct vring_used *used; > > > uint32_t size; > > > @@ -122,6 +125,8 @@ struct vhost_virtqueue { > > > struct batch_copy_elem *batch_copy_elems; > > > uint16_t batch_copy_nb_elems; > > > + uint16_t used_wrap_counter; > > > + uint16_t avail_wrap_counter; > > > > Not quite sure about this. Do you think it will be > > better to define wrap counters as bool (as only 0 or > > 1 are available)? > > I think it should work, but not sure this is cleaner. > > When defining something as bool, I expect to use true or false > for its assignment, but maybe that's me. > > But I could certainly use uint8_t instead to reduce the size of the > struct. > > What do you think? I don't have a strong opinion on this. Jason suggested me to use bool in my patch [1]. So I wanted to hear your opinion too. [1] https://lkml.org/lkml/2018/5/29/47 Best regards, Tiwei Bie