-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
111 lines (89 loc) · 3.16 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
all: build
# TODO: make it so that if mlx5 drivers are not present on this machine, it only
# tries to build the dpdk version of things
# TODO:
# 1. Separate out mlx5 and dpdk and ice feature flags so dpdk works
# independently.
# 2. Have targets for cf-kv that depend on mlx5 or ice (and compile the
# datapath accordingly)
comma:= ,
empty:=
space:= $(empty) $(empty)
CARGOFLAGS ?=
CARGOFEATURES =
datapath =
ifneq ($(DEBUG), y)
CARGOFLAGS += --release
endif
ifeq ($(CONFIG_MLX5), y)
CARGOFEATURES +=mlx5
datapath += mlx5-datapath
endif
ifeq ($(CONFIG_DPDK), y)
CARGOFEATURES +=dpdk
endif
ifeq ($(CONFIG_ICE), y)
CARGOFEATURES +=ice
datapath += ice-datapath
endif
ifeq ($(PROFILER), y)
CARGOFEATURES +=profiler
endif
CARGOFEATURES := $(subst $(space),$(comma),$(CARGOFEATURES))
tapir: mlx5-datapath
cargo b --package mlx5-datapath-c $(CARGOFLAGS)
cargo b --package tapir $(CARGOFLAGS)
CORNFLAKES_PATH=$(PWD) make -C tapir/c/tapir-cf
redis: mlx5-datapath
cargo b --package mlx5-datapath-c $(CARGOFLAGS)
cargo b --package cf-kv $(CARGOFLAGS)
cd $(PWD)/cf-kv/c/kv-redis-c && cargo b $(CARGOFLAGS)
cd ../../..
CORNFLAKES_PATH=$(PWD) make -C redis -j
kv:$(datapath)
cargo b --package cf-kv $(CARGOFLAGS) --features $(CARGOFEATURES)
ds-echo: $(datapath)
cargo b --package ds-echo $(CARGOFLAGS) --features $(CARGOFEATURES)
sg-bench: $(datapath)
cargo b --package sg-bench-client $(CARGOFLAGS) --features $(CARGOFEATURES)
build: mlx5-datapath
cargo b $(CARGOFLAGS) --features $(CARGOFEATURES)
.PHONY: mlx5-datapath mlx5-netperf scatter-gather-bench ice-datapath kv ds-echo sg-bench
# scatter-gather bench microbenchmark
scatter-gather-bench:
PKG_CONFIG_PATH=$(mkfile_dir)dpdk-datapath/3rdparty/dpdk/build/lib/x86_64-linux-gnu/pkgconfig make -C scatter-gather-bench CONFIG_MLX5=$(CONFIG_MLX5) DEBUG=$(DEBUG) GDB=$(GDB)
dpdk:
# apply DPDK patch to dpdk datapath submodule
git -C dpdk-datapath/3rdparty/dpdk apply ../dpdk-mlx.patch
# build dpdk datapath submodule
dpdk-datapath/3rdparty/build-dpdk.sh $(PWD)/dpdk-datapath/3rdparty/dpdk
ice-datapath:
$(MAKE) -C ice-datapath/ice-wrapper DPDK_PATH=$(mkfile_dir)dpdk-datapath/3rdparty/dpdk
mlx5-datapath:
$(MAKE) -C mlx5-datapath/mlx5-wrapper CONFIG_MLX5=$(CONFIG_MLX5) DEBUG=$(DEBUG) GDB=$(GDB)
# mlx5 netperf microbenchmark
mlx5-netperf:
$(MAKE) -C mlx5-netperf CONFIG_MLX5=$(CONFIG_MLX5) DEBUG=$(DEBUG)
# clean up the system and components
clean:
rm -rf mlx5-datapath/mlx5-wrapper/rdma-core/build
$(MAKE) -C mlx5-datapath/mlx5-wrapper clean
$(MAKE) -C mlx5-netperf clean
$(MAKE) -C scatter-gather-bench clean
$(MAKE) -C ice-datapath/ice-wrapper clean
rm -rf dpdk-datapath/3rdparty/dpdk/build
rm -rf dpdk-datapath/3rdparty/dpdk/install
cargo clean
# initialize all of the submodules
submodules:
# build rdma-core
ifeq ($(CONFIG_MLX5), y)
$(MAKE) submodules -C mlx5-datapath/mlx5-wrapper
$(MAKE) submodules -C mlx5-netperf
endif
# apply DPDK patch to dpdk datapath submodule
git -C dpdk-datapath/3rdparty/dpdk apply ../dpdk-mlx.patch
# build dpdk datapath submodule
dpdk-datapath/3rdparty/build-dpdk.sh $(PWD)/dpdk-datapath/3rdparty/dpdk