Commit ae54ba42 authored by Joanne Hugé's avatar Joanne Hugé

Link static libraries to trx_ecpri_dpdk

parent 610210c8
......@@ -3,8 +3,9 @@
CC=gcc -m64 -msse4.1
CXX=g++ -m64 -msse4.1
CFLAGS=-O2 -fno-strict-aliasing -Wall -pedantic -std=gnu17
CFLAGS=-fno-strict-aliasing -Wall -pedantic
CFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CFLAGS +=-DALLOW_EXPERIMENTAL_API
CFLAGS+=-MMD -g
CXXFLAGS=$(CFLAGS)
......@@ -22,23 +23,16 @@ ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
$(error "no installation of DPDK found")
endif
all: $(LIB)
$(LIB): $(APP).o
$(CC) -shared $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $<
.PHONY: shared
shared: build/$(APP)-shared
ln -sf $(APP)-shared build/$(APP)
PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) -lpthread -lm
LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
LDFLAGS = -l:libpthread.a -l:libm.a
CFLAGS += -DALLOW_EXPERIMENTAL_API
all: $(LIB)
build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
$(LIB): $(APP).o
$(CC) -shared $(LDFLAGS) $(LDFLAGS_STATIC) -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) $(SRCS-y) -fpic -c -o $@
......@@ -46,7 +40,7 @@ build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
build:
@mkdir -p $@
.PHONY: clean
.PHONY: clean shared
clean:
rm -rf build
rm -rf $(LIB)
......
......@@ -11,7 +11,6 @@ CXXFLAGS=$(CFLAGS)
LIB=trx_ecpri_dpdk
LIBDIR=/root/ecpri/trx-ecpri-priv
LDFLAGS=-l$(LIB)
LDFLAGS+=-L/usr/local/lib/x86_64-linux-gnu -Wl,--as-needed -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_regexdev -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs -lbsd -lpthread -lm
PROG=test-dpdk-ecpri
......
......@@ -324,8 +324,6 @@ static void init_dpdk(int argc, char ** argv) {
if (port_init(0, mbuf_pool) != 0)
rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", 0);
if (port_init(1, mbuf_pool) != 0)
rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n", 1);
}
static void send_packets(int port) {
struct rte_mbuf * pkt[BURST_SIZE];
......@@ -708,7 +706,7 @@ static int start_threads(TRXEcpriState * s) {
int startdpdk(TRXEcpriState * s) {
uint8_t ecpri_message[DATA_SIZE];
#define ARGC 9
#define ARGC 11
#define ARGC_LEN 256
char _argv[ARGC][ARGC_LEN] = {
"",
......@@ -717,6 +715,8 @@ int startdpdk(TRXEcpriState * s) {
"-b",
"0000:04:00.0",
"-b",
"0000:3b:00.1",
"-b",
"0000:5e:00.0",
"-b",
"0000:5e:00.1",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment