summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs/DPPD-PROX/Makefile')
-rw-r--r--VNFs/DPPD-PROX/Makefile73
1 files changed, 63 insertions, 10 deletions
diff --git a/VNFs/DPPD-PROX/Makefile b/VNFs/DPPD-PROX/Makefile
index 7109cb48..9a675ca0 100644
--- a/VNFs/DPPD-PROX/Makefile
+++ b/VNFs/DPPD-PROX/Makefile
@@ -1,5 +1,5 @@
##
-## Copyright (c) 2010-2017 Intel Corporation
+## Copyright (c) 2010-2019 Intel Corporation
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
@@ -15,25 +15,49 @@
##
ifeq ($(RTE_SDK),)
-$(error "Please define RTE_SDK environment variable")
+define err_msg
+
+Please define RTE_SDK environment variable.
+If DPDK was built with Meson, please use meson to build Prox too.
+***
+endef
+$(error $(err_msg))
endif
# Default target, can be overriden by command line or environment
RTE_TARGET ?= x86_64-native-linuxapp-gcc
+ifeq ($(wildcard $(RTE_SDK)/$(RTE_TARGET)/.),)
+define err_msg
+
+Could not find build target: $(RTE_TARGET)
+Perhaps DPDK was built using meson?
+***
+endef
+$(error $(err_msg))
+endif
+
rte_version_h := $(RTE_SDK)/$(RTE_TARGET)/include/rte_version.h
+rte_config_h := $(RTE_SDK)/$(RTE_TARGET)/include/rte_config.h
rte_ver_part = $(shell sed -n -e 's/^\#define\s*$1\s*\(.*\)$$/\1/p' $(rte_version_h))
+rte_config_part = $(shell sed -n -e 's/^\#define\s*$1\s*\(.*\)$$/\1/p' $(rte_config_h))
rte_ver_eval = $(shell printf '%u' $$(printf '0x%02x%02x%02x%02x' $1 $2 $3 $4))
rte_ver_MMLR = $(call rte_ver_eval,$(call \
rte_ver_part,RTE_VER_MAJOR),$(call \
rte_ver_part,RTE_VER_MINOR),$(call \
rte_ver_part,RTE_VER_PATCH_LEVEL),$(call \
rte_ver_part,RTE_VER_PATCH_RELEASE))
-rte_ver_YMMR = $(call rte_ver_eval,$(call \
+rte_version_YMMR = $(call rte_ver_eval,$(call \
rte_ver_part,RTE_VER_YEAR),$(call \
rte_ver_part,RTE_VER_MONTH),$(call \
rte_ver_part,RTE_VER_MINOR),$(call \
rte_ver_part,RTE_VER_RELEASE))
+rte_config_YMMR = $(call rte_ver_eval,$(call \
+ rte_config_part,RTE_VER_YEAR),$(call \
+ rte_config_part,RTE_VER_MONTH),$(call \
+ rte_config_part,RTE_VER_MINOR),$(call \
+ rte_config_part,RTE_VER_RELEASE))
+rte_ver_YMMR = $(if $(shell test $(rte_config_YMMR) -gt 0 && echo 'y'),$(rte_config_YMMR),$(rte_version_YMMR))
rte_ver_dpdk := $(if $(call rte_ver_part,RTE_VER_MAJOR),$(rte_ver_MMLR),$(rte_ver_YMMR))
rte_ver_comp = $(shell test $(rte_ver_dpdk) $5 $(call rte_ver_eval,$1,$2,$3,$4) && echo 'y')
rte_ver_EQ = $(call rte_ver_comp,$1,$2,$3,$4,-eq)
@@ -125,7 +149,7 @@ CFLAGS += -DPROX_PREFETCH_OFFSET=2
#CFLAGS += -DASSERT
#CFLAGS += -DENABLE_EXTRA_USER_STATISTICS
CFLAGS += -DLATENCY_PER_PACKET
-CFLAGS += -DLATENCY_DETAILS
+CFLAGS += -DLATENCY_HISTOGRAM
CFLAGS += -DGRE_TP
CFLAGS += -std=gnu99
CFLAGS += -D_GNU_SOURCE # for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
@@ -172,14 +196,12 @@ SRCS-y += handle_mirror.c
SRCS-y += handle_genl4.c
SRCS-y += handle_ipv6_tunnel.c
SRCS-y += handle_read.c
-ifeq ($(call rte_ver_LT,17,8,0,0),y)
-ifeq ($(call rte_ver_GE,17,2,0,16),y)
SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += handle_esp.c
ifneq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_MB),y)
+ifeq ($(FIRST_PROX_MAKE),)
$(warning "Building w/o IPSEC support")
endif
endif
-endif
SRCS-y += handle_cgnat.c
SRCS-y += handle_nat.c
SRCS-y += handle_dump.c
@@ -198,7 +220,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += thread_pipeline.c
SRCS-y += prox_args.c prox_cfg.c prox_cksum.c prox_port_cfg.c
SRCS-y += cfgfile.c clock.c commands.c cqm.c msr.c defaults.c
-SRCS-y += display.c display_latency.c display_mempools.c
+SRCS-y += display.c display_latency.c display_latency_distr.c display_mempools.c
SRCS-y += display_ports.c display_rings.c display_priority.c display_pkt_len.c display_l4gen.c display_tasks.c display_irq.c
SRCS-y += log.c hash_utils.c main.c parse_utils.c file_utils.c
SRCS-y += run.c input_conn.c input_curses.c
@@ -207,17 +229,48 @@ SRCS-y += stats_port.c stats_mempool.c stats_ring.c stats_l4gen.c
SRCS-y += stats_latency.c stats_global.c stats_core.c stats_task.c stats_prio.c stats_irq.c
SRCS-y += cmd_parser.c input.c prox_shared.c prox_lua_types.c
SRCS-y += genl4_bundle.c heap.c genl4_stream_tcp.c genl4_stream_udp.c cdf.c
-SRCS-y += stats.c stats_cons_log.c stats_cons_cli.c stats_parser.c hash_set.c prox_lua.c prox_malloc.c
+SRCS-y += stats.c stats_cons_log.c stats_cons_cli.c stats_parser.c hash_set.c prox_lua.c prox_malloc.c prox_ipv6.c prox_compat.c
+SRCS-y += git_version.c
+
+GIT_VERSION := "$(shell git describe --abbrev=8 --dirty --always)"
ifeq ($(FIRST_PROX_MAKE),)
MAKEFLAGS += --no-print-directory
FIRST_PROX_MAKE = 1
export FIRST_PROX_MAKE
-all:
+all: libedit_autoconf.h git_version.c
@./helper-scripts/trailing.sh
@$(MAKE) $@
+clean:
+ $(Q) $(RM) -- 'libedit_autoconf.h'
+ @$(MAKE) $@
%::
@$(MAKE) $@
+
+ifeq ($(call rte_ver_LT,17,2,0,0),y)
+AUTO-CONFIG-SCRIPT = $(RTE_SDK)/scripts/auto-config-h.sh
+else
+AUTO-CONFIG-SCRIPT = $(RTE_SDK)/buildtools/auto-config-h.sh
+endif
+
+# DPDK CFLAGS prevents auto-conf program to properly compile
+export CFLAGS=
+# if el_rfunc_t exists, define HAVE_LIBEDIT_EL_RFUNC_T so that PROX knows it can use it
+libedit_autoconf.h: $(AUTO-CONFIG-SCRIPT)
+ $(Q) $(RM) -- '$@'
+ $(Q) sh -- '$(AUTO-CONFIG-SCRIPT)' '$@' \
+ HAVE_LIBEDIT_EL_RFUNC_T \
+ histedit.h \
+ type 'el_rfunc_t' \
+ > /dev/null
+# auto-conf adds empty line at the end of the file, considered as error by trailing.sh script
+ $(Q) sed -i '$$ d' '$@'
+
+git_version.c: force
+ @echo 'const char *git_version=$(GIT_VERSION);' | cmp -s - $@ || echo 'const char *git_version=$(GIT_VERSION);' > $@
+ @echo $@
+force:
+
else
include $(RTE_SDK)/mk/rte.extapp.mk
endif