patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v18.02] vhost: fix compilation issue when vhost debug enabled
@ 2018-04-23 17:03 Maxime Coquelin
  2018-04-23 17:17 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Coquelin @ 2018-04-23 17:03 UTC (permalink / raw)
  To: stable, bluca; +Cc: Maxime Coquelin

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: de7f26b5c35c ("vhost: handle virtually non-contiguous buffers in Tx")
Fixes: f98ac647a76f ("vhost: handle virtually non-contiguous buffers in Rx")
Fixes: 5fe57f56573d ("vhost: handle virtually non-contiguous buffers in Rx-mrg")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 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 3d08ddf09..89b5b5f86 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -273,7 +273,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;
@@ -766,7 +766,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;
@@ -1170,7 +1170,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;
@@ -1258,7 +1258,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;
@@ -1273,7 +1273,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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH v18.02] vhost: fix compilation issue when vhost debug enabled
  2018-04-23 17:03 [dpdk-stable] [PATCH v18.02] vhost: fix compilation issue when vhost debug enabled Maxime Coquelin
@ 2018-04-23 17:17 ` Luca Boccassi
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Boccassi @ 2018-04-23 17:17 UTC (permalink / raw)
  To: Maxime Coquelin, stable

On Mon, 2018-04-23 at 19:03 +0200, Maxime Coquelin wrote:
> 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: de7f26b5c35c ("vhost: handle virtually non-contiguous buffers
> in Tx")
> Fixes: f98ac647a76f ("vhost: handle virtually non-contiguous buffers
> in Rx")
> Fixes: 5fe57f56573d ("vhost: handle virtually non-contiguous buffers
> in Rx-mrg")
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks, applied and pushed to dpdk-stable/18.02

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-23 17:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 17:03 [dpdk-stable] [PATCH v18.02] vhost: fix compilation issue when vhost debug enabled Maxime Coquelin
2018-04-23 17:17 ` Luca Boccassi

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).