DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: "Xia, Chenbo" <chenbo.xia@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"amorenoz@redhat.com" <amorenoz@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] net/virtio: improve logs in Vhost-vDPA DMA mapping
Date: Tue, 5 Jan 2021 16:31:11 +0100	[thread overview]
Message-ID: <36f70fe6-a0ba-8285-514c-1f9782a44e12@redhat.com> (raw)
In-Reply-To: <MN2PR11MB4063A064AD32D0F77D0AAE1C9CE00@MN2PR11MB4063.namprd11.prod.outlook.com>



On 11/19/20 9:36 AM, Xia, Chenbo wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Wednesday, November 18, 2020 4:08 PM
>> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>; amorenoz@redhat.com
>> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
>> 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 <maxime.coquelin@redhat.com>
>> ---
>>  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
> 


      reply	other threads:[~2021-01-05 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18  8:08 Maxime Coquelin
2020-11-19  8:36 ` Xia, Chenbo
2021-01-05 15:31   ` Maxime Coquelin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36f70fe6-a0ba-8285-514c-1f9782a44e12@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).