From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 452B825A1 for ; Mon, 23 Apr 2018 18:57:32 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC7C1406C784; Mon, 23 Apr 2018 16:57:31 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-58.ams2.redhat.com [10.36.112.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 989B57C54; Mon, 23 Apr 2018 16:57:28 +0000 (UTC) From: Maxime Coquelin To: stable@dpdk.org, bluca@debian.org Cc: Maxime Coquelin Date: Mon, 23 Apr 2018 18:57:26 +0200 Message-Id: <20180423165726.12730-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 23 Apr 2018 16:57:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 23 Apr 2018 16:57:31 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: [dpdk-stable] [PATCH v17.11 LTS] vhost: fix compilation issue when vhost debug enabled X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 16:57:32 -0000 This patch fixes below compilation issue when RTE_LIBRTE_VHOST_DEBUG is enabled: In file included from ./lib/librte_vhost/virtio_net.c:50:0: ./lib/librte_vhost/virtio_net.c: In function ‘copy_mbuf_to_desc’: ./lib/librte_vhost/vhost.h:205:42: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=] snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%d) Header size %d: ", (device->vid), (size)); \ ^ ./lib/librte_vhost/virtio_net.c:301:4: note: in expansion of macro ‘PRINT_PACKET’ PRINT_PACKET(dev, (uintptr_t)dst, len, 0); ^~~~~~~~~~~~ Fixes: 266a4dae840e ("vhost: handle virtually non-contiguous buffers in Tx") Fixes: a2bc90bb969a ("vhost: handle virtually non-contiguous buffers in Rx") Fixes: 1e92b3cec1d7 ("vhost: handle virtually non-contiguous buffers in Rx-mrg") Signed-off-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index a013c07b0..ecfabca3d 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -297,7 +297,7 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, rte_memcpy((void *)(uintptr_t)dst, (void *)(uintptr_t)src, len); - PRINT_PACKET(dev, (uintptr_t)dst, len, 0); + PRINT_PACKET(dev, (uintptr_t)dst, (uint32_t)len, 0); vhost_log_write(dev, guest_addr, len); remain -= len; guest_addr += len; @@ -796,7 +796,7 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq, len); PRINT_PACKET(dev, (uintptr_t)dst, - len, 0); + (uint32_t)len, 0); vhost_log_write(dev, guest_addr, len); remain -= len; @@ -1234,7 +1234,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, rte_prefetch0((void *)(uintptr_t)(desc_addr + desc_offset)); PRINT_PACKET(dev, (uintptr_t)(desc_addr + desc_offset), - desc_chunck_len, 0); + (uint32_t)desc_chunck_len, 0); mbuf_offset = 0; mbuf_avail = m->buf_len - RTE_PKTMBUF_HEADROOM; @@ -1322,7 +1322,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, desc_avail = desc->len; PRINT_PACKET(dev, (uintptr_t)desc_addr, - desc_chunck_len, 0); + (uint32_t)desc_chunck_len, 0); } else if (unlikely(desc_chunck_len == 0)) { desc_chunck_len = desc_avail; desc_gaddr += desc_offset; @@ -1337,7 +1337,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, desc_offset = 0; PRINT_PACKET(dev, (uintptr_t)desc_addr, - desc_chunck_len, 0); + (uint32_t)desc_chunck_len, 0); } /* -- 2.14.3