From: Bernard Iremonger Date: Sun, 1 Nov 2015 15:58:57 +0000 (+0000) Subject: examples/vhost_xen: fix build X-Git-Tag: spdx-start~7854 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=80c634d1cd9cade3f7f3fc5576bf74374bc041db;p=dpdk.git examples/vhost_xen: fix build examples/vhost_xen/main.c:659:61: error: has no member named data rte_memcpy((void *)(uintptr_t)buff_addr, (const void*)buff->data, rte_pktmbuf_data_len(buff)); ^ Signed-off-by: Bernard Iremonger Acked-by: Konstantin Ananyev --- diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst index 551ff7d4f6..efa38d3f60 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -239,6 +239,8 @@ Libraries Examples ~~~~~~~~ +* **vhost_xen: Fixed compile error.** + Other ~~~~~ diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c index ca725f2b3c..096e955cd7 100644 --- a/examples/vhost_xen/main.c +++ b/examples/vhost_xen/main.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -579,6 +579,7 @@ virtio_dev_rx(struct virtio_net *dev, struct rte_mbuf **pkts, uint32_t count) uint16_t res_base_idx, res_end_idx; uint16_t free_entries; uint8_t success = 0; + void *userdata; LOG_DEBUG(VHOST_DATA, "(%"PRIu64") virtio_dev_rx()\n", dev->device_fh); vq = dev->virtqueue_rx; @@ -656,13 +657,14 @@ virtio_dev_rx(struct virtio_net *dev, struct rte_mbuf **pkts, uint32_t count) vq->used->ring[res_cur_idx & (vq->size - 1)].len = packet_len; /* Copy mbuf data to buffer */ - rte_memcpy((void *)(uintptr_t)buff_addr, (const void*)buff->data, rte_pktmbuf_data_len(buff)); + userdata = rte_pktmbuf_mtod(buff, void *); + rte_memcpy((void *)(uintptr_t)buff_addr, userdata, rte_pktmbuf_data_len(buff)); res_cur_idx++; packet_success++; /* mergeable is disabled then a header is required per buffer. */ - rte_memcpy((void *)(uintptr_t)buff_hdr_addr, (const void*)&virtio_hdr, vq->vhost_hlen); + rte_memcpy((void *)(uintptr_t)buff_hdr_addr, (const void *)&virtio_hdr, vq->vhost_hlen); if (res_cur_idx < res_end_idx) { /* Prefetch descriptor index. */ rte_prefetch0(&vq->desc[head[packet_success]]);