[v2] net/virtio: add queue and port ID in some logs

Message ID 20221017080037.28634-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] net/virtio: add queue and port ID in some logs |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/iol-x86_64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Olivier Matz Oct. 17, 2022, 8 a.m. UTC
  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(-)
  

Comments

Chenbo Xia Oct. 17, 2022, 8:19 a.m. UTC | #1
> -----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>
  
Chenbo Xia Oct. 26, 2022, 9:09 a.m. UTC | #2
> -----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
  

Patch

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);