From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D8349A09FF; Tue, 5 Jan 2021 16:34:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E21016087D; Tue, 5 Jan 2021 16:34:58 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 02BA016087C for ; Tue, 5 Jan 2021 16:34:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609860896; 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=o3NpTEPRL6alK54SjCG7Q8+MBdPHYNat6+keqkWT0D8=; b=cBNW3a0DDZThUWg40COvGCwkFhvi4dkV+ZkRIOr5g3NY4t+8kppBPTyjNgOoyCpwvPbarN X9YTydReknzSqZWk90hVnK1vwz3YiEAo5G75mNOj+ZtDOHo7tZYxlRldE9q80njuHuXIm6 OWxqF9E29aexrE3rO3C5uZmBgrN+kKc= 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-404-sw-aZMeGP-uL-JN5mWDimA-1; Tue, 05 Jan 2021 10:34:54 -0500 X-MC-Unique: sw-aZMeGP-uL-JN5mWDimA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3E8010054FF; Tue, 5 Jan 2021 15:34:53 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.36.110.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E501E1001B2C; Tue, 5 Jan 2021 15:34:48 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com Cc: Maxime Coquelin Date: Tue, 5 Jan 2021 16:34:46 +0100 Message-Id: <20210105153446.106320-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH v2] net/virtio: improve logs in Vhost-vDPA DMA mapping X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 --- 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