-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (103 loc) · 4.91 KB
/
Makefile
File metadata and controls
132 lines (103 loc) · 4.91 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.PHONY: all ebpf rust clean cleanup help
.PHONY: list-algorithms check-algorithms run
.PHONY: test test-register test-quick test-full test-all-algorithms
.PHONY: test-cubic test-reno test-generic-cubic test-generic-reno
.PHONY: test-quick-cubic test-quick-reno test-quick-generic-cubic test-quick-generic-reno
.PHONY: test-full-cubic test-full-reno test-full-generic-cubic test-full-generic-reno
BINARY := ./target/release/ebpf-ccp-generic
## ── Help ──────────────────────────────────────────────────────────────────────
help:
@echo "Usage: make [target]"
@echo ""
@echo "Build"
@echo " all Build eBPF programs and Rust daemon (full build)"
@echo " ebpf Build only the eBPF kernel programs"
@echo " rust Build only the Rust userspace daemon"
@echo " clean Remove all build artifacts"
@echo ""
@echo "Run"
@echo " run Build and run the daemon (default algorithm: cubic)"
@echo " list-algorithms List available congestion control algorithms"
@echo ""
@echo "Test (require sudo, run inside VM)"
@echo " test-register Verify eBPF struct_ops attachment works"
@echo " test / test-quick 3-second iperf test (default algorithm)"
@echo " test-full 10-second iperf test with packet drops"
@echo " test-all-algorithms Cycle through all algorithms with quick tests"
@echo ""
@echo " Algorithm-specific quick tests:"
@echo " test-quick-cubic test-quick-reno test-quick-generic-cubic test-quick-generic-reno"
@echo ""
@echo " Algorithm-specific full tests:"
@echo " test-full-cubic test-full-reno test-full-generic-cubic test-full-generic-reno"
@echo ""
@echo "Utilities"
@echo " cleanup Kill daemon and detach eBPF programs (run if 'File exists' errors appear)"
@echo ""
@echo "Environment variables (for test targets):"
@echo " ALGORITHM Algorithm name (cubic, reno, generic-cubic, generic-reno) [default: cubic]"
@echo " TEST_DURATION, LATENCY, BANDWIDTH, LOSS — passed through to scripts/test.sh"
## ── Build ─────────────────────────────────────────────────────────────────────
all: ebpf rust
ebpf:
@echo "Building eBPF programs..."
$(MAKE) -C ebpf
rust: ebpf
@echo "Building Rust daemon..."
cargo build --release
clean:
$(MAKE) -C ebpf clean
cargo clean
## ── Run ───────────────────────────────────────────────────────────────────────
run: all
sudo $(BINARY)
list-algorithms: rust
$(BINARY) --list-algorithms
check-algorithms: rust
$(BINARY) --list-algorithms
## ── Test ──────────────────────────────────────────────────────────────────────
cleanup:
sudo ./scripts/cleanup-named.sh
sudo ./scripts/cleanup_generic.sh
test-register: cleanup all
sudo ALGORITHM=generic-cubic ./scripts/test.sh basic
# Quick tests (3 seconds)
test-quick: cleanup all
sudo ./scripts/test.sh quick
test-quick-cubic: cleanup all
sudo ALGORITHM=cubic ./scripts/test.sh quick
test-quick-reno: cleanup all
sudo ALGORITHM=reno ./scripts/test.sh quick
test-quick-generic-cubic: cleanup all
sudo ALGORITHM=generic-cubic ./scripts/test.sh quick
test-quick-generic-reno: cleanup all
sudo ALGORITHM=generic-reno ./scripts/test.sh quick
# Full 10-second tests
test-full: cleanup all
sudo ./scripts/test.sh full
test-full-cubic: cleanup all
sudo ALGORITHM=cubic ./scripts/test.sh full
test-full-reno: cleanup all
sudo ALGORITHM=reno ./scripts/test.sh full
test-full-generic-cubic: cleanup all
sudo ALGORITHM=generic-cubic ./scripts/test.sh full
test-full-generic-reno: cleanup all
sudo ALGORITHM=generic-reno ./scripts/test.sh full
test-cubic: test-quick-cubic
test-reno: test-quick-reno
test-generic-cubic: test-quick-generic-cubic
test-generic-reno: test-quick-generic-reno
test-all-algorithms: cleanup all
@sudo ALGORITHM=cubic ./scripts/test.sh quick
@sudo ./scripts/cleanup-named.sh
@sleep 2
@sudo ALGORITHM=reno ./scripts/test.sh quick
@sudo ./scripts/cleanup-named.sh
@sleep 2
@sudo ALGORITHM=generic-cubic ./scripts/test.sh quick
@sudo ./scripts/cleanup_generic.sh
@sleep 2
@sudo ALGORITHM=generic-reno ./scripts/test.sh quick
@sudo ./scripts/cleanup_generic.sh
test: test-quick
## ──────────────────────────────────────────────────────────────────────────────