[dpdk-dev] [git pull] virtio changes for 17.11-rc1

Maxime Coquelin maxime.coquelin at redhat.com
Mon Oct 9 10:20:04 CEST 2017


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)


More information about the dev mailing list