From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <tiwei.bie@intel.com>
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id CD9C11BEDE
 for <dev@dpdk.org>; Thu,  5 Jul 2018 16:36:15 +0200 (CEST)
X-Amp-Result: UNKNOWN
X-Amp-Original-Verdict: FILE UNKNOWN
X-Amp-File-Uploaded: False
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 05 Jul 2018 07:36:15 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.51,312,1526367600"; d="scan'208";a="64407097"
Received: from debian.sh.intel.com (HELO debian) ([10.67.104.228])
 by fmsmga002.fm.intel.com with ESMTP; 05 Jul 2018 07:36:13 -0700
Date: Thu, 5 Jul 2018 22:36:01 +0800
From: Tiwei Bie <tiwei.bie@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: zhihong.wang@intel.com, jfreimann@redhat.com, dev@dpdk.org,
 mst@redhat.com, jasowang@redhat.com, wexu@redhat.com
Message-ID: <20180705143601.GA11563@debian>
References: <20180704215438.5579-1-maxime.coquelin@redhat.com>
 <20180704215438.5579-10-maxime.coquelin@redhat.com>
 <20180705071508.GA21112@debian>
 <7b2e9f2f-cefd-c4d5-2995-28f3353e49b4@redhat.com>
 <20180705140351.GA28449@debian>
 <f7362df4-50c0-32fa-00db-6e356cce0e9f@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <f7362df4-50c0-32fa-00db-6e356cce0e9f@redhat.com>
User-Agent: Mutt/1.10.0 (2018-05-17)
Subject: Re: [dpdk-dev] [PATCH v7 09/15] vhost: add shadow used ring support
 for packed rings
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2018 14:36:16 -0000

On Thu, Jul 05, 2018 at 04:28:20PM +0200, Maxime Coquelin wrote:
> On 07/05/2018 04:03 PM, Tiwei Bie wrote:
> > On Thu, Jul 05, 2018 at 02:49:34PM +0200, Maxime Coquelin wrote:
> > > On 07/05/2018 09:15 AM, Tiwei Bie wrote:
> > > > On Wed, Jul 04, 2018 at 11:54:32PM +0200, Maxime Coquelin wrote:
> > > > [...]
> > > > > +
> > > > > +static __rte_always_inline void
> > > > > +flush_shadow_used_ring_packed(struct virtio_net *dev,
> > > > > +			struct vhost_virtqueue *vq)
> > > > > +{
> > > > [...]
> > > > > +}
> > > > > +
> > > > > +static __rte_always_inline void
> > > > > +update_shadow_used_ring_packed(struct vhost_virtqueue *vq,
> > > > > +			 uint16_t desc_idx, uint16_t len, uint16_t count)
> > > > > +{
> > > > > +	uint16_t i = vq->shadow_used_idx++;
> > > > > +
> > > > > +	vq->shadow_used_packed[i].id  = desc_idx;
> > > > > +	vq->shadow_used_packed[i].len = len;
> > > > > +	vq->shadow_used_packed[i].count = count;
> > > > >    }
> > > > 
> > > > I met below build errors in this patch when doing
> > > > per-patch build test with clang:
> > > > 
> > > > lib/librte_vhost/virtio_net.c:134:1: error: unused function 'flush_shadow_used_ring_packed'
> > > >         [-Werror,-Wunused-function]
> > > > flush_shadow_used_ring_packed(struct virtio_net *dev,
> > > > ^
> > > > lib/librte_vhost/virtio_net.c:188:1: error: unused function 'update_shadow_used_ring_packed'
> > > >         [-Werror,-Wunused-function]
> > > > update_shadow_used_ring_packed(struct vhost_virtqueue *vq,
> > > > ^
> > > > 
> > > > It's better to add __rte_unused in this patch,
> > > > and remove it when functions are used.
> > > > 
> > > > PS. I also saw similar errors with fill_vec_buf_packed()
> > > >       in patch 11/15.
> > > > 
> > > 
> > > Thanks for the report, I missed these build issues...
> > > This is not fixed using __rte_unused as you suggested.
> > > 
> Oops, I meant "This *now* fixed using __rte_unused" :)

Got it! :)


> 
> > 
> > Why not? This can be fixed by something like this
> > on my machine:
> > 
> > -static __rte_always_inline void
> > +static __rte_always_inline __rte_unused void
> >   flush_shadow_used_ring_packed(struct virtio_net *dev,
> >   			struct vhost_virtqueue *vq)
> >   {
> > 
> > And __rte_unused can be removed in the patch that
> > above function is called.
> > 
> > Best regards,
> > Tiwei Bie
> >