From patchwork Wed Nov 18 08:08:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 84304 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DB2A5A04E6; Wed, 18 Nov 2020 09:08:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 12DEC592C; Wed, 18 Nov 2020 09:08:33 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 25F744C90 for ; Wed, 18 Nov 2020 09:08:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605686909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmm+63NQ2tHx8X/4d78u9dc7cZ/ulsQDodzlBj/CJ0Q=; b=KyjkTN9Pkil/jSy71IVWKSRPhbRVkCS+ojPFRavEImkIV60n0fdSghr1EDwwyzFalAF/JO lq4wNnlK9ybNPyzj+mxAyMaG5LIRn/MMS4CwHqirQ9jGSLEIlyODFYkrqFTDGAdWDLRS+6 BZJgO9JJpw929NgTAJgfJYPkeVrmtvA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-80-BPwm8WQQMbCdvhwmMjoKMg-1; Wed, 18 Nov 2020 03:08:25 -0500 X-MC-Unique: BPwm8WQQMbCdvhwmMjoKMg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD8486D24A; Wed, 18 Nov 2020 08:08:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4FB85D9CA; Wed, 18 Nov 2020 08:08:20 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com Cc: Maxime Coquelin Date: Wed, 18 Nov 2020 09:08:17 +0100 Message-Id: <20201118080817.669343-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH] net/virtio: improve logs in Vhost-vDPA DMA mapping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds debug logs in vhost_vdpa_dma_map() and vhost_vdpa_dma_unmap() to ease debugging. Signed-off-by: Maxime Coquelin --- 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..528ff60f29 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%" PRIx64, + __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%" PRIx64, + __func__, iova, len); + if (write(dev->vhostfd, &msg, sizeof(msg)) != sizeof(msg)) { PMD_DRV_LOG(ERR, "Failed to send IOTLB invalidate (%s)", strerror(errno));