* Copyright(c) 2017 Intel Corporation
*/
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#define _WITH_GETLINE
#endif
#include <stdio.h>
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2016-2017 Intel Corporation
*/
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#define _WITH_GETLINE
#endif
#include <stdio.h>
#endif
/* on FreeBSD, mlockall() is disabled by default */
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
do_mlockall = 0;
#else
do_mlockall = 1;
#include <unistd.h> /* readlink */
#include <sys/wait.h>
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#define self "curproc"
#define exe "file"
#else
test_alarm(void)
{
int count = 0;
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
printf("The alarm API is not supported on FreeBSD\n");
return 0;
#endif
test_whitelist_flag(void)
{
unsigned i;
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
#else
static int
test_invalid_b_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
#else
static int
test_invalid_vdev_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point, and we also need to
* run another primary process here */
const char * prefix = no_shconf;
static int
test_invalid_r_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
#else
static int
test_missing_c_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
#else
static int
test_master_lcore_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char *prefix = "";
#else
static int
test_invalid_n_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
#else
{
char prefix[PATH_MAX] = "";
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
return 0;
#else
char tmp[PATH_MAX];
static int
test_no_huge_flag(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point, and we also need to
* run another primary process here */
const char * prefix = no_shconf;
printf("Error - process did not run ok with --no-huge and -m flags\n");
return -1;
}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target does not support NUMA, hence no --socket-mem tests */
return 0;
#endif
test_misc_flags(void)
{
char hugepath[PATH_MAX] = {0};
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
const char * nosh_prefix = "";
return -1;
}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* no more tests to be done on FreeBSD */
return 0;
#endif
*/
char prefix[PATH_MAX] = "";
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
return 0;
#else
if (get_current_prefix(prefix, sizeof(prefix)) == NULL) {
static int
test_memory_flags(void)
{
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD target doesn't support prefixes at this point */
const char * prefix = "";
#else
char invalid_socket_mem[SOCKET_MEM_STRLEN];
char buf[SOCKET_MEM_STRLEN]; /* to avoid copying string onto itself */
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
int i, num_sockets = 1;
#else
int i, num_sockets = RTE_MIN(get_number_of_sockets(),
return -1;
}
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* no other tests are applicable to BSD */
return 0;
#endif
unsigned valid_number;
unsigned long retval = 0;
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD doesn't have /proc/pid/fd */
return 0;
#endif
{
const char *rte_retval;
const char *libc_retval;
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
/* BSD has a colon in the string, unlike linux */
const char unknown_code_result[] = "Unknown error: %d";
#else
MEMPOOL_HEADER_SIZE(mp, mp->cache_size))
GOTO_ERR(ret, out);
-#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2iova() not supported on bsd */
+#ifndef RTE_EXEC_ENV_FREEBSD /* rte_mem_virt2iova() not supported on bsd */
printf("get physical address of an object\n");
if (rte_mempool_virt2iova(obj) != rte_mem_virt2iova(obj))
GOTO_ERR(ret, out);
CONFIG_RTE_EXEC_ENV="bsdapp"
CONFIG_RTE_EXEC_ENV_BSDAPP=y
+CONFIG_RTE_EXEC_ENV_FREEBSD=y
#
# FreeBSD contiguous memory driver settings
#ifdef RTE_EXEC_ENV_LINUX
#define RTE_EXEC_ENV_LINUXAPP 1
#endif
+#ifdef RTE_EXEC_ENV_FREEBSD
+#define RTE_EXEC_ENV_BSDAPP 1
+#endif
/****** library defines ********/
The following config options can be used:
* ``CONFIG_RTE_EXEC_ENV`` is a string that contains the name of the executive environment.
-* ``CONFIG_RTE_EXEC_ENV_BSDAPP`` or ``CONFIG_RTE_EXEC_ENV_LINUX`` are defined only if we are building for this execution environment.
+* ``CONFIG_RTE_EXEC_ENV_FREEBSD`` or ``CONFIG_RTE_EXEC_ENV_LINUX`` are defined only if we are building for this execution environment.
Library Statistics
------------------
ifneq ($(CONFIG_RTE_EXEC_ENV_LINUX),)
SYSTEM := linux
endif
-ifneq ($(CONFIG_RTE_EXEC_ENV_BSDAPP),)
+ifneq ($(CONFIG_RTE_EXEC_ENV_FREEBSD),)
SYSTEM := bsd
endif
ifneq ($(CONFIG_RTE_EXEC_ENV_LINUX),)
SYSTEM := linux
endif
-ifneq ($(CONFIG_RTE_EXEC_ENV_BSDAPP),)
+ifneq ($(CONFIG_RTE_EXEC_ENV_FREEBSD),)
$(error "VMBUS not implemented for BSD yet")
endif
&((struct txq *)((s)->fs_dev->data->tx_queues[i]))->refcnt[(s)->sid] \
)
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#define FS_THREADID_TYPE void*
#define FS_THREADID_FMT "p"
#else
#include <sys/ioctl.h>
#include <unistd.h>
-#if defined(RTE_EXEC_ENV_BSDAPP)
+#if defined(RTE_EXEC_ENV_FREEBSD)
#include <sys/sysctl.h>
#include <net/if_dl.h>
#endif
return 0;
-#elif defined(RTE_EXEC_ENV_BSDAPP)
+#elif defined(RTE_EXEC_ENV_FREEBSD)
void *mac_addrs;
struct if_msghdr *ifm;
struct sockaddr_dl *sdl;
include $(RTE_SDK)/mk/rte.vars.mk
DIRS-$(CONFIG_RTE_EXEC_ENV_LINUX) += linux
-DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += freebsd
+DIRS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += freebsd
include $(RTE_SDK)/mk/rte.subdir.mk
include $(RTE_SDK)/mk/rte.vars.mk
-DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += contigmem
-DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += nic_uio
+DIRS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += contigmem
+DIRS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += nic_uio
include $(RTE_SDK)/mk/rte.subdir.mk
DIRS-y += common
DIRS-$(CONFIG_RTE_EXEC_ENV_LINUX) += linux
DEPDIRS-linux := common
-DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += freebsd
+DIRS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += freebsd
DEPDIRS-freebsd := common
include $(RTE_SDK)/mk/rte.subdir.mk
rte_strerror(int errnum)
{
/* BSD puts a colon in the "unknown error" messages, Linux doesn't */
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
static const char *sep = ":";
#else
static const char *sep = "";
*/
#include <stdint.h>
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#include <sys/endian.h>
#else
#include <endian.h>
}
/* pull in a strlcpy function */
-#ifdef RTE_EXEC_ENV_BSDAPP
+#ifdef RTE_EXEC_ENV_FREEBSD
#ifndef __BSD_VISIBLE /* non-standard functions are hidden */
#define strlcpy(dst, src, size) rte_strlcpy(dst, src, size)
#define strlcat(dst, src, size) rte_strlcat(dst, src, size)
#define strlcat(dst, src, size) rte_strlcat(dst, src, size)
#endif /* RTE_USE_LIBBSD */
-#endif /* BSDAPP */
+#endif /* FREEBSD */
/**
* Copy string src to buffer dst of size dsize.
include $(RTE_SDK)/mk/rte.vars.mk
-DIRS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal
+DIRS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal
include $(RTE_SDK)/mk/rte.subdir.mk
LIBABIVER := 9
# specific to bsdapp exec-env
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) := eal.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_cpuflags.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_memory.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_hugepage_info.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_thread.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_debug.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_memalloc.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_lcore.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_timer.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_interrupts.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_alarm.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_dev.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) := eal.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_cpuflags.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_memory.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_hugepage_info.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_thread.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_debug.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_memalloc.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_lcore.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_timer.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_interrupts.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_alarm.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_dev.c
# from common dir
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_lcore.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_timer.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_memzone.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_log.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_launch.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_memalloc.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_memory.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_tailqs.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_errno.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_cpuflags.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_hypervisor.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_string_fns.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_hexdump.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_devargs.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_class.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_bus.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_dev.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_options.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_thread.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_proc.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_fbarray.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += eal_common_uuid.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_malloc.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += hotplug_mp.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += malloc_elem.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += malloc_heap.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += malloc_mp.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_keepalive.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_option.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_service.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_reciprocal.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_lcore.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_timer.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_memzone.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_log.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_launch.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_memalloc.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_memory.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_tailqs.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_errno.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_cpuflags.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_hypervisor.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_string_fns.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_hexdump.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_devargs.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_class.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_bus.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_dev.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_options.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_thread.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_proc.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_fbarray.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += eal_common_uuid.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_malloc.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += hotplug_mp.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_elem.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_heap.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_mp.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_keepalive.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_option.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_service.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_reciprocal.c
# from arch dir
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_cpuflags.c
-SRCS-$(CONFIG_RTE_EXEC_ENV_BSDAPP) += rte_hypervisor.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_cpuflags.c
+SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_hypervisor.c
SRCS-$(CONFIG_RTE_ARCH_X86) += rte_spinlock.c
SRCS-y += rte_cycles.c
INC := # no bsdapp specific headers
-SYMLINK-$(CONFIG_RTE_EXEC_ENV_BSDAPP)-include/exec-env := \
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_FREEBSD)-include/exec-env := \
$(addprefix include/exec-env/,$(INC))
include $(RTE_SDK)/mk/rte.lib.mk
subdir('linux/eal')
elif host_machine.system() == 'freebsd'
- dpdk_conf.set('RTE_EXEC_ENV_BSDAPP', 1)
+ dpdk_conf.set('RTE_EXEC_ENV_FREEBSD', 1)
subdir('freebsd/eal')
else