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 12AA2A09FF; Tue, 5 Jan 2021 16:31:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DADC716083F; Tue, 5 Jan 2021 16:31:19 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 46D11160838 for ; Tue, 5 Jan 2021 16:31:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609860678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T3yX3KUW+r2KDtNLlQ8axsci1ZnB107ERUzxc6Yxly4=; b=LEwTVDvfIvDj+0cPPsfBi+rjkWPhxJy9+ZiHRU0OtWLtjy39gu5cE9Mq4iN31cBwislNb0 2NlsAdKnsFkYtwNMmVp2ZBHS85Nihj3nMDRaxclhBdY1Hk91NYGLOhYt4+j8WWsT+VDPhZ arlvpvFf5o6xI/KVKbTYQoDWnJ5Pijg= 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-5-MWhaoREsNmuCv04YsSJyWw-1; Tue, 05 Jan 2021 10:31:16 -0500 X-MC-Unique: MWhaoREsNmuCv04YsSJyWw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D32080400D; Tue, 5 Jan 2021 15:31:15 +0000 (UTC) Received: from [10.36.110.9] (unknown [10.36.110.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 755A55C1D0; Tue, 5 Jan 2021 15:31:14 +0000 (UTC) To: "Xia, Chenbo" , "dev@dpdk.org" , "amorenoz@redhat.com" References: <20201118080817.669343-1-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <36f70fe6-a0ba-8285-514c-1f9782a44e12@redhat.com> Date: Tue, 5 Jan 2021 16:31:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] 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" On 11/19/20 9:36 AM, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Wednesday, November 18, 2020 4:08 PM >> To: dev@dpdk.org; Xia, Chenbo ; amorenoz@redhat.com >> Cc: Maxime Coquelin >> Subject: [PATCH] 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 >> --- >> 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); > > Use PRIx64 to print size_t (len in this case)will cause compile errors in i686. > Should we use %zx ? > >> + >> 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); >> + > > Ditto. Indeed, will fix it Thanks, Maxime > Thanks! > Chenbo > >> if (write(dev->vhostfd, &msg, sizeof(msg)) != sizeof(msg)) { >> PMD_DRV_LOG(ERR, "Failed to send IOTLB invalidate (%s)", >> strerror(errno)); >> -- >> 2.26.2 >