net/virtio: improve logs in vhost-vDPA DMA mapping
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 5 Jan 2021 15:34:46 +0000 (16:34 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Jan 2021 17:07:56 +0000 (18:07 +0100)
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>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/net/virtio/virtio_user/vhost_vdpa.c

index c7b9349..c5b59e2 100644 (file)
@@ -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));