DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Yuanhan Liu <yliu@fridaylinux.org>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	dev@dpdk.org, olivier.matz@6wind.com
Subject: Re: [dpdk-dev] [git pull] virtio changes for 17.11-rc1
Date: Mon, 9 Oct 2017 10:20:04 +0200	[thread overview]
Message-ID: <8f697241-0557-9342-e767-3ba53dc91916@redhat.com> (raw)
In-Reply-To: <1980926.nxTINr0BNQ@xps>

Hi Yuanhan,

On 10/07/2017 04:57 PM, Thomas Monjalon wrote:
> 07/10/2017 16:37, Thomas Monjalon:
>> 06/10/2017 08:45, Yuanhan Liu:
>>> Hi Thomas,
>>>
>>> Please consider pulling following virtio changes for 17.11-rc1 at
>>>      git://dpdk.org/next/dpdk-next-virtio    master
>>
>> There is a compilation error on ARM with
>> "net/virtio: rationalize setting of Rx/Tx handlers"
>> An include of rte_cpuflags.h is missing.
>>
>> There is also an error seen by clang in
>> "vhost-user: add support to IOTLB miss slave requests"
>> 	implicit conversion from enumeration type 'enum VhostUserSlaveRequest'
>> 	to different enumeration type 'VhostUserRequest'
>>
>> This last error may be a real issue because VHOST_USER_SLAVE_IOTLB_MSG in
>> VhostUserSlaveRequest can be understood as VHOST_USER_GET_FEATURES in
>> VhostUserRequest.
>>
>> Please advise
> 
> One more error with 32-bit compilation this time:
> "vhost: postpone device creation until ring are mapped"
> lib/librte_vhost/vhost.c:147:13: error:
> cast to pointer from integer of different size
> 
> Please work together to have a tree which can be compiled for
> ARM and x86, 32-bit or 64-bit, with gcc or clang.
> 

Sorry for the 32bits compilation failure, I'll add 32bits build to my
check script for next time.

Please find below the diff patch fixing these issues (build tested on
both 32/64b). I can send new version of the series if you prefer. Just
let me know.

Thanks,
Maxime

---------------------------------------------------------------------

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index e1f75feca..cbccf2390 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -144,7 +144,7 @@ vring_translate(struct virtio_net *dev, struct 
vhost_virtqueue *vq)
                 goto out;

         size = sizeof(struct vring_desc) * vq->size;
-       vq->desc = (struct vring_desc *)vhost_iova_to_vva(dev, vq,
+       vq->desc = (struct vring_desc 
*)(uintptr_t)vhost_iova_to_vva(dev, vq,
 
vq->ring_addrs.desc_user_addr,
                                                 size, VHOST_ACCESS_RW);
         if (!vq->desc)
@@ -152,7 +152,7 @@ vring_translate(struct virtio_net *dev, struct 
vhost_virtqueue *vq)

         size = sizeof(struct vring_avail);
         size += sizeof(uint16_t) * vq->size;
-       vq->avail = (struct vring_avail *)vhost_iova_to_vva(dev, vq,
+       vq->avail = (struct vring_avail 
*)(uintptr_t)vhost_iova_to_vva(dev, vq,
 
vq->ring_addrs.avail_user_addr,
                                                 size, VHOST_ACCESS_RW);
         if (!vq->avail)
@@ -160,7 +160,7 @@ vring_translate(struct virtio_net *dev, struct 
vhost_virtqueue *vq)

         size = sizeof(struct vring_used);
         size += sizeof(struct vring_used_elem) * vq->size;
-       vq->used = (struct vring_used *)vhost_iova_to_vva(dev, vq,
+       vq->used = (struct vring_used 
*)(uintptr_t)vhost_iova_to_vva(dev, vq,
 
vq->ring_addrs.used_user_addr,
                                                 size, VHOST_ACCESS_RW);
         if (!vq->used)
diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 363e20245..a37e99d8f 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1017,18 +1017,18 @@ is_vring_iotlb_invalidate(struct vhost_virtqueue 
*vq,
         istart = imsg->iova;
         iend = istart + imsg->size - 1;

-       vstart = (uint64_t)vq->desc;
+       vstart = (uintptr_t)vq->desc;
         vend = vstart + sizeof(struct vring_desc) * vq->size - 1;
         if (vstart <= iend && istart <= vend)
                 return 1;

-       vstart = (uint64_t)vq->avail;
+       vstart = (uintptr_t)vq->avail;
         vend = vstart + sizeof(struct vring_avail);
         vend += sizeof(uint16_t) * vq->size - 1;
         if (vstart <= iend && istart <= vend)
                 return 1;

-       vstart = (uint64_t)vq->used;
+       vstart = (uintptr_t)vq->used;
         vend = vstart + sizeof(struct vring_used);
         vend += sizeof(struct vring_used_elem) * vq->size - 1;
         if (vstart <= iend && istart <= vend)

  reply	other threads:[~2017-10-09  8:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06  6:45 Yuanhan Liu
2017-10-06  9:47 ` Thomas Monjalon
2017-10-06 10:50   ` Bruce Richardson
2017-10-06 12:04     ` Thomas Monjalon
2017-10-06 11:05   ` Yuanhan Liu
2017-10-07 14:37 ` Thomas Monjalon
2017-10-07 14:57   ` Thomas Monjalon
2017-10-09  8:20     ` Maxime Coquelin [this message]
2017-10-08 20:10   ` Olivier MATZ
2017-10-08 20:16     ` Thomas Monjalon
2017-10-09  2:43       ` Yuanhan Liu
2017-10-09  7:13         ` Maxime Coquelin
2017-10-09  2:55   ` Yuanhan Liu
2017-10-09  7:13     ` Maxime Coquelin

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=8f697241-0557-9342-e767-3ba53dc91916@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=thomas@monjalon.net \
    --cc=yliu@fridaylinux.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).