From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v3 05/21] net/virtio: dump packed virtqueue data Date: Sun, 8 Apr 2018 11:53:52 +0800 Message-ID: <20180408035351.cjuoo3uxef6h76tw@debian> References: <20180405101031.26468-1-jfreimann@redhat.com> <20180405101031.26468-6-jfreimann@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, mst@redhat.com To: Jens Freimann Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C86771C82E for ; Sun, 8 Apr 2018 05:55:56 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20180405101031.26468-6-jfreimann@redhat.com> 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, Apr 05, 2018 at 12:10:15PM +0200, Jens Freimann wrote: > Add support to dump packed virtqueue data to the > VIRTQUEUE_DUMP() macro. > > Signed-off-by: Jens Freimann > --- > drivers/net/virtio/virtqueue.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h > index cc2e7c0f6..7e265bf93 100644 > --- a/drivers/net/virtio/virtqueue.h > +++ b/drivers/net/virtio/virtqueue.h > @@ -360,6 +360,13 @@ virtqueue_notify(struct virtqueue *vq) > > #ifdef RTE_LIBRTE_VIRTIO_DEBUG_DUMP > #define VIRTQUEUE_DUMP(vq) do { \ > + if (vtpci_packed_queue((vq)->hw)) { \ > + PMD_INIT_LOG(DEBUG, \ > + "VQ: - size=%d; free=%d; last_used_idx=%d;" \ You missed the `,` after the format string. > + (vq)->vq_nentries, (vq)->vq_free_cnt, nused); \ There is no way to make sure that nused (the last param in PMD_INIT_LOG()) will be defined and have the meaning of last_used_idx. It's not the right way to use a variable in MACRO. > + break; \ > + } \ > + if (vtpci_packed_queue((vq)->hw)) break; \ Why do the check twice? > uint16_t used_idx, nused; \ > used_idx = (vq)->vq_ring.used->idx; \ > nused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \ > -- > 2.14.3 >