Patch from Kernel 5.1 will not work with 5.2
Roland-F opened this issue · comments
I try to build a new kernel 5.2.0 (x86 and X86_64) including linuximq.
Here i use the patch from kernel 5.1, but the build will fail.
The fault will be:
In file included from ./include/linux/filter.h:25:0,
from arch/x86/net/bpf_jit_comp.c:9:
./include/net/sch_generic.h: In function 'qdisc_enqueue_root':
./include/net/sch_generic.h:149:5: error: implicit declaration of function 'qdisc_skb_cb' [-Werror=implicit-function-declaration]
qdisc_skb_cb(skb)->pkt_len = skb->len;
^~~~~~~~~~~~
./include/net/sch_generic.h:149:22: error: invalid type argument of '->' (have 'int')
qdisc_skb_cb(skb)->pkt_len = skb->len;
^~
./include/net/sch_generic.h:150:12: error: implicit declaration of function 'qdisc_enqueue'; did you mean 'qdisc_enqueue_root'? [-Werror=implicit-function-declaration]
return qdisc_enqueue(skb, sch, to_free) & NET_XMIT_MASK;
^~~~~~~~~~~~~
qdisc_enqueue_root
./include/net/sch_generic.h: At top level:
./include/net/sch_generic.h:515:36: error: conflicting types for 'qdisc_skb_cb'
static inline struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb)
^~~~~~~~~~~~
./include/net/sch_generic.h:149:5: note: previous implicit declaration of 'qdisc_skb_cb' was here
qdisc_skb_cb(skb)->pkt_len = skb->len;
^~~~~~~~~~~~
./include/net/sch_generic.h:827:19: error: static declaration of 'qdisc_enqueue' follows non-static declaration
static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
^~~~~~~~~~~~~
./include/net/sch_generic.h:150:12: note: previous implicit declaration of 'qdisc_enqueue' was here
return qdisc_enqueue(skb, sch, to_free) & NET_XMIT_MASK;
^~~~~~~~~~~~~
Try compiling after moving the following function down in the file ./include/net/sch_generic.h right below the function static inline int qdisc_enqueue(struct sk_buff
static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff **to_free)
{
qdisc_skb_cb(skb)->pkt_len = skb->len;
return qdisc_enqueue(skb, sch, to_free) & NET_XMIT_MASK;
}
Seems that the build will work then.
Changed in the patch from kernel 5.1 the lines (Original):
@@ -806,6 +806,13 @@ static inline int qdisc_enqueue(struct s
return sch->enqueue(skb, sch, to_free);
}
+static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch,
+ struct sk_buff **to_free)
+{
+ qdisc_skb_cb(skb)->pkt_len = skb->len;
+ return qdisc_enqueue(skb, sch, to_free) & NET_XMIT_MASK;
+}
+
static inline bool qdisc_is_percpu_stats(const struct Qdisc *q)
{
return q->flags & TCQ_F_CPUSTATS;
to new:
@@ -827,6 +827,13 @@ static inline int qdisc_enqueue(struct s
return sch->enqueue(skb, sch, to_free);
}
+static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch,
+ struct sk_buff **to_free)
+{
+ qdisc_skb_cb(skb)->pkt_len = skb->len;
+ return qdisc_enqueue(skb, sch, to_free) & NET_XMIT_MASK;
+}
+
static inline void _bstats_update(struct gnet_stats_basic_packed *bstats,
__u64 bytes, __u32 packets)
{