lkl: update dpdk version to 17.02 from 2.2

We can't link with libdpdk.a (combined library) on circleci (Ubuntu
12.04) while okay on Fedora25.  So link necessary libraries instead.

Now dpdk also uses __attribute__((constructor)) in order to controle the
order of init function.  the hijack library accordingly changes the
order to be executed _after_ dpdk initialization.

Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
This commit is contained in:
Hajime Tazaki
2017-07-20 08:45:00 +09:00
parent 4eeca57f01
commit d4b9b653a1
4 changed files with 17 additions and 5 deletions

View File

@@ -54,12 +54,17 @@ ifneq (,$(filter $(OUTPUT_FORMAT),elf64-x86-64 elf32-i386 elf64-x86-64-freebsd e
# Intel DPDK configuration
ifeq ($(dpdk),yes)
export CONFIG_AUTO_LKL_VIRTIO_NET_DPDK=y
RTE_SDK ?= $(shell pwd)/dpdk-2.2.0
RTE_SDK ?= $(shell pwd)/dpdk-17.02
RTE_TARGET ?= build
DPDK_LIBS = -lrte_pmd_vmxnet3_uio -lrte_pmd_ixgbe -lrte_pmd_e1000
DPDK_LIBS += -lrte_pmd_virtio
DPDK_LIBS += -lrte_timer -lrte_hash -lrte_mbuf -lrte_ethdev -lrte_eal
DPDK_LIBS += -lrte_mempool -lrte_ring -lrte_pmd_ring
DPDK_LIBS += -lrte_kvargs -lrte_net
CFLAGS += -I$(RTE_SDK)/$(RTE_TARGET)/include -msse4.2 -mpopcnt
CFLAGS += -DCONFIG_AUTO_LKL_VIRTIO_NET_DPDK
LDFLAGS +=-L$(RTE_SDK)/$(RTE_TARGET)/lib
LDFLAGS +=-Wl,--whole-archive -ldpdk -Wl,--no-whole-archive -lm -ldl
LDFLAGS +=-Wl,--whole-archive $(DPDK_LIBS) -Wl,--no-whole-archive -lm -ldl
endif
# Virtual Distributed Ethernet configuration
ifeq ($(vde),yes)

View File

@@ -352,3 +352,10 @@ void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset)
return (void *)host_mmap(addr, length, prot, flags, fd, offset);
return lkl_sys_mmap(addr, length, prot, flags, fd, offset);
}
HOST_CALL(__xstat64)
int stat(const char *pathname, struct stat *buf)
{
CHECK_HOST_CALL(__xstat64);
return host___xstat64(0, pathname, buf);
}

View File

@@ -181,7 +181,7 @@ int lkl_debug, lkl_running;
static int nd_id = -1;
static struct lkl_netdev *nd;
void __attribute__((constructor(102)))
void __attribute__((constructor))
hijack_init(void)
{
int ret, i, dev_null, nd_ifindex = -1;

View File

@@ -1,6 +1,6 @@
#!/bin/sh
dpdk_version="2.2.0"
dpdk_version="17.02"
git clone -b v${dpdk_version} git://dpdk.org/dpdk dpdk-${dpdk_version}
@@ -13,5 +13,5 @@ export EXTRA_CFLAGS="-fPIC -O0 -g3"
set -e
cd dpdk-${dpdk_version}
make -j1 T=${RTE_TARGET} config
make -j3 CONFIG_RTE_BUILD_COMBINE_LIBS=y \
make -j3 \
|| (echo "dpdk build failed" && exit 1)