From bfdedbd5a3ba7e6fdc036d212253aa55c9062211 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 20 Jan 2016 09:11:55 -0500 Subject: PowerPC64-be arch support. Qemu ("qppc") platform support. Change-Id: Ib0a05f9d1b08bacef09f6d7c101391737031ee0d Signed-off-by: Dave Barach --- build-data/packages/vlib-api-no-dpdk.mk | 6 ++ build-data/packages/vlib-no-dpdk.mk | 5 ++ build-data/packages/vnet-no-dpdk.mk | 26 +++++++++ build-data/packages/vpp-api-test-no-dpdk.mk | 30 ++++++++++ build-data/packages/vpp-no-dpdk.mk | 33 +++++++++++ build-data/platforms/qppc.mk | 23 ++++++++ vlib/vlib/main.h | 1 + vlib/vlib/node.c | 26 +++++++-- vlib/vlib/threads.c | 4 +- vlib/vlib/unix/main.c | 10 ++-- vlib/vlib/unix/physmem.c | 5 ++ vnet/vnet/devices/ssvm/node.c | 15 ++++- vnet/vnet/lawful-intercept/lawful_intercept.c | 4 ++ vnet/vnet/lawful-intercept/node.c | 36 ++++++++++++ vnet/vnet/map/map.c | 11 ++++ vnet/vnet/policer/fix_types.h | 4 ++ vnet/vnet/vcgn/vcgn_classify.c | 2 + vpp-api-test/vat/api_format.c | 49 +++++++++++++++++ vpp-japi/m4/libtool.m4 | 79 +++++++++++---------------- vpp/app/version.c | 5 ++ vppinfra/vppinfra/bihash_24_8.h | 3 +- vppinfra/vppinfra/cache.h | 15 +++++ vppinfra/vppinfra/longjmp.S | 60 ++++++++++---------- vppinfra/vppinfra/unix-formats.c | 4 +- 24 files changed, 367 insertions(+), 89 deletions(-) create mode 100644 build-data/packages/vlib-api-no-dpdk.mk create mode 100644 build-data/packages/vlib-no-dpdk.mk create mode 100644 build-data/packages/vnet-no-dpdk.mk create mode 100644 build-data/packages/vpp-api-test-no-dpdk.mk create mode 100644 build-data/packages/vpp-no-dpdk.mk create mode 100644 build-data/platforms/qppc.mk diff --git a/build-data/packages/vlib-api-no-dpdk.mk b/build-data/packages/vlib-api-no-dpdk.mk new file mode 100644 index 00000000..031cc198 --- /dev/null +++ b/build-data/packages/vlib-api-no-dpdk.mk @@ -0,0 +1,6 @@ +vlib-api-no-dpdk_source = vlib-api + +vlib-api-no-dpdk_configure_depend = vppinfra-install svm-install vlib-no-dpdk-install + +vlib-api-no-dpdk_CPPFLAGS = $(call installed_includes_fn, vppinfra svm vlib-no-dpdk) +vlib-api-no-dpdk_LDFLAGS = $(call installed_libs_fn, vppinfra svm vlib-no-dpdk) diff --git a/build-data/packages/vlib-no-dpdk.mk b/build-data/packages/vlib-no-dpdk.mk new file mode 100644 index 00000000..f3869c5d --- /dev/null +++ b/build-data/packages/vlib-no-dpdk.mk @@ -0,0 +1,5 @@ +vlib-no-dpdk_source = vlib +vlib-no-dpdk_configure_depend = vppinfra-install + +vlib-no-dpdk_CPPFLAGS = $(call installed_includes_fn, vppinfra) +vlib-no-dpdk_LDFLAGS = $(call installed_libs_fn, vppinfra) diff --git a/build-data/packages/vnet-no-dpdk.mk b/build-data/packages/vnet-no-dpdk.mk new file mode 100644 index 00000000..ccbd490b --- /dev/null +++ b/build-data/packages/vnet-no-dpdk.mk @@ -0,0 +1,26 @@ +vnet-no-dpdk_source = vnet + +vnet-no-dpdk_configure_depend = \ + vppinfra-install \ + svm-install \ + openssl-install \ + vlib-api-no-dpdk-install \ + vlib-no-dpdk-install + +vnet-no-dpdk_CPPFLAGS = $(call installed_includes_fn, \ + vppinfra \ + openssl \ + svm \ + vlib-no-dpdk \ + vlib-api-no-dpdk) + +vnet-no-dpdk_LDFLAGS = $(call installed_libs_fn, \ + vppinfra \ + openssl \ + svm \ + vlib-no-dpdk \ + vlib-api-no-dpdk) + +# Platform dependent configure flags +vnet-no-dpdk_configure_args += $(vnet-no-dpdk_configure_args_$(PLATFORM)) + diff --git a/build-data/packages/vpp-api-test-no-dpdk.mk b/build-data/packages/vpp-api-test-no-dpdk.mk new file mode 100644 index 00000000..b511f2ca --- /dev/null +++ b/build-data/packages/vpp-api-test-no-dpdk.mk @@ -0,0 +1,30 @@ +vpp-api-test-no-dpdk_source = vpp-api-test + +vpp-api-test-no-dpdk_configure_depend = \ + vppinfra-install \ + svm-install \ + vlib-api-no-dpdk-install \ + vlib-no-dpdk-install \ + vnet-no-dpdk-install \ + vpp-no-dpdk-install + +# +vpp-api-test-no-dpdk_configure_args = --with-q-platform=$(PLATFORM) \ + --with-q-plugin-prefix=$(MU_BUILD_ROOT_DIR)/packages-$(PLATFORM) + +vpp-api-test-no-dpdk_CPPFLAGS = $(call installed_includes_fn, \ + vppinfra \ + svm \ + vlib-no-dpdk \ + vlib-api-no-dpdk \ + vnet-no-dpdk \ + vpp-no-dpdk) + +vpp-api-test-no-dpdk_LDFLAGS = $(call installed_libs_fn, \ + vppinfra \ + svm \ + vlib-no-dpdk \ + vlib-api-no-dpdk \ + vnet-no-dpdk \ + vpp-no-dpdk) + diff --git a/build-data/packages/vpp-no-dpdk.mk b/build-data/packages/vpp-no-dpdk.mk new file mode 100644 index 00000000..f509bdf3 --- /dev/null +++ b/build-data/packages/vpp-no-dpdk.mk @@ -0,0 +1,33 @@ +vpp-no-dpdk_source = vpp + +vpp-no-dpdk_configure_depend = \ + vppinfra-install \ + openssl-install \ + svm-install \ + vlib-api-no-dpdk-install \ + vlib-no-dpdk-install \ + vnet-no-dpdk-install \ + +# +vpp-no-dpdk_configure_args = --with-q-platform=$(PLATFORM) \ + --with-q-plugin-prefix=$(MU_BUILD_ROOT_DIR)/packages-$(PLATFORM) + +# Platform dependent configure flags +vpp-no-dpdk_configure_args += $(vpp-no-dpdk_configure_args_$(PLATFORM)) + + +vpp-no-dpdk_CPPFLAGS = $(call installed_includes_fn, \ + vppinfra \ + openssl \ + svm \ + vlib-no-dpdk \ + vlib-api-no-dpdk \ + vnet-no-dpdk) + +vpp-no-dpdk_LDFLAGS = $(call installed_libs_fn, \ + vppinfra \ + openssl \ + svm \ + vlib-no-dpdk \ + vlib-api-no-dpdk \ + vnet-no-dpdk) diff --git a/build-data/platforms/qppc.mk b/build-data/platforms/qppc.mk new file mode 100644 index 00000000..fe0f8683 --- /dev/null +++ b/build-data/platforms/qppc.mk @@ -0,0 +1,23 @@ +# Qemu "p-series" powerpc64 + +qppc_arch = powerpc64 + +qppc_root_packages = vppinfra openssl vlib-no-dpdk vlib-api-no-dpdk vnet-no-dpdk svm \ + vpp-no-dpdk vpp-api-test-no-dpdk + +vpp_configure_args_qppc = +vnet-no-dpdk_configure_args_qppc = # nothing +vlib-no-dpdk_configure_args_qppc = --with-pre-data=128 + +qppc_march=powerpc64 + +# native tool chain additions for this platform +qppc_native_tools = vppapigen vppversion + +qppc_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec +qppc_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec + +qppc_TAG_CFLAGS = -g -O2 -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec +qppc_TAG_LDFLAGS = -g -O2 -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec + + diff --git a/vlib/vlib/main.h b/vlib/vlib/main.h index 5a8d7456..1a110459 100644 --- a/vlib/vlib/main.h +++ b/vlib/vlib/main.h @@ -171,6 +171,7 @@ typedef struct vlib_main_t { /* control-plane API queue signal pending */ volatile u32 queue_signal_pending; void (*queue_signal_callback)(struct vlib_main_t *); + u8 **argv; } vlib_main_t; /* Global main structure. */ diff --git a/vlib/vlib/node.c b/vlib/vlib/node.c index 4fb117e4..66a2d09f 100644 --- a/vlib/vlib/node.c +++ b/vlib/vlib/node.c @@ -262,7 +262,7 @@ static void node_elog_init (vlib_main_t * vm, uword ni) } #ifdef CLIB_UNIX -#define STACK_ALIGN 4096 +#define STACK_ALIGN (clib_mem_get_page_size()) #else #define STACK_ALIGN CLIB_CACHE_LINE_BYTES #endif @@ -272,6 +272,7 @@ static void register_node (vlib_main_t * vm, { vlib_node_main_t * nm = &vm->node_main; vlib_node_t * n; + u32 page_size = clib_mem_get_page_size(); int i; if (CLIB_DEBUG > 0) @@ -363,9 +364,26 @@ static void register_node (vlib_main_t * vm, log2_n_stack_bytes = clib_max (r->process_log2_n_stack_bytes, 15); - p = clib_mem_alloc_aligned_no_fail +#ifdef CLIB_UNIX + /* + * Bump the stack size if running over a kernel with a large page size, + * and the stack isn't any too big to begin with. Otherwise, we'll + * trip over the stack guard page for sure. + */ + if ((page_size > (4<<10)) && log2_n_stack_bytes < 19) + { + if ((1<log2_n_stack_bytes = log2_n_stack_bytes; @@ -388,7 +406,7 @@ static void register_node (vlib_main_t * vm, * Disallow writes to the bottom page of the stack, to * catch stack overflows. */ - if (mprotect (p->stack, 4096, PROT_READ) < 0) + if (mprotect (p->stack, page_size, PROT_READ) < 0) clib_unix_warning ("process stack"); #endif diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c index 73abba83..3eed1080 100644 --- a/vlib/vlib/threads.c +++ b/vlib/vlib/threads.c @@ -1025,7 +1025,7 @@ cpu_config (vlib_main_t * vm, unformat_input_t * input) VLIB_EARLY_CONFIG_FUNCTION (cpu_config, "cpu"); -#if !defined (__x86_64__) +#if !defined (__x86_64__) && !defined (__aarch64__) && !defined (__powerpc64__) void __sync_fetch_and_add_8 (void) { fformat(stderr, "%s called\n", __FUNCTION__); @@ -1128,6 +1128,7 @@ show_threads_fn (vlib_main_t * vm, "ID", "Name", "Type", "LWP", "lcore", "Core", "Socket", "State"); +#if !defined(__powerpc64__) for (i = 0; i < vec_len(vlib_worker_threads); i++) { w = vlib_worker_threads + i; @@ -1166,6 +1167,7 @@ show_threads_fn (vlib_main_t * vm, vlib_cli_output(vm, "%v", line); vec_free(line); } +#endif return 0; } diff --git a/vlib/vlib/unix/main.c b/vlib/vlib/unix/main.c index b85f3e73..1aac3275 100644 --- a/vlib/vlib/unix/main.c +++ b/vlib/vlib/unix/main.c @@ -397,15 +397,13 @@ VLIB_MAIN_LOOP_EXIT_FUNCTION (unix_exit); u8 **vlib_thread_stacks; -static char **argv_global; - static uword thread0 (uword arg) { vlib_main_t * vm = (vlib_main_t *)arg; unformat_input_t input; int i; - unformat_init_command_line (&input, argv_global); + unformat_init_command_line (&input, vm->argv); i = vlib_main (vm, &input); unformat_free (&input); @@ -423,7 +421,7 @@ int vlib_unix_main (int argc, char * argv[]) clib_error_t * e; int i; - argv_global = argv; + vm->argv = (u8 **)argv; vm->name = argv[0]; vm->heap_base = clib_mem_get_heap (); ASSERT(vm->heap_base); @@ -432,7 +430,7 @@ int vlib_unix_main (int argc, char * argv[]) if (i) return i; - unformat_init_command_line (&input, argv_global); + unformat_init_command_line (&input, vm->argv); vm->init_functions_called = hash_create (0, /* value bytes */ 0); e = vlib_call_all_config_functions (vm, &input, 1 /* early */); if (e != 0) @@ -459,7 +457,7 @@ int vlib_unix_main (int argc, char * argv[]) * Disallow writes to the bottom page of the stack, to * catch stack overflows. */ - if (mprotect (thread_stacks, 4096, PROT_READ) < 0) + if (mprotect (thread_stacks, clib_mem_get_page_size(), PROT_READ) < 0) clib_unix_warning ("thread stack"); thread_stacks += VLIB_THREAD_STACK_SIZE; diff --git a/vlib/vlib/unix/physmem.c b/vlib/vlib/unix/physmem.c index 83b40be6..d7428c9b 100644 --- a/vlib/vlib/unix/physmem.c +++ b/vlib/vlib/unix/physmem.c @@ -261,6 +261,11 @@ clib_error_t * unix_physmem_init (vlib_main_t * vm, int physical_memory_required else error = clib_error_return (0, "uio_dma deprecated"); + vpm->page_mask = pow2_mask (vpm->log2_n_bytes_per_page); + vpm->virtual.start = pointer_to_uword (pm->mem); + vpm->virtual.size = pm->mem_size; + vpm->virtual.end = vpm->virtual.start + vpm->virtual.size; + if (using_fake_memory) fformat(stderr, "%s: use fake dma pages\n", __FUNCTION__); else diff --git a/vnet/vnet/devices/ssvm/node.c b/vnet/vnet/devices/ssvm/node.c index fe53d119..b26d73d1 100644 --- a/vnet/vnet/devices/ssvm/node.c +++ b/vnet/vnet/devices/ssvm/node.c @@ -94,6 +94,7 @@ ssvm_eth_device_input (ssvm_eth_main_t * em, u32 trace_cnt __attribute__((unused)) = vlib_get_trace_count (vm, node); volatile u32 * lock; u32 * elt_indices; + uword n_trace = vlib_get_trace_count (vm, node); /* Either side down? buh-bye... */ if ((u64)(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 || @@ -236,7 +237,19 @@ ssvm_eth_device_input (ssvm_eth_main_t * em, */ VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b0); - /* $$$$ tracing */ + if (PREDICT_FALSE(n_trace > 0)) + { + ssvm_eth_input_trace_t *tr; + + vlib_trace_buffer (vm, node, next0, + b0, /* follow_chain */ 1); + vlib_set_trace_count (vm, node, --n_trace); + + tr = vlib_add_trace (vm, node, b0, sizeof (*tr)); + + tr->next_index = next0; + tr->sw_if_index = intfc->vlib_hw_if_index; + } vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, diff --git a/vnet/vnet/lawful-intercept/lawful_intercept.c b/vnet/vnet/lawful-intercept/lawful_intercept.c index bd3f33ef..6b2f41f4 100644 --- a/vnet/vnet/lawful-intercept/lawful_intercept.c +++ b/vnet/vnet/lawful-intercept/lawful_intercept.c @@ -13,6 +13,7 @@ * limitations under the License. */ +#if DPDK==1 #include static clib_error_t * @@ -109,3 +110,6 @@ li_init (vlib_main_t * vm) } VLIB_INIT_FUNCTION(li_init); +#else +#endif /* DPDK */ + diff --git a/vnet/vnet/lawful-intercept/node.c b/vnet/vnet/lawful-intercept/node.c index cc066491..8a47aa32 100644 --- a/vnet/vnet/lawful-intercept/node.c +++ b/vnet/vnet/lawful-intercept/node.c @@ -17,6 +17,7 @@ #include #include +#if DPDK==1 #include #include @@ -270,3 +271,38 @@ VLIB_REGISTER_NODE (li_hit_node) = { [LI_HIT_NEXT_ETHERNET] = "ethernet-input-not-l2", }, }; + +#else +#include + +static uword +li_hit_node_fn (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) +{ + clib_warning ("LI not implemented (no DPDK)"); + return 0; +} + +VLIB_REGISTER_NODE (li_hit_node) = { + .vector_size = sizeof (u32), + .function = li_hit_node_fn, + .name = "li-hit", +}; + +VLIB_REGISTER_NODE (ipsec_output_node) = { + .vector_size = sizeof (u32), + .function = li_hit_node_fn, + .name = "ipsec-output", +}; + +static clib_error_t * +li_init (vlib_main_t * vm) +{ + return 0; +} + +VLIB_INIT_FUNCTION(li_init); + + +#endif /* DPDK */ diff --git a/vnet/vnet/map/map.c b/vnet/vnet/map/map.c index a63122b5..3cf5e692 100644 --- a/vnet/vnet/map/map.c +++ b/vnet/vnet/map/map.c @@ -17,6 +17,17 @@ #include "map.h" +#ifdef __powerpc64__ +#include + +static inline u32 +crc_u32(u32 data, u32 value) +{ + u64 tmp = ((u64)data<<32) | (u64) value; + return (u32) clib_xxhash(tmp); +} +#endif + /* * This code supports the following MAP modes: * diff --git a/vnet/vnet/policer/fix_types.h b/vnet/vnet/policer/fix_types.h index cbb79e04..71a41731 100644 --- a/vnet/vnet/policer/fix_types.h +++ b/vnet/vnet/policer/fix_types.h @@ -28,4 +28,8 @@ typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; +#ifdef __powerpc64__ +typedef unsigned long uint64_t; +#endif + #endif /* __included_fix_types_h__ */ diff --git a/vnet/vnet/vcgn/vcgn_classify.c b/vnet/vnet/vcgn/vcgn_classify.c index 518f9102..5574f802 100644 --- a/vnet/vnet/vcgn/vcgn_classify.c +++ b/vnet/vnet/vcgn/vcgn_classify.c @@ -397,7 +397,9 @@ clib_error_t *vcgn_classify_init (vlib_main_t *vm) mp->inside_sw_if_index = 1; mp->outside_sw_if_index = 0; +#if DPDK==1 dpdk_set_next_node (DPDK_RX_NEXT_IP4_INPUT, "vcgn-classify"); +#endif { pg_node_t * pn; diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c index a32756bd..65c6b386 100644 --- a/vpp-api-test/vat/api_format.c +++ b/vpp-api-test/vat/api_format.c @@ -34,7 +34,11 @@ #include #include #include +#if DPDK > 0 #include +#else +#include +#endif #include #include "vat/json_format.h" @@ -228,6 +232,7 @@ uword unformat_ip6_address (unformat_input_t * input, va_list * args) uword unformat_ipsec_policy_action (unformat_input_t * input, va_list * args) { +#if DPDK > 0 u32 * r = va_arg (*args, u32 *); if (0) ; @@ -237,11 +242,15 @@ unformat_ipsec_policy_action (unformat_input_t * input, va_list * args) else return 0; return 1; +#else + return 0; +#endif } uword unformat_ipsec_crypto_alg (unformat_input_t * input, va_list * args) { +#if DPDK > 0 u32 * r = va_arg (*args, u32 *); if (0) ; @@ -251,11 +260,15 @@ unformat_ipsec_crypto_alg (unformat_input_t * input, va_list * args) else return 0; return 1; +#else + return 0; +#endif } u8 * format_ipsec_crypto_alg (u8 * s, va_list * args) { +#if DPDK > 0 u32 i = va_arg (*args, u32); u8 * t = 0; @@ -268,11 +281,15 @@ format_ipsec_crypto_alg (u8 * s, va_list * args) return format (s, "unknown"); } return format (s, "%s", t); +#else + return format (s, "Unimplemented"); +#endif } uword unformat_ipsec_integ_alg (unformat_input_t * input, va_list * args) { +#if DPDK > 0 u32 * r = va_arg (*args, u32 *); if (0) ; @@ -282,11 +299,15 @@ unformat_ipsec_integ_alg (unformat_input_t * input, va_list * args) else return 0; return 1; +#else + return 0; +#endif } u8 * format_ipsec_integ_alg (u8 * s, va_list * args) { +#if DPDK > 0 u32 i = va_arg (*args, u32); u8 * t = 0; @@ -299,6 +320,9 @@ format_ipsec_integ_alg (u8 * s, va_list * args) return format (s, "unknown"); } return format (s, "%s", t); +#else + return format (s, "Unsupported"); +#endif } u8 * format_ip4_address (u8 * s, va_list * args) @@ -7721,6 +7745,7 @@ api_ip_dump (vat_main_t * vam) static int api_ipsec_spd_add_del (vat_main_t * vam) { +#if DPDK > 0 unformat_input_t * i = vam->input; vl_api_ipsec_spd_add_del_t *mp; f64 timeout; @@ -7750,11 +7775,16 @@ api_ipsec_spd_add_del (vat_main_t * vam) S; W; /* NOTREACHED */ return 0; +#else + clib_warning ("unsupported (no dpdk)"); + return -99; +#endif } static int api_ipsec_interface_add_del_spd (vat_main_t * vam) { +#if DPDK > 0 unformat_input_t * i = vam->input; vl_api_ipsec_interface_add_del_spd_t *mp; f64 timeout; @@ -7798,11 +7828,16 @@ api_ipsec_interface_add_del_spd (vat_main_t * vam) S; W; /* NOTREACHED */ return 0; +#else + clib_warning ("unsupported (no dpdk)"); + return -99; +#endif } static int api_ipsec_spd_add_del_entry (vat_main_t * vam) { +#if DPDK > 0 unformat_input_t * i = vam->input; vl_api_ipsec_spd_add_del_entry_t *mp; f64 timeout; @@ -7928,11 +7963,16 @@ api_ipsec_spd_add_del_entry (vat_main_t * vam) S; W; /* NOTREACHED */ return 0; +#else + clib_warning ("unsupported (no dpdk)"); + return -99; +#endif } static int api_ipsec_sad_add_del_entry (vat_main_t * vam) { +#if DPDK > 0 unformat_input_t * i = vam->input; vl_api_ipsec_sad_add_del_entry_t *mp; f64 timeout; @@ -8035,11 +8075,16 @@ api_ipsec_sad_add_del_entry (vat_main_t * vam) S; W; /* NOTREACHED */ return 0; +#else + clib_warning ("unsupported (no dpdk)"); + return -99; +#endif } static int api_ipsec_sa_set_key (vat_main_t * vam) { +#if DPDK > 0 unformat_input_t * i = vam->input; vl_api_ipsec_sa_set_key_t *mp; f64 timeout; @@ -8077,6 +8122,10 @@ api_ipsec_sa_set_key (vat_main_t * vam) S; W; /* NOTREACHED */ return 0; +#else + clib_warning ("unsupported (no dpdk)"); + return -99; +#endif } /* diff --git a/vpp-japi/m4/libtool.m4 b/vpp-japi/m4/libtool.m4 index d7c043f4..44e0ecff 100644 --- a/vpp-japi/m4/libtool.m4 +++ b/vpp-japi/m4/libtool.m4 @@ -1312,7 +1312,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1324,19 +1324,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*) - LD="${LD-ld} -m elf32lppclinux" + LD="${LD-ld} -m elf_i386" ;; - powerpc64-*) + ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1355,10 +1345,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*) + ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1701,8 +1688,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -2526,6 +2512,17 @@ freebsd* | dragonfly*) esac ;; +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2642,7 +2639,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -2687,18 +2684,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -3258,6 +3243,10 @@ freebsd* | dragonfly*) fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3296,11 +3285,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4048,7 +4037,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4112,7 +4101,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4347,7 +4336,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4589,9 +4578,6 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4654,9 +4640,6 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4878,7 +4861,7 @@ _LT_EOF fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5055,7 +5038,6 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5360,7 +5342,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6240,6 +6222,9 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; + gnu*) + ;; + haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6401,7 +6386,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler diff --git a/vpp/app/version.c b/vpp/app/version.c index 8a91c85b..afd1e4a3 100644 --- a/vpp/app/version.c +++ b/vpp/app/version.c @@ -14,7 +14,10 @@ */ #include #include + +#if DPDK > 0 #include +#endif /* DPDK */ static char * vpe_version_string = "vpp v" VPP_BUILD_VER @@ -47,7 +50,9 @@ show_vpe_version_command_fn (vlib_main_t * vm, if (unformat (input, "verbose")){ vlib_cli_output (vm, "%s", vpe_dir_string); vlib_cli_output (vm, "%s", vpe_compiler); +#if DPDK > 0 vlib_cli_output (vm, "DPDK version is %s", rte_version()); +#endif } return 0; } diff --git a/vppinfra/vppinfra/bihash_24_8.h b/vppinfra/vppinfra/bihash_24_8.h index 9d5b3bcb..c789c980 100644 --- a/vppinfra/vppinfra/bihash_24_8.h +++ b/vppinfra/vppinfra/bihash_24_8.h @@ -38,6 +38,7 @@ static inline int clib_bihash_is_free_24_8 (clib_bihash_kv_24_8_t *v) return 0; } +#if !defined(__powerpc64__) && !defined(__aarch64__) static inline u32 crc_u32(u32 data, u32 value) { @@ -70,7 +71,7 @@ static inline u64 clib_bihash_hash_24_8 (clib_bihash_kv_24_8_t *v) return value; } -#if 0 +#else static inline u64 clib_bihash_hash_24_8 (clib_bihash_kv_24_8_t *v) { u64 tmp = v->key[0] ^ v->key[1] ^ v->key[2]; diff --git a/vppinfra/vppinfra/cache.h b/vppinfra/vppinfra/cache.h index 7ed7a1ea..fea11169 100644 --- a/vppinfra/vppinfra/cache.h +++ b/vppinfra/vppinfra/cache.h @@ -40,15 +40,30 @@ #include +/* + * Allow CFLAGS to override the arch-specific cache line size + */ +#ifndef CLIB_LOG2_CACHE_LINE_BYTES + #ifdef __x86_64__ #define CLIB_LOG2_CACHE_LINE_BYTES 6 #endif +#ifdef __aarch64__ +#define CLIB_LOG2_CACHE_LINE_BYTES 7 +#endif + /* Default cache line size of 32 bytes. */ #ifndef CLIB_LOG2_CACHE_LINE_BYTES #define CLIB_LOG2_CACHE_LINE_BYTES 5 #endif +#endif /* CLIB_LOG2_CACHE_LINE_BYTES defined */ + +#if (CLIB_LOG2_CACHE_LINE_BYTES >= 9) +#error Cache line size 512 bytes or greater +#endif + #define CLIB_CACHE_LINE_BYTES (1 << CLIB_LOG2_CACHE_LINE_BYTES) #define CLIB_CACHE_LINE_ALIGN_MARK(mark) u8 mark[0] __attribute__((aligned(CLIB_CACHE_LINE_BYTES))) diff --git a/vppinfra/vppinfra/longjmp.S b/vppinfra/vppinfra/longjmp.S index a469b644..ac138a96 100644 --- a/vppinfra/vppinfra/longjmp.S +++ b/vppinfra/vppinfra/longjmp.S @@ -290,38 +290,42 @@ _prologue (clib_longjmp) blr -_prologue (clib_calljmp) - /* Make sure stack is 16 byte aligned. */ - andi. 0, 5, 0xf - sub 5, 5, 0 - addi 5, 5, -16 - - /* Save old stack/link pointer on new stack. */ - std 1, 0(5) + .globl clib_calljmp + .section ".opd","aw" + .align 3 +clib_calljmp: + .quad .L.clib_calljmp,.TOC.@tocbase,0 + .previous + .type clib_calljmp, @function +.L.clib_calljmp: mflr 0 - std 0, 8(5) - - /* Switch stacks. */ - mr 1, 5 - - /* Get function pointer. */ - ld 0, 0(3) - mtctr 0 - - /* Move argument into place. */ - mr 3, 4 - - /* Away we go. */ + mr 9,3 + std 0,16(1) + stdu 1,-112(1) +#APP + std 1,-8(5) + addi 5,5,-256 + mr 1,5 +#NO_APP + ld 10,0(9) + std 2,40(1) + mr 3,4 + mtctr 10 + ld 11,16(9) + ld 2,8(9) bctrl - - /* Switch back to old stack. */ - ld 0, 8(1) + ld 2,40(1) +#APP + addi 1,1,256 + ld 1,-8(1) +#NO_APP + addi 1,1,112 + ld 0,16(1) mtlr 0 - ld 0, 0(1) - mr 1, 0 - - /* Return to caller. */ blr + .long 0 + .byte 0,0,0,1,128,0,0,0 + .size clib_calljmp,.-.L.clib_calljmp #elif defined(__powerpc__) diff --git a/vppinfra/vppinfra/unix-formats.c b/vppinfra/vppinfra/unix-formats.c index f39a4be7..a4c81ca2 100644 --- a/vppinfra/vppinfra/unix-formats.c +++ b/vppinfra/vppinfra/unix-formats.c @@ -884,10 +884,12 @@ u8 * format_signal (u8 * s, va_list * args) u8 * format_ucontext_pc (u8 * s, va_list * args) { - ucontext_t * uc = va_arg (*args, ucontext_t *); + ucontext_t * uc __attribute__((unused)); unsigned long * regs = 0; uword reg_no = 0; + uc = va_arg (*args, ucontext_t *); + #if defined (powerpc) regs = &uc->uc_mcontext.uc_regs->gregs[0]; #elif defined (powerpc64) -- cgit 1.2.3-korg