DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/virtio: add queue and port ID in some logs
@ 2022-09-29 12:22 Olivier Matz
  2022-10-06 13:12 ` Maxime Coquelin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Olivier Matz @ 2022-09-29 12:22 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia

Add the queue id and/or the port id in some logs, so it is easier to
understand what happens.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 drivers/net/virtio/virtio_ethdev.c | 6 ++++--
 drivers/net/virtio/virtio_rxtx.c   | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 7e07270a8b..44811c299b 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2807,7 +2807,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
 			return -EINVAL;
 	}
 
-	PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues);
+	PMD_INIT_LOG(DEBUG, "nb_queues=%d (port=%d)", nb_queues,
+		     dev->data->port_id);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
@@ -2821,7 +2822,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		virtqueue_notify(vq);
 	}
 
-	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
+	PMD_INIT_LOG(DEBUG, "Notified backend at initialization (port=%d)",
+		     dev->data->port_id);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 4795893ec7..f8a9ee5cdb 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -793,7 +793,8 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
 			vq_update_avail_idx(vq);
 	}
 
-	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
+	PMD_INIT_LOG(DEBUG, "Allocated %d bufs (port=%d queue=%d)", nbufs,
+		     dev->data->port_id, queue_idx);
 
 	VIRTQUEUE_DUMP(vq);
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net/virtio: add queue and port ID in some logs
  2022-09-29 12:22 [PATCH] net/virtio: add queue and port ID in some logs Olivier Matz
@ 2022-10-06 13:12 ` Maxime Coquelin
  2022-10-17  6:58 ` Xia, Chenbo
  2022-10-17  8:00 ` [PATCH v2] " Olivier Matz
  2 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2022-10-06 13:12 UTC (permalink / raw)
  To: Olivier Matz, dev; +Cc: Chenbo Xia



On 9/29/22 14:22, Olivier Matz wrote:
> Add the queue id and/or the port id in some logs, so it is easier to
> understand what happens.
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 6 ++++--
>   drivers/net/virtio/virtio_rxtx.c   | 3 ++-
>   2 files changed, 6 insertions(+), 3 deletions(-)
> 

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

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] net/virtio: add queue and port ID in some logs
  2022-09-29 12:22 [PATCH] net/virtio: add queue and port ID in some logs Olivier Matz
  2022-10-06 13:12 ` Maxime Coquelin
@ 2022-10-17  6:58 ` Xia, Chenbo
  2022-10-17  7:38   ` Olivier Matz
  2022-10-17  8:00 ` [PATCH v2] " Olivier Matz
  2 siblings, 1 reply; 7+ messages in thread
From: Xia, Chenbo @ 2022-10-17  6:58 UTC (permalink / raw)
  To: Matz, Olivier, dev; +Cc: Maxime Coquelin

Hi Olivier,

> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Thursday, September 29, 2022 8:22 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>
> Subject: [PATCH] net/virtio: add queue and port ID in some logs
> 
> Add the queue id and/or the port id in some logs, so it is easier to
> understand what happens.
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> ---
>  drivers/net/virtio/virtio_ethdev.c | 6 ++++--
>  drivers/net/virtio/virtio_rxtx.c   | 3 ++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index 7e07270a8b..44811c299b 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -2807,7 +2807,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
>  			return -EINVAL;
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues);
> +	PMD_INIT_LOG(DEBUG, "nb_queues=%d (port=%d)", nb_queues,
> +		     dev->data->port_id);

Better to use %u for all port_id since it's uint16_t

Thanks,
Chenbo

> 
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> @@ -2821,7 +2822,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
>  		virtqueue_notify(vq);
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
> +	PMD_INIT_LOG(DEBUG, "Notified backend at initialization (port=%d)",
> +		     dev->data->port_id);
> 
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> diff --git a/drivers/net/virtio/virtio_rxtx.c
> b/drivers/net/virtio/virtio_rxtx.c
> index 4795893ec7..f8a9ee5cdb 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -793,7 +793,8 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev
> *dev, uint16_t queue_idx)
>  			vq_update_avail_idx(vq);
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
> +	PMD_INIT_LOG(DEBUG, "Allocated %d bufs (port=%d queue=%d)", nbufs,
> +		     dev->data->port_id, queue_idx);
> 
>  	VIRTQUEUE_DUMP(vq);
> 
> --
> 2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net/virtio: add queue and port ID in some logs
  2022-10-17  6:58 ` Xia, Chenbo
@ 2022-10-17  7:38   ` Olivier Matz
  0 siblings, 0 replies; 7+ messages in thread
From: Olivier Matz @ 2022-10-17  7:38 UTC (permalink / raw)
  To: Xia, Chenbo; +Cc: dev, Maxime Coquelin

Hi Chenbo,

