dtaht / sch_cake

Out of tree build for the new cake qdisc
100 stars 35 forks source link

Building on EL8 #152

Closed fuero closed 2 years ago

fuero commented 2 years ago

Hi,

I'm trying to build this on EL8 (Rocky), but it fails:

Compiler version: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4) Kernel version: 4.18.0-348.el8

master branch:

/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c: In function 'cake_update_flowkeys':
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:599:6: error: implicit declaration of function 'tc_skb_protocol'; did you mean 'skb_protocol'? [-Werror=implicit-function-declaration]
  if (tc_skb_protocol(skb) != htons(ETH_P_IP))
      ^~~~~~~~~~~~~~~
      skb_protocol
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c: In function 'cake_classify':
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:1615:29: error: passing argument 2 of 'tcf_classify' from incompatible pointer type [-Werror=incompatible-pointer-types]
  result = tcf_classify(skb, filter, &res, false);
                             ^~~~~~
In file included from /srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:70:
./include/net/pkt_cls.h:80:28: note: expected 'const struct tcf_block *' but argument is of type 'struct tcf_proto *'
    const struct tcf_block *block,
    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:1615:37: error: passing argument 3 of 'tcf_classify' from incompatible pointer type [-Werror=incompatible-pointer-types]
  result = tcf_classify(skb, filter, &res, false);
                                     ^~~~
In file included from /srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:70:
./include/net/pkt_cls.h:81:28: note: expected 'const struct tcf_proto *' but argument is of type 'struct tcf_result *'
    const struct tcf_proto *tp, struct tcf_result *res,
    ~~~~~~~~~~~~~~~~~~~~~~~~^~
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:1615:11: error: too few arguments to function 'tcf_classify'
  result = tcf_classify(skb, filter, &res, false);
           ^~~~~~~~~~~~
In file included from /srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:70:
./include/net/pkt_cls.h:79:5: note: declared here
 int tcf_classify(struct sk_buff *skb,
     ^~~~~~~~~~~~
cc1: some warnings being treated as errors

upstream-4.18 branch:

/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c: In function 'cake_update_flowkeys':
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:599:6: error: implicit declaration of function 'tc_skb_protocol'; did you mean 'skb_protocol'? [-Werror=implicit-function-declaration]
  if (tc_skb_protocol(skb) != htons(ETH_P_IP))
      ^~~~~~~~~~~~~~~
      skb_protocol
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c: In function 'cake_classify':
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:1615:29: error: passing argument 2 of 'tcf_classify' from incompatible pointer type [-Werror=incompatible-pointer-types]
  result = tcf_classify(skb, filter, &res, false);
                             ^~~~~~
In file included from /srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:70:
./include/net/pkt_cls.h:80:28: note: expected 'const struct tcf_block *' but argument is of type 'struct tcf_proto *'
    const struct tcf_block *block,
    ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:1615:37: error: passing argument 3 of 'tcf_classify' from incompatible pointer type [-Werror=incompatible-pointer-types]
  result = tcf_classify(skb, filter, &res, false);
                                     ^~~~
In file included from /srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:70:
./include/net/pkt_cls.h:81:28: note: expected 'const struct tcf_proto *' but argument is of type 'struct tcf_result *'
    const struct tcf_proto *tp, struct tcf_result *res,
    ~~~~~~~~~~~~~~~~~~~~~~~~^~
/srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:1615:11: error: too few arguments to function 'tcf_classify'
  result = tcf_classify(skb, filter, &res, false);
           ^~~~~~~~~~~~
In file included from /srv/sch_cake-86e05267eb708b0c136ce666537265c7efa4439e/sch_cake.c:70:
./include/net/pkt_cls.h:79:5: note: declared here
 int tcf_classify(struct sk_buff *skb,
     ^~~~~~~~~~~~
cc1: some warnings being treated as errors
dtaht commented 2 years ago

cake went into 4.19 directly. I imagine EL8 is stuck on 4.18?

fuero commented 2 years ago

hm... Apparently they backported it but didn't enable it

grep -i CAKE /boot/config-4.18.0-348.12.2.el8_5.x86_64 
# CONFIG_NET_SCH_CAKE is not set

Sorry, I didn't think of checking that. So I guess I might better off building it from the EL kernel sources, but as a kmod package. Not sure how to do that though without having to compile the rest of the kernel.

fuero commented 2 years ago

I managed to compile sch_cake.ko by taking Makefile, Kconfig, and Kbuild from this repo and sch_cake.c from EL8's kernel sources.