Closed NobinPegasus closed 8 months ago
Hello! Thanks for spotting this. I was refactoring some code and forgot to update the example - I've fixed that now.
Try pulling down the latest version and see if that runs correctly.
Please let me know how you get on and if the balancer example works correctly on your setup.
It throws a new error now.
pegasus@pegasus:~/Documents/eBPF/xvs$ make example
test -f bpf/bpf.o.gz || make bpf/bpf.o.gz
cd balancer && make
make[1]: Entering directory '/home/pegasus/Documents/eBPF/xvs/balancer'
go build -race
# github.com/davidcoles/xvs/bpf
store_tcp.c:1: error: unterminated #ifdef
1 | #ifdef __BPF__ // Skip all of this with CGO
|
make[1]: *** [Makefile:20: build] Error 1
make[1]: Leaving directory '/home/pegasus/Documents/eBPF/xvs/balancer'
make: *** [Makefile:17: example] Error 2
Oh, interesting - I don;t get that. Where does "store_tcp.c" come from? What compiler (and version/architecture) are you using?
Can you maybe try building from a fresh checkout? eg.:
root@balancer:/tmp# git clone https://github.com/davidcoles/xvs.git
Cloning into 'xvs'...
remote: Enumerating objects: 220, done.
remote: Counting objects: 100% (220/220), done.
remote: Compressing objects: 100% (142/142), done.
remote: Total 220 (delta 132), reused 156 (delta 72), pack-reused 0
Receiving objects: 100% (220/220), 279.54 KiB | 5.48 MiB/s, done.
Resolving deltas: 100% (132/132), done.
root@balancer:/tmp# cd xvs/
root@balancer:/tmp/xvs# make example
test -f bpf/bpf.o.gz || make bpf/bpf.o.gz
cd balancer && make
make[1]: Entering directory '/tmp/xvs/balancer'
git clone -b v1.3.0 https://github.com/libbpf/libbpf
Cloning into 'libbpf'...
remote: Enumerating objects: 11831, done.
remote: Counting objects: 100% (3041/3041), done.
remote: Compressing objects: 100% (708/708), done.
remote: Total 11831 (delta 2304), reused 2392 (delta 2272), pack-reused 8790
Receiving objects: 100% (11831/11831), 9.08 MiB | 28.78 MiB/s, done.
Resolving deltas: 100% (7962/7962), done.
Note: switching to '20c0a9e3d7e7d4aeb283eae982543c9cacc29477'.
< ... many libbpf build steps removed for brevity ... >
CC sharedobjs/elf.o
CC libbpf.so.1.3.0
make[2]: Leaving directory '/tmp/xvs/balancer/libbpf/src'
go build -race
# github.com/davidcoles/xvs/xdp
In file included from ../xdp/xdp.go:23:
/tmp/xvs/balancer/libbpf/src/bpf.h:556:60: warning: ‘struct bpf_link_info’ declared inside parameter list will not be visible outside of this definition or declaration
556 | LIBBPF_API int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len);
| ^~~~~~~~~~~~~
In file included from ../xdp/xdp.go:24:
/tmp/xvs/balancer/libbpf/src/libbpf.h:70:54: warning: ‘enum bpf_link_type’ declared inside parameter list will not be visible outside of this definition or declaration
70 | LIBBPF_API const char *libbpf_bpf_link_type_str(enum bpf_link_type t);
| ^~~~~~~~~~~~~
# github.com/davidcoles/xvs/xdp
In file included from xdp.c:1:
/tmp/xvs/balancer/libbpf/src/bpf.h:556:60: warning: ‘struct bpf_link_info’ declared inside parameter list will not be visible outside of this definition or declaration
556 | LIBBPF_API int bpf_link_get_info_by_fd(int link_fd, struct bpf_link_info *info, __u32 *info_len);
| ^~~~~~~~~~~~~
In file included from xdp.c:2:
/tmp/xvs/balancer/libbpf/src/libbpf.h:70:54: warning: ‘enum bpf_link_type’ declared inside parameter list will not be visible outside of this definition or declaration
70 | LIBBPF_API const char *libbpf_bpf_link_type_str(enum bpf_link_type t);
| ^~~~~~~~~~~~~
make[1]: Leaving directory '/tmp/xvs/balancer'
root@balancer:/tmp/xvs#
Thanks.
HI there. I'll close this issue down in a couple of days if we can't reproduce the problem now. Thanks.