On Mon, Oct 17, 2022 at 06:58:59AM +0000, Xia, Chenbo wrote:
> Hi Olivier,
> 
> > -----Original Message-----
> > From: Olivier Matz <olivier.matz@6wind.com>
> > Sent: Thursday, September 29, 2022 8:22 PM
> > To: dev@dpdk.org
> > Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> > <chenbo.xia@intel.com>
> > Subject: [PATCH] net/virtio: add queue and port ID in some logs
> > 
> > Add the queue id and/or the port id in some logs, so it is easier to
> > understand what happens.
> > 
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> > ---
> >  drivers/net/virtio/virtio_ethdev.c | 6 ++++--
> >  drivers/net/virtio/virtio_rxtx.c   | 3 ++-
> >  2 files changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/virtio/virtio_ethdev.c
> > b/drivers/net/virtio/virtio_ethdev.c
> > index 7e07270a8b..44811c299b 100644
> > --- a/drivers/net/virtio/virtio_ethdev.c
> > +++ b/drivers/net/virtio/virtio_ethdev.c
> > @@ -2807,7 +2807,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
> >  			return -EINVAL;
> >  	}
> > 
> > -	PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues);
> > +	PMD_INIT_LOG(DEBUG, "nb_queues=%d (port=%d)", nb_queues,
> > +		     dev->data->port_id);
> 
> Better to use %u for all port_id since it's uint16_t

Yes, will do.
I'll update "nb_queues=%d" too by the way.

> 
> Thanks,
> Chenbo
> 
> > 
> >  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
> >  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> > @@ -2821,7 +2822,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
> >  		virtqueue_notify(vq);
> >  	}
> > 
> > -	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
> > +	PMD_INIT_LOG(DEBUG, "Notified backend at initialization (port=%d)",
> > +		     dev->data->port_id);
> > 
> >  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
> >  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> > diff --git a/drivers/net/virtio/virtio_rxtx.c
> > b/drivers/net/virtio/virtio_rxtx.c
> > index 4795893ec7..f8a9ee5cdb 100644
> > --- a/drivers/net/virtio/virtio_rxtx.c
> > +++ b/drivers/net/virtio/virtio_rxtx.c
> > @@ -793,7 +793,8 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev
> > *dev, uint16_t queue_idx)
> >  			vq_update_avail_idx(vq);
> >  	}
> > 
> > -	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
> > +	PMD_INIT_LOG(DEBUG, "Allocated %d bufs (port=%d queue=%d)", nbufs,
> > +		     dev->data->port_id, queue_idx);
> > 
> >  	VIRTQUEUE_DUMP(vq);
> > 
> > --
> > 2.30.2
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] net/virtio: add queue and port ID in some logs
  2022-09-29 12:22 [PATCH] net/virtio: add queue and port ID in some logs Olivier Matz
  2022-10-06 13:12 ` Maxime Coquelin
  2022-10-17  6:58 ` Xia, Chenbo
@ 2022-10-17  8:00 ` Olivier Matz
  2022-10-17  8:19   ` Xia, Chenbo
  2022-10-26  9:09   ` Xia, Chenbo
  2 siblings, 2 replies; 7+ messages in thread
From: Olivier Matz @ 2022-10-17  8:00 UTC (permalink / raw)
  To: dev; +Cc: Maxime Coquelin, Chenbo Xia

Add the queue id and/or the port id in some logs, so it is easier to
understand what happens.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---

v2
* use %u instead of %d for unsigned types

 drivers/net/virtio/virtio_ethdev.c | 6 ++++--
 drivers/net/virtio/virtio_rxtx.c   | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 574f671158..760ba4e368 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2814,7 +2814,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
 			return -EINVAL;
 	}
 
-	PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues);
+	PMD_INIT_LOG(DEBUG, "nb_queues=%u (port=%u)", nb_queues,
+		     dev->data->port_id);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
@@ -2828,7 +2829,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
 		virtqueue_notify(vq);
 	}
 
-	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
+	PMD_INIT_LOG(DEBUG, "Notified backend at initialization (port=%u)",
+		     dev->data->port_id);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 4795893ec7..d9d40832e0 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -793,7 +793,8 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)
 			vq_update_avail_idx(vq);
 	}
 
-	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
+	PMD_INIT_LOG(DEBUG, "Allocated %d bufs (port=%u queue=%u)", nbufs,
+		     dev->data->port_id, queue_idx);
 
 	VIRTQUEUE_DUMP(vq);
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v2] net/virtio: add queue and port ID in some logs
  2022-10-17  8:00 ` [PATCH v2] " Olivier Matz
@ 2022-10-17  8:19   ` Xia, Chenbo
  2022-10-26  9:09   ` Xia, Chenbo
  1 sibling, 0 replies; 7+ messages in thread
From: Xia, Chenbo @ 2022-10-17  8:19 UTC (permalink / raw)
  To: Matz, Olivier, dev; +Cc: Maxime Coquelin

> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Monday, October 17, 2022 4:01 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>
> Subject: [PATCH v2] net/virtio: add queue and port ID in some logs
> 
> Add the queue id and/or the port id in some logs, so it is easier to
> understand what happens.
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> 
> v2
> * use %u instead of %d for unsigned types
> 
>  drivers/net/virtio/virtio_ethdev.c | 6 ++++--
>  drivers/net/virtio/virtio_rxtx.c   | 3 ++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index 574f671158..760ba4e368 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -2814,7 +2814,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
>  			return -EINVAL;
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues);
> +	PMD_INIT_LOG(DEBUG, "nb_queues=%u (port=%u)", nb_queues,
> +		     dev->data->port_id);
> 
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> @@ -2828,7 +2829,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
>  		virtqueue_notify(vq);
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
> +	PMD_INIT_LOG(DEBUG, "Notified backend at initialization (port=%u)",
> +		     dev->data->port_id);
> 
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> diff --git a/drivers/net/virtio/virtio_rxtx.c
> b/drivers/net/virtio/virtio_rxtx.c
> index 4795893ec7..d9d40832e0 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -793,7 +793,8 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev
> *dev, uint16_t queue_idx)
>  			vq_update_avail_idx(vq);
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
> +	PMD_INIT_LOG(DEBUG, "Allocated %d bufs (port=%u queue=%u)", nbufs,
> +		     dev->data->port_id, queue_idx);
> 
>  	VIRTQUEUE_DUMP(vq);
> 
> --
> 2.30.2

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH v2] net/virtio: add queue and port ID in some logs
  2022-10-17  8:00 ` [PATCH v2] " Olivier Matz
  2022-10-17  8:19   ` Xia, Chenbo
@ 2022-10-26  9:09   ` Xia, Chenbo
  1 sibling, 0 replies; 7+ messages in thread
From: Xia, Chenbo @ 2022-10-26  9:09 UTC (permalink / raw)
  To: Matz, Olivier, dev; +Cc: Maxime Coquelin

> -----Original Message-----
> From: Olivier Matz <olivier.matz@6wind.com>
> Sent: Monday, October 17, 2022 4:01 PM
> To: dev@dpdk.org
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>
> Subject: [PATCH v2] net/virtio: add queue and port ID in some logs
> 
> Add the queue id and/or the port id in some logs, so it is easier to
> understand what happens.
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> 
> v2
> * use %u instead of %d for unsigned types
> 
>  drivers/net/virtio/virtio_ethdev.c | 6 ++++--
>  drivers/net/virtio/virtio_rxtx.c   | 3 ++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_ethdev.c
> b/drivers/net/virtio/virtio_ethdev.c
> index 574f671158..760ba4e368 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -2814,7 +2814,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
>  			return -EINVAL;
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues);
> +	PMD_INIT_LOG(DEBUG, "nb_queues=%u (port=%u)", nb_queues,
> +		     dev->data->port_id);
> 
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> @@ -2828,7 +2829,8 @@ virtio_dev_start(struct rte_eth_dev *dev)
>  		virtqueue_notify(vq);
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "Notified backend at initialization");
> +	PMD_INIT_LOG(DEBUG, "Notified backend at initialization (port=%u)",
> +		     dev->data->port_id);
> 
>  	for (i = 0; i < dev->data->nb_rx_queues; i++) {
>  		vq = virtnet_rxq_to_vq(dev->data->rx_queues[i]);
> diff --git a/drivers/net/virtio/virtio_rxtx.c
> b/drivers/net/virtio/virtio_rxtx.c
> index 4795893ec7..d9d40832e0 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -793,7 +793,8 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev
> *dev, uint16_t queue_idx)
>  			vq_update_avail_idx(vq);
>  	}
> 
> -	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
> +	PMD_INIT_LOG(DEBUG, "Allocated %d bufs (port=%u queue=%u)", nbufs,
> +		     dev->data->port_id, queue_idx);
> 
>  	VIRTQUEUE_DUMP(vq);
> 
> --
> 2.30.2

Applied to next-virtio/main, thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-26  9:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 12:22 [PATCH] net/virtio: add queue and port ID in some logs Olivier Matz
2022-10-06 13:12 ` Maxime Coquelin
2022-10-17  6:58 ` Xia, Chenbo
2022-10-17  7:38   ` Olivier Matz
2022-10-17  8:00 ` [PATCH v2] " Olivier Matz
2022-10-17  8:19   ` Xia, Chenbo
2022-10-26  9:09   ` Xia, Chenbo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).