2016-08-10 17:28:20 +00:00
|
|
|
#
|
|
|
|
# BSD LICENSE
|
|
|
|
#
|
|
|
|
# Copyright (c) Intel Corporation.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# * Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# * Neither the name of Intel Corporation nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
|
|
|
# from this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
|
|
|
|
# This makefile snippet must define the following flags:
|
|
|
|
# ENV_CFLAGS
|
|
|
|
# ENV_CXXFLAGS
|
|
|
|
# ENV_LIBS
|
|
|
|
# ENV_LINKER_ARGS
|
|
|
|
|
2018-09-06 21:09:14 +00:00
|
|
|
DPDK_DIR = $(CONFIG_DPDK_DIR)
|
2016-08-10 17:28:20 +00:00
|
|
|
|
|
|
|
export DPDK_ABS_DIR = $(abspath $(DPDK_DIR))
|
|
|
|
|
2016-11-23 20:33:16 +00:00
|
|
|
ifneq (, $(wildcard $(DPDK_ABS_DIR)/include/rte_config.h))
|
2017-09-12 16:09:33 +00:00
|
|
|
DPDK_INC_DIR := $(DPDK_ABS_DIR)/include
|
2016-11-23 20:33:16 +00:00
|
|
|
else
|
2017-09-12 16:09:33 +00:00
|
|
|
DPDK_INC_DIR := $(DPDK_ABS_DIR)/include/dpdk
|
2016-11-23 20:33:16 +00:00
|
|
|
endif
|
2017-09-12 16:09:33 +00:00
|
|
|
DPDK_INC := -I$(DPDK_INC_DIR)
|
2017-01-26 00:23:37 +00:00
|
|
|
|
|
|
|
ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_eal.a))
|
|
|
|
DPDK_LIB_EXT = .a
|
|
|
|
else
|
|
|
|
DPDK_LIB_EXT = .so
|
|
|
|
endif
|
|
|
|
|
|
|
|
DPDK_LIB_LIST = rte_eal rte_mempool rte_ring
|
2016-08-10 17:28:20 +00:00
|
|
|
|
2017-05-03 07:09:10 +00:00
|
|
|
# librte_mempool_ring was new added from DPDK 17.05. Link this library used for
|
|
|
|
# ring based mempool management API.
|
|
|
|
ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_mempool_ring.*))
|
|
|
|
DPDK_LIB_LIST += rte_mempool_ring
|
|
|
|
endif
|
|
|
|
|
2016-08-10 17:28:20 +00:00
|
|
|
# librte_malloc was removed after DPDK 2.1. Link this library conditionally based on its
|
|
|
|
# existence to maintain backward compatibility.
|
|
|
|
ifneq ($(wildcard $(DPDK_ABS_DIR)/lib/librte_malloc.*),)
|
2017-01-26 00:23:37 +00:00
|
|
|
DPDK_LIB_LIST += rte_malloc
|
2016-08-10 17:28:20 +00:00
|
|
|
endif
|
|
|
|
|
2017-11-15 14:15:35 +00:00
|
|
|
# librte_pci and librte_bus_pci were added in DPDK 17.11. Link these libraries conditionally
|
|
|
|
# based on their existence to maintain backward compatibility.
|
|
|
|
ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_pci.*))
|
|
|
|
DPDK_LIB_LIST += rte_pci
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_bus_pci.*))
|
|
|
|
DPDK_LIB_LIST += rte_bus_pci
|
|
|
|
endif
|
|
|
|
|
2018-10-15 20:46:41 +00:00
|
|
|
# There are some complex dependencies when using crypto, reduce or both so
|
|
|
|
# here we add the feature specific ones and set a flag to add the common
|
|
|
|
# ones after that.
|
|
|
|
DPDK_FRAMEWORK=n
|
2018-03-07 23:44:06 +00:00
|
|
|
ifeq ($(CONFIG_CRYPTO),y)
|
2018-10-15 20:46:41 +00:00
|
|
|
DPDK_FRAMEWORK=y
|
|
|
|
DPDK_LIB_LIST += rte_pmd_aesni_mb rte_pmd_qat rte_reorder
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_REDUCE),y)
|
|
|
|
DPDK_FRAMEWORK=y
|
|
|
|
DPDK_LIB_LIST += rte_pmd_isal_comp
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DPDK_FRAMEWORK),y)
|
|
|
|
DPDK_LIB_LIST += rte_cryptodev rte_compressdev rte_bus_vdev
|
2018-03-07 23:44:06 +00:00
|
|
|
endif
|
|
|
|
|
2018-08-14 07:51:17 +00:00
|
|
|
ifneq (, $(wildcard $(DPDK_ABS_DIR)/lib/librte_kvargs.*))
|
|
|
|
DPDK_LIB_LIST += rte_kvargs
|
|
|
|
endif
|
|
|
|
|
2017-01-26 00:23:37 +00:00
|
|
|
DPDK_LIB = $(DPDK_LIB_LIST:%=$(DPDK_ABS_DIR)/lib/lib%$(DPDK_LIB_EXT))
|
|
|
|
|
2018-05-09 05:28:38 +00:00
|
|
|
# SPDK memory registration requires experimental (deprecated) rte_memory API for DPDK 18.05
|
|
|
|
ENV_CFLAGS = $(DPDK_INC) -Wno-deprecated-declarations
|
2016-08-10 17:28:20 +00:00
|
|
|
ENV_CXXFLAGS = $(ENV_CFLAGS)
|
2018-10-12 21:50:36 +00:00
|
|
|
ENV_DPDK_FILE = $(call spdk_lib_list_to_static_libs,env_dpdk)
|
2016-11-18 16:57:53 +00:00
|
|
|
ENV_LIBS = $(ENV_DPDK_FILE) $(DPDK_LIB)
|
2018-10-10 15:55:39 +00:00
|
|
|
ENV_LINKER_ARGS = $(ENV_DPDK_FILE) -Wl,--whole-archive $(DPDK_LIB) -Wl,--no-whole-archive
|
2017-01-26 00:19:05 +00:00
|
|
|
|
2019-01-13 20:28:21 +00:00
|
|
|
ifeq ($(CONFIG_IPSEC_MB),y)
|
|
|
|
ENV_LINKER_ARGS += -lIPSec_MB -L$(IPSEC_MB_DIR)
|
2018-10-15 20:08:44 +00:00
|
|
|
endif
|
|
|
|
|
2018-10-15 20:46:41 +00:00
|
|
|
ifeq ($(CONFIG_REDUCE),y)
|
|
|
|
ENV_LINKER_ARGS += -lisal -L$(ISAL_DIR)/.libs
|
|
|
|
endif
|
|
|
|
|
2017-09-12 16:09:33 +00:00
|
|
|
ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_config.h))
|
2018-06-15 12:48:32 +00:00
|
|
|
ifneq (,$(shell grep -e "define RTE_LIBRTE_VHOST_NUMA 1" -e "define RTE_EAL_NUMA_AWARE_HUGEPAGES 1" $(DPDK_INC_DIR)/rte_config.h))
|
2017-09-07 18:13:28 +00:00
|
|
|
ENV_LINKER_ARGS += -lnuma
|
|
|
|
endif
|
2017-09-12 16:09:33 +00:00
|
|
|
endif
|
2017-09-07 18:13:28 +00:00
|
|
|
|
2017-01-26 00:19:05 +00:00
|
|
|
ifeq ($(OS),Linux)
|
|
|
|
ENV_LINKER_ARGS += -ldl
|
|
|
|
endif
|
|
|
|
ifeq ($(OS),FreeBSD)
|
|
|
|
ENV_LINKER_ARGS += -lexecinfo
|
|
|
|
endif
|