[v5,05/11] net/virtio: dump packed virtqueue data
diff mbox series

Message ID 20180906181947.20646-6-jfreimann@redhat.com
State Superseded, archived
Delegated to: Maxime Coquelin
Headers show
Series
  • implement packed virtqueues
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

Jens Freimann Sept. 6, 2018, 6:19 p.m. UTC
Add support to dump packed virtqueue data to the
VIRTQUEUE_DUMP() macro.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
---
 drivers/net/virtio/virtqueue.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Gavin Hu Sept. 10, 2018, 6:02 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Jens Freimann
> Sent: Friday, September 7, 2018 2:20 AM
> To: dev@dpdk.org
> Cc: tiwei.bie@intel.com; maxime.coquelin@redhat.com
> Subject: [dpdk-dev] [PATCH v5 05/11] net/virtio: dump packed virtqueue
> data
>
> Add support to dump packed virtqueue data to the
> VIRTQUEUE_DUMP() macro.
>
> Signed-off-by: Jens Freimann <jfreimann@redhat.com>

Acked-by: Gavin Hu <gavin.hu@arm.com>

> ---
>  drivers/net/virtio/virtqueue.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
> index 53fce61b4..531ba8c65 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -384,6 +384,12 @@ virtqueue_notify(struct virtqueue *vq)
>  uint16_t used_idx, nused; \
>  used_idx = (vq)->vq_ring.used->idx; \
>  nused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \
> +if (vtpci_packed_queue((vq)->hw)) { \
> +  PMD_INIT_LOG(DEBUG, \
> +  "VQ: - size=%d; free=%d; last_used_idx=%d;", \
> +  (vq)->vq_nentries, (vq)->vq_free_cnt, nused); \
> +  break; \
> +} \
>  PMD_INIT_LOG(DEBUG, \
>    "VQ: - size=%d; free=%d; used=%d; desc_head_idx=%d;" \
>    " avail.idx=%d; used_cons_idx=%d; used.idx=%d;" \
> --
> 2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Tiwei Bie Sept. 10, 2018, 6:18 a.m. UTC | #2
On Mon, Sep 10, 2018 at 06:02:19AM +0000, Gavin Hu (Arm Technology China) wrote:
> 
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Jens Freimann
> > Sent: Friday, September 7, 2018 2:20 AM
> > To: dev@dpdk.org
> > Cc: tiwei.bie@intel.com; maxime.coquelin@redhat.com
> > Subject: [dpdk-dev] [PATCH v5 05/11] net/virtio: dump packed virtqueue
> > data
> >
> > Add support to dump packed virtqueue data to the
> > VIRTQUEUE_DUMP() macro.
> >
> > Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> 
> Acked-by: Gavin Hu <gavin.hu@arm.com>
> 
> > ---
> >  drivers/net/virtio/virtqueue.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
> > index 53fce61b4..531ba8c65 100644
> > --- a/drivers/net/virtio/virtqueue.h
> > +++ b/drivers/net/virtio/virtqueue.h
> > @@ -384,6 +384,12 @@ virtqueue_notify(struct virtqueue *vq)
> >  uint16_t used_idx, nused; \
> >  used_idx = (vq)->vq_ring.used->idx; \

The vq_ring.used doesn't exist in packed ring.

> >  nused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \

The nused can't be calculated in this way in
packed ring.

> > +if (vtpci_packed_queue((vq)->hw)) { \
> > +  PMD_INIT_LOG(DEBUG, \
> > +  "VQ: - size=%d; free=%d; last_used_idx=%d;", \
> > +  (vq)->vq_nentries, (vq)->vq_free_cnt, nused); \

And nused doesn't mean last_used_idx.

> > +  break; \
> > +} \
> >  PMD_INIT_LOG(DEBUG, \
> >    "VQ: - size=%d; free=%d; used=%d; desc_head_idx=%d;" \
> >    " avail.idx=%d; used_cons_idx=%d; used.idx=%d;" \
> > --
> > 2.17.1
> 
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Jens Freimann Sept. 11, 2018, 7:16 a.m. UTC | #3
On Mon, Sep 10, 2018 at 02:18:17PM +0800, Tiwei Bie wrote:
>On Mon, Sep 10, 2018 at 06:02:19AM +0000, Gavin Hu (Arm Technology China) wrote:
>>
>>
>> > -----Original Message-----
>> > From: dev <dev-bounces@dpdk.org> On Behalf Of Jens Freimann
>> > Sent: Friday, September 7, 2018 2:20 AM
>> > To: dev@dpdk.org
>> > Cc: tiwei.bie@intel.com; maxime.coquelin@redhat.com
>> > Subject: [dpdk-dev] [PATCH v5 05/11] net/virtio: dump packed virtqueue
>> > data
>> >
>> > Add support to dump packed virtqueue data to the
>> > VIRTQUEUE_DUMP() macro.
>> >
>> > Signed-off-by: Jens Freimann <jfreimann@redhat.com>
>>
>> Acked-by: Gavin Hu <gavin.hu@arm.com>
>>
>> > ---
>> >  drivers/net/virtio/virtqueue.h | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
>> > index 53fce61b4..531ba8c65 100644
>> > --- a/drivers/net/virtio/virtqueue.h
>> > +++ b/drivers/net/virtio/virtqueue.h
>> > @@ -384,6 +384,12 @@ virtqueue_notify(struct virtqueue *vq)
>> >  uint16_t used_idx, nused; \
>> >  used_idx = (vq)->vq_ring.used->idx; \
>
>The vq_ring.used doesn't exist in packed ring.
>
>> >  nused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \
>
>The nused can't be calculated in this way in
>packed ring.

you're right, this doesn't work. I will fix it and test properly.

regards,
Jens
Maxime Coquelin Sept. 12, 2018, 9:13 a.m. UTC | #4
On 09/06/2018 08:19 PM, Jens Freimann wrote:
> Add support to dump packed virtqueue data to the
> VIRTQUEUE_DUMP() macro.
> 
> Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> ---
>   drivers/net/virtio/virtqueue.h | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
> index 53fce61b4..531ba8c65 100644
> --- a/drivers/net/virtio/virtqueue.h
> +++ b/drivers/net/virtio/virtqueue.h
> @@ -384,6 +384,12 @@ virtqueue_notify(struct virtqueue *vq)
>   	uint16_t used_idx, nused; \
>   	used_idx = (vq)->vq_ring.used->idx; \
>   	nused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \
> +	if (vtpci_packed_queue((vq)->hw)) { \
> +	  PMD_INIT_LOG(DEBUG, \
> +	  "VQ: - size=%d; free=%d; last_used_idx=%d;", \
> +	  (vq)->vq_nentries, (vq)->vq_free_cnt, nused); \
> +	  break; \
> +	} \
>   	PMD_INIT_LOG(DEBUG, \
>   	  "VQ: - size=%d; free=%d; used=%d; desc_head_idx=%d;" \
>   	  " avail.idx=%d; used_cons_idx=%d; used.idx=%d;" \
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

Patch
diff mbox series

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 53fce61b4..531ba8c65 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -384,6 +384,12 @@  virtqueue_notify(struct virtqueue *vq)
 	uint16_t used_idx, nused; \
 	used_idx = (vq)->vq_ring.used->idx; \
 	nused = (uint16_t)(used_idx - (vq)->vq_used_cons_idx); \
+	if (vtpci_packed_queue((vq)->hw)) { \
+	  PMD_INIT_LOG(DEBUG, \
+	  "VQ: - size=%d; free=%d; last_used_idx=%d;", \
+	  (vq)->vq_nentries, (vq)->vq_free_cnt, nused); \
+	  break; \
+	} \
 	PMD_INIT_LOG(DEBUG, \
 	  "VQ: - size=%d; free=%d; used=%d; desc_head_idx=%d;" \
 	  " avail.idx=%d; used_cons_idx=%d; used.idx=%d;" \