From patchwork Mon Oct 9 08:20:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 29929 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 83B8E7D34; Mon, 9 Oct 2017 10:20:10 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 97D4C1AEF4 for ; Mon, 9 Oct 2017 10:20:08 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36E985D68C; Mon, 9 Oct 2017 08:20:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 36E985D68C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=maxime.coquelin@redhat.com Received: from [10.36.112.42] (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B96985ED50; Mon, 9 Oct 2017 08:20:05 +0000 (UTC) To: Yuanhan Liu Cc: Thomas Monjalon , dev@dpdk.org, olivier.matz@6wind.com References: <20171006064558.GE1545@yliu-home> <1963011.gX7c8kfyiN@xps> <1980926.nxTINr0BNQ@xps> From: Maxime Coquelin Message-ID: <8f697241-0557-9342-e767-3ba53dc91916@redhat.com> Date: Mon, 9 Oct 2017 10:20:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1980926.nxTINr0BNQ@xps> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 09 Oct 2017 08:20:07 +0000 (UTC) Subject: Re: [dpdk-dev] [git pull] virtio changes for 17.11-rc1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" 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 --------------------------------------------------------------------- if (vstart <= iend && istart <= vend) 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;