Closed dnwe closed 1 year ago
Ah I also just found https://github.com/dtaht/sch_cake/issues/152
you good now?
@dtaht yeah, I was musing around minimal change to make the out-of-tree repo trivial to build on RHEL8 — the oddness of the RHEL kernel is that it is nominally 4.18, but it has updates and changes (including sch_cake!) backported from as recent a version as 5.15, so it's not really a 4.18 kernel per se
This patch does work, but obviously the KERNEL_VERSION check isn't really true. I don't know if there's any well-known defines that RHEL surfaces that could be used as a conditional:
diff --git a/pkt_sched.h b/pkt_sched.h
index a2f570c..cbeb4f2 100644
--- a/pkt_sched.h
+++ b/pkt_sched.h
@@ -972,4 +972,8 @@ enum {
CAKE_ATM_MAX
};
+#ifndef TCQ_ETS_MAX_BANDS
+#define TCQ_ETS_MAX_BANDS 16
+#endif
+
#endif
diff --git a/sch_cake.c b/sch_cake.c
index 0861c9b..94758aa 100644
--- a/sch_cake.c
+++ b/sch_cake.c
@@ -1776,7 +1776,11 @@ static u32 cake_classify(struct Qdisc *sch, struct cake_tin_data **t,
goto hash;
*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
+ result = tcf_classify(skb, NULL, filter, &res, false);
+#else
result = tcf_classify(skb, filter, &res, false);
+#endif
if (result >= 0) {
#ifdef CONFIG_NET_CLS_ACT
The alternative is to do what was done in https://github.com/dtaht/sch_cake/issues/152 and fetch sch_cake.c from the EL8 kernel source instead and compile that — but having this standalone repo is quite convenient
RHEL 8 ships with a 4.18 kernel which pre-dates the in-kernel release in 4.19. However, this out-of-tree repo is missing a definition for TCQ_ETS_MAX_BANDS (previously raised under #139) and some changes to the method signatures: