lambda-11235 / tcp_davis

1 stars 2 forks source link

Problems trying to compile TCP_DAVIS on Debian 10 Kernel 4.19.x #1

Closed fernandodiacenco closed 3 years ago

fernandodiacenco commented 3 years ago

Hi there,

Try as I might I am not able to compile tcp_davis on Debian 10 Kernel 4.19.x, it returns the following error:

Should I be using a different Kernel version or something? I don't know what i'm doing wrong

Thanks.

root@debian:~/tcp_davis# make

make -C "/lib/modules/4.19.0-16-amd64/build" M=/root/tcp_davis modules

make -C nix-build -E '(import <nixpkgs> {}).linux.dev' --no-out-link/lib/modules/*/build M=/root/tcp_davis modules

make -C nix-build -E '(import <nixpkgs> {}).linux_latest.dev' --no-out-link/lib/modules//build M=/root/tcp_davis modules /bin/sh: 1: nix-build: not found make[1]: Entering directory '/root/linux-4.19.181' make[1]: Nothing to be done for '/lib/modules/4.19.181/build'. CC [M] /root/tcp_davis/tcp_davis.o /root/tcp_davis/tcp_davis.c: In function ‘davis_current_time’: /root/tcp_davis/tcp_davis.c:90:24: error: ‘struct tcp_sock’ has no member named ‘tcp_clock_cache’; did you mean ‘recv_sack_cache’? return div_u64(tp->tcp_clock_cache, NSEC_PER_USEC); ^~~~~~~ recv_sack_cache /root/tcp_davis/tcp_davis.c: In function ‘tcp_davis_release’: /root/tcp_davis/tcp_davis.c:199:19: warning: unused variable ‘davis’ [-Wunused-variable] struct davis davis = inet_csk_ca(sk); ^~~~~ /root/tcp_davis/tcp_davis.c: In function ‘davis_current_time’: /root/tcp_davis/tcp_davis.c:91:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:315: /root/tcp_davis/tcp_davis.o] Error 1 make[1]: [Makefile:1562: module/root/tcp_davis] Error 2 make[1]: Leaving directory '/root/linux-4.19.181' make: *** [Makefile:11: all] Error 2

lambda-11235 commented 3 years ago

It's failing because it's setup to execute on NixOS, which is a bit odd compared to most distros. Changing which lines are commented in the Makefile to the first line (i.e. make -C "/lib/modules/4.19.0-16-amd64/build" M=/root/tcp_davis modules) and commenting the other lines should fix your issue. I just pushed a change that makes this the default.

fernandodiacenco commented 3 years ago

Thank you

It compiles correctly on kernel 5.4.x and newer, tested on Debian 10 with those kernels

But it will not compile on a kernel earlier than 5.4.x, so if anybody else is having problems: update your kernel

At the time of this writing both 5.4.x and 5.10.x are longterm kernels.