diff options
author | Christophe Fontaine <christophe.fontaine@qosmos.com> | 2016-05-11 08:36:24 +0000 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2016-05-17 19:24:17 +0000 |
commit | 95c8415531a27745c367fe2b352a4bdf2b1c7965 (patch) | |
tree | cfdebfd11f3f065e5f90fe3414c6c5c102622da1 | |
parent | 144a90f2e1e60e9c194c61c25db406e6e5f542e9 (diff) |
dpdk/build - 32bits compilation
In vnet/vnet/devices/dpdk/device.c, post 2 event data instead of
merging them into 1 u64.
Change-Id: I8b1d61b894279fb6eb57bb82a05affc14360e6b8
Signed-off-by: Christophe Fontaine <christophe.fontaine@qosmos.com>
-rw-r--r-- | vlib/vlib/dpdk_buffer.c | 2 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/device.c | 28 | ||||
-rw-r--r-- | vnet/vnet/devices/dpdk/vhost_user.c | 18 | ||||
-rw-r--r-- | vnet/vnet/devices/virtio/vhost-user.c | 8 |
4 files changed, 28 insertions, 28 deletions
diff --git a/vlib/vlib/dpdk_buffer.c b/vlib/vlib/dpdk_buffer.c index 358d366f140..ce0f32649aa 100644 --- a/vlib/vlib/dpdk_buffer.c +++ b/vlib/vlib/dpdk_buffer.c @@ -980,7 +980,7 @@ vlib_buffer_pool_create(vlib_main_t * vm, unsigned num_mbufs, } /* check if fits into buffer index range */ - if (new_size > ( (uword) 1 << (32 + CLIB_LOG2_CACHE_LINE_BYTES))) + if ( (u64)new_size > ( (u64) 1 << (32 + CLIB_LOG2_CACHE_LINE_BYTES))) rmp = 0; } } diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c index 20c8b8f77cc..ab85dfb48a9 100644 --- a/vnet/vnet/devices/dpdk/device.c +++ b/vnet/vnet/devices/dpdk/device.c @@ -1206,7 +1206,6 @@ admin_up_down_process (vlib_main_t * vm, clib_error_t * error = 0; uword event_type; uword *event_data = 0; - u32 index; u32 sw_if_index; u32 flags; @@ -1218,18 +1217,18 @@ admin_up_down_process (vlib_main_t * vm, dpdk_main.admin_up_down_in_progress = 1; - for (index=0; index<vec_len(event_data); index++) + switch (event_type) { + case UP_DOWN_FLAG_EVENT: { - sw_if_index = event_data[index] >> 32; - flags = (u32) event_data[index]; - - switch (event_type) { - case UP_DOWN_FLAG_EVENT: - error = vnet_sw_interface_set_flags (vnet_get_main(), sw_if_index, flags); - clib_error_report(error); - break; - } + if (vec_len(event_data) == 2) { + sw_if_index = event_data[0]; + flags = event_data[1]; + error = vnet_sw_interface_set_flags (vnet_get_main(), sw_if_index, flags); + clib_error_report(error); + } } + break; + } vec_reset_length (event_data); @@ -1257,10 +1256,11 @@ VLIB_REGISTER_NODE (admin_up_down_process_node,static) = { */ void post_sw_interface_set_flags (vlib_main_t *vm, u32 sw_if_index, u32 flags) { - vlib_process_signal_event + uword * d = vlib_process_signal_event_data (vm, admin_up_down_process_node.index, - UP_DOWN_FLAG_EVENT, - (((uword)sw_if_index << 32) | flags)); + UP_DOWN_FLAG_EVENT, 2, sizeof(u32)); + d[0] = sw_if_index; + d[1] = flags; } /* diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c index c82b37f9927..9bf76741588 100644 --- a/vnet/vnet/devices/dpdk/vhost_user.c +++ b/vnet/vnet/devices/dpdk/vhost_user.c @@ -106,11 +106,11 @@ static int dpdk_vhost_user_set_vring_enable(u32 hw_if_index, */ -static uint64_t -qva_to_vva(struct virtio_net *dev, uint64_t qemu_va) +static uword +qva_to_vva(struct virtio_net *dev, uword qemu_va) { struct virtio_memory_regions *region; - uint64_t vhost_va = 0; + uword vhost_va = 0; uint32_t regionidx = 0; /* Find the region where the address lives. */ @@ -176,7 +176,7 @@ static void disable_interface(dpdk_device_t * xd) xd->vu_is_running = 0; } -static inline void * map_guest_mem(dpdk_device_t * xd, u64 addr) +static inline void * map_guest_mem(dpdk_device_t * xd, uword addr) { dpdk_vu_intf_t * vui = xd->vu_intf; struct virtio_memory * mem = xd->vu_vhost_dev.mem; @@ -184,7 +184,7 @@ static inline void * map_guest_mem(dpdk_device_t * xd, u64 addr) for (i=0; i<mem->nregions; i++) { if ((mem->regions[i].guest_phys_address <= addr) && ((mem->regions[i].guest_phys_address + mem->regions[i].memory_size) > addr)) { - return (void *) (vui->region_addr[i] + addr - mem->regions[i].guest_phys_address); + return (void *) ((uword)vui->region_addr[i] + addr - (uword)mem->regions[i].guest_phys_address); } } DBG_SOCK("failed to map guest mem addr %lx", addr); @@ -563,8 +563,8 @@ dpdk_vhost_user_set_vring_num(u32 hw_if_index, u8 idx, u32 num) } static clib_error_t * -dpdk_vhost_user_set_vring_addr(u32 hw_if_index, u8 idx, u64 desc, \ - u64 used, u64 avail, u64 log) +dpdk_vhost_user_set_vring_addr(u32 hw_if_index, u8 idx, uword desc, \ + uword used, uword avail, uword log) { dpdk_device_t * xd; struct vhost_virtqueue *vq; @@ -1190,7 +1190,7 @@ static clib_error_t * dpdk_vhost_user_socket_read (unix_file_t * uf) goto close_socket; } - xd->vu_vhost_dev.log_base += (u64)addr + msg.log.offset; + xd->vu_vhost_dev.log_base += pointer_to_uword(addr) + msg.log.offset; xd->vu_vhost_dev.log_size = msg.log.size; msg.flags |= VHOST_USER_REPLY_MASK; msg.size = sizeof(msg.u64); @@ -1898,7 +1898,7 @@ show_dpdk_vhost_user_command_fn (vlib_main_t * vm, vq->desc[j].len, vq->desc[j].flags, vq->desc[j].next, - (u64) map_guest_mem(xd, vq->desc[j].addr));} + pointer_to_uword(map_guest_mem(xd, vq->desc[j].addr)));} } } vlib_cli_output (vm, "\n"); diff --git a/vnet/vnet/devices/virtio/vhost-user.c b/vnet/vnet/devices/virtio/vhost-user.c index 8486135dd69..5902c42b369 100644 --- a/vnet/vnet/devices/virtio/vhost-user.c +++ b/vnet/vnet/devices/virtio/vhost-user.c @@ -140,7 +140,7 @@ static int vhost_user_name_renumber (vnet_hw_interface_t * hi, } -static inline void * map_guest_mem(vhost_user_intf_t * vui, u64 addr) +static inline void * map_guest_mem(vhost_user_intf_t * vui, uword addr) { int i; for (i=0; i<vui->nregions; i++) { @@ -153,7 +153,7 @@ static inline void * map_guest_mem(vhost_user_intf_t * vui, u64 addr) return 0; } -static inline void * map_user_mem(vhost_user_intf_t * vui, u64 addr) +static inline void * map_user_mem(vhost_user_intf_t * vui, uword addr) { int i; for (i=0; i<vui->nregions; i++) { @@ -1949,7 +1949,7 @@ show_vhost_user_command_fn (vlib_main_t * vm, vui->regions[j].memory_size, vui->regions[j].userspace_addr, vui->regions[j].mmap_offset, - (u64) vui->region_mmap_addr[j]); + pointer_to_uword( vui->region_mmap_addr[j]) ); } for (q = 0; q < vui->num_vrings; q++) { vlib_cli_output(vm, "\n Virtqueue %d\n", q); @@ -1982,7 +1982,7 @@ show_vhost_user_command_fn (vlib_main_t * vm, vui->vrings[q].desc[j].len, vui->vrings[q].desc[j].flags, vui->vrings[q].desc[j].next, - (u64) map_guest_mem(vui, vui->vrings[q].desc[j].addr));} + pointer_to_uword(map_guest_mem(vui, vui->vrings[q].desc[j].addr)));} } } vlib_cli_output (vm, "\n"); |