* [dpdk-dev] [PATCH 0/2] Fix Xen compilation for 32 bits
@ 2016-04-10 19:25 Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 1/2] xen: fix compilation on " Pablo de Lara
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Pablo de Lara @ 2016-04-10 19:25 UTC (permalink / raw)
To: dev; +Cc: Pablo de Lara
Xen library and vhost_xen app cannot build on 32 bits,
so this patchset fixes both.
Pablo de Lara (2):
xen: fix compilation on 32 bits
vhost_xen: fix compilation on 32 bits
drivers/net/xenvirt/virtqueue.h | 2 +-
examples/vhost_xen/vhost_monitor.c | 10 +++++++---
2 files changed, 8 insertions(+), 4 deletions(-)
--
2.5.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 1/2] xen: fix compilation on 32 bits
2016-04-10 19:25 [dpdk-dev] [PATCH 0/2] Fix Xen compilation for 32 bits Pablo de Lara
@ 2016-04-10 19:25 ` Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 2/2] vhost_xen: " Pablo de Lara
2016-04-10 19:37 ` [dpdk-dev] [PATCH 0/2] Fix Xen compilation for " Thomas Monjalon
2 siblings, 0 replies; 4+ messages in thread
From: Pablo de Lara @ 2016-04-10 19:25 UTC (permalink / raw)
To: dev; +Cc: Pablo de Lara
Compilation fails on 32 bits on Xen driver, due to wrong casting:
drivers/net/xenvirt/virtqueue.h: In function ‘virtqueue_enqueue_xmit’:
drivers/net/xenvirt/virtqueue.h:234:24: error: cast from pointer to integer
of different size [-Werror=pointer-to-int-cast]
start_dp[idx].addr = rte_pktmbuf_mtod(cookie, uint64_t);
^
Fixes: d6b324c00fc9 ("mbuf: get DMA address")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/net/xenvirt/virtqueue.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/xenvirt/virtqueue.h b/drivers/net/xenvirt/virtqueue.h
index e425a04..350eae3 100644
--- a/drivers/net/xenvirt/virtqueue.h
+++ b/drivers/net/xenvirt/virtqueue.h
@@ -231,7 +231,7 @@ virtqueue_enqueue_xmit(struct virtqueue *txvq, struct rte_mbuf *cookie)
start_dp[idx].flags = VRING_DESC_F_NEXT;
start_dp[idx].addr = (uintptr_t)NULL;
idx = start_dp[idx].next;
- start_dp[idx].addr = rte_pktmbuf_mtod(cookie, uint64_t);
+ start_dp[idx].addr = (uint64_t)rte_pktmbuf_mtod(cookie, uintptr_t);
start_dp[idx].len = cookie->data_len;
start_dp[idx].flags = 0;
idx = start_dp[idx].next;
--
2.5.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] vhost_xen: fix compilation on 32 bits
2016-04-10 19:25 [dpdk-dev] [PATCH 0/2] Fix Xen compilation for 32 bits Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 1/2] xen: fix compilation on " Pablo de Lara
@ 2016-04-10 19:25 ` Pablo de Lara
2016-04-10 19:37 ` [dpdk-dev] [PATCH 0/2] Fix Xen compilation for " Thomas Monjalon
2 siblings, 0 replies; 4+ messages in thread
From: Pablo de Lara @ 2016-04-10 19:25 UTC (permalink / raw)
To: dev; +Cc: Pablo de Lara
Compilation fails on 32 bits on Vhost_xen sample app, due to wrong casting:
examples/vhost_xen/vhost_monitor.c: In function ‘new_device’:
examples/vhost_xen/vhost_monitor.c:288:62: error: cast from pointer to integer
of different size [-Werror=pointer-to-int-cast]
gpa = new_ll_dev->dev.mem->regions[i].guest_phys_address = (uint64_t)guest->mempool[i].gva;
Fixes: 47bd46112b71 ("xen: import xenvirt pmd and vhost_xen") ^
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
examples/vhost_xen/vhost_monitor.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/examples/vhost_xen/vhost_monitor.c b/examples/vhost_xen/vhost_monitor.c
index 605cd4d..fb9606b 100644
--- a/examples/vhost_xen/vhost_monitor.c
+++ b/examples/vhost_xen/vhost_monitor.c
@@ -285,9 +285,13 @@ virtio_net_config_ll *new_device(unsigned int virtio_idx, struct xen_guest *gues
new_ll_dev->dev.mem = malloc(sizeof(struct virtio_memory) + sizeof(struct virtio_memory_regions) * MAX_XENVIRT_MEMPOOL);
new_ll_dev->dev.mem->nregions = guest->pool_num;
for (i = 0; i < guest->pool_num; i++) {
- gpa = new_ll_dev->dev.mem->regions[i].guest_phys_address = (uint64_t)guest->mempool[i].gva;
- new_ll_dev->dev.mem->regions[i].guest_phys_address_end = gpa + guest->mempool[i].mempfn_num * getpagesize();
- new_ll_dev->dev.mem->regions[i].address_offset = (uint64_t)guest->mempool[i].hva - gpa;
+ gpa = new_ll_dev->dev.mem->regions[i].guest_phys_address =
+ (uint64_t)((uintptr_t)guest->mempool[i].gva);
+ new_ll_dev->dev.mem->regions[i].guest_phys_address_end =
+ gpa + guest->mempool[i].mempfn_num * getpagesize();
+ new_ll_dev->dev.mem->regions[i].address_offset =
+ (uint64_t)((uintptr_t)guest->mempool[i].hva -
+ (uintptr_t)gpa);
}
new_ll_dev->next = NULL;
--
2.5.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] Fix Xen compilation for 32 bits
2016-04-10 19:25 [dpdk-dev] [PATCH 0/2] Fix Xen compilation for 32 bits Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 1/2] xen: fix compilation on " Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 2/2] vhost_xen: " Pablo de Lara
@ 2016-04-10 19:37 ` Thomas Monjalon
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-04-10 19:37 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev
2016-04-10 20:25, Pablo de Lara:
> Xen library and vhost_xen app cannot build on 32 bits,
> so this patchset fixes both.
>
> Pablo de Lara (2):
> xen: fix compilation on 32 bits
> vhost_xen: fix compilation on 32 bits
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-10 19:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-10 19:25 [dpdk-dev] [PATCH 0/2] Fix Xen compilation for 32 bits Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 1/2] xen: fix compilation on " Pablo de Lara
2016-04-10 19:25 ` [dpdk-dev] [PATCH 2/2] vhost_xen: " Pablo de Lara
2016-04-10 19:37 ` [dpdk-dev] [PATCH 0/2] Fix Xen compilation for " Thomas Monjalon
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).