DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping
@ 2021-01-05 15:34 Maxime Coquelin
  2021-01-08  7:36 ` Xia, Chenbo
  2021-01-08  9:18 ` Maxime Coquelin
  0 siblings, 2 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-01-05 15:34 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz; +Cc: Maxime Coquelin

This patch adds debug logs in vhost_vdpa_dma_map() and
vhost_vdpa_dma_unmap() to ease debugging.

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

Changes in v2:
 - fix i686 build (Chenbo)

 drivers/net/virtio/virtio_user/vhost_vdpa.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c
index c7b9349fc8..c5b59e2f95 100644
--- a/drivers/net/virtio/virtio_user/vhost_vdpa.c
+++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c
@@ -93,6 +93,9 @@ vhost_vdpa_dma_map(struct virtio_user_dev *dev, void *addr,
 	msg.iotlb.size = len;
 	msg.iotlb.perm = VHOST_ACCESS_RW;
 
+	PMD_DRV_LOG(DEBUG, "%s: iova: 0x%" PRIx64 ", addr: %p, len: 0x%zx",
+			__func__, iova, addr, len);
+
 	if (write(dev->vhostfd, &msg, sizeof(msg)) != sizeof(msg)) {
 		PMD_DRV_LOG(ERR, "Failed to send IOTLB update (%s)",
 				strerror(errno));
@@ -113,6 +116,9 @@ vhost_vdpa_dma_unmap(struct virtio_user_dev *dev, __rte_unused void *addr,
 	msg.iotlb.iova = iova;
 	msg.iotlb.size = len;
 
+	PMD_DRV_LOG(DEBUG, "%s: iova: 0x%" PRIx64 ", len: 0x%zx",
+			__func__, iova, len);
+
 	if (write(dev->vhostfd, &msg, sizeof(msg)) != sizeof(msg)) {
 		PMD_DRV_LOG(ERR, "Failed to send IOTLB invalidate (%s)",
 				strerror(errno));
-- 
2.29.2


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

* Re: [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping
  2021-01-05 15:34 [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping Maxime Coquelin
@ 2021-01-08  7:36 ` Xia, Chenbo
  2021-01-08  9:18 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Xia, Chenbo @ 2021-01-08  7:36 UTC (permalink / raw)
  To: Maxime Coquelin, dev, amorenoz

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Tuesday, January 5, 2021 11:35 PM
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>; amorenoz@redhat.com
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping
> 
> This patch adds debug logs in vhost_vdpa_dma_map() and
> vhost_vdpa_dma_unmap() to ease debugging.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> 
> Changes in v2:
>  - fix i686 build (Chenbo)
> 
>  drivers/net/virtio/virtio_user/vhost_vdpa.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c
> b/drivers/net/virtio/virtio_user/vhost_vdpa.c
> index c7b9349fc8..c5b59e2f95 100644
> --- a/drivers/net/virtio/virtio_user/vhost_vdpa.c
> +++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c
> @@ -93,6 +93,9 @@ vhost_vdpa_dma_map(struct virtio_user_dev *dev, void *addr,
>  	msg.iotlb.size = len;
>  	msg.iotlb.perm = VHOST_ACCESS_RW;
> 
> +	PMD_DRV_LOG(DEBUG, "%s: iova: 0x%" PRIx64 ", addr: %p, len: 0x%zx",
> +			__func__, iova, addr, len);
> +
>  	if (write(dev->vhostfd, &msg, sizeof(msg)) != sizeof(msg)) {
>  		PMD_DRV_LOG(ERR, "Failed to send IOTLB update (%s)",
>  				strerror(errno));
> @@ -113,6 +116,9 @@ vhost_vdpa_dma_unmap(struct virtio_user_dev *dev,
> __rte_unused void *addr,
>  	msg.iotlb.iova = iova;
>  	msg.iotlb.size = len;
> 
> +	PMD_DRV_LOG(DEBUG, "%s: iova: 0x%" PRIx64 ", len: 0x%zx",
> +			__func__, iova, len);
> +
>  	if (write(dev->vhostfd, &msg, sizeof(msg)) != sizeof(msg)) {
>  		PMD_DRV_LOG(ERR, "Failed to send IOTLB invalidate (%s)",
>  				strerror(errno));
> --
> 2.29.2

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

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

* Re: [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping
  2021-01-05 15:34 [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping Maxime Coquelin
  2021-01-08  7:36 ` Xia, Chenbo
@ 2021-01-08  9:18 ` Maxime Coquelin
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-01-08  9:18 UTC (permalink / raw)
  To: dev, chenbo.xia, amorenoz



On 1/5/21 4:34 PM, Maxime Coquelin wrote:
> This patch adds debug logs in vhost_vdpa_dma_map() and
> vhost_vdpa_dma_unmap() to ease debugging.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> 
> Changes in v2:
>  - fix i686 build (Chenbo)
> 
>  drivers/net/virtio/virtio_user/vhost_vdpa.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Series applied to dpdk-next-virtio/main.

Thanks,
Maxime


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

end of thread, other threads:[~2021-01-08  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 15:34 [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping Maxime Coquelin
2021-01-08  7:36 ` Xia, Chenbo
2021-01-08  9:18 ` Maxime Coquelin

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git