sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled
Subsystems (4)
PATCH 1/2 sch_cake: allow setting TCA_CAKE_NAT with value 0 if conntrack is disabled
Allows the 'nonat' option to be specified
--- net/sched/sch_cake.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/sched/sch_cake.c +5 -3
@@ -2583,9 +2583,11 @@ static int cake_change(struct Qdisc *sch, struct nlattr *opt, q->flow_mode |=CAKE_FLOW_NAT_FLAG * !!nla_get_u32 (tb[TCA_CAKE_NAT ]);#else -NL_SET_ERR_MSG_ATTR (extack, tb[TCA_CAKE_NAT ], -"No conntrack support in kernel" ); -return -EOPNOTSUPP ; +if (nla_get_u32 (tb[TCA_CAKE_NAT ])) { +NL_SET_ERR_MSG_ATTR (extack, tb[TCA_CAKE_NAT ], +"No conntrack support in kernel" ); +return -EOPNOTSUPP ; + }#endif }
Signature · 1 line
2.32.0 (Apple Git-132)
PATCH 2/2 sch_fq_codel: fix running with classifiers that don't set a classid
If no valid classid is provided, fall back to calculating the hash directly, in order to avoid dropping packets
--- net/sched/sch_fq_codel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/sched/sch_fq_codel.c +6 -3
@@ -88,7 +88,7 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch, filter =rcu_dereference_bh (q->filter_list);if (!filter) -return fq_codel_hash (q, skb) +1 ; + goto out; *qerr =NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; result =tcf_classify (skb,NULL , filter, &res, false);
@@ -104,10 +104,13 @@ static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch, return 0; }#endif -if (TC_H_MIN (res.classid) <= q->flows_cnt) +if (TC_H_MIN (res.classid) >0 && +TC_H_MIN (res.classid) <= q->flows_cnt)return TC_H_MIN (res.classid); } -return 0 ; + +out: +return fq_codel_hash (q, skb) +1 ; }/* helper functions : might be changed when/if skb use a standard list_head */
Signature · 1 line
2.32.0 (Apple Git-132)
Re: [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid
Quoted 4 lines · Felix Fietkau
If no valid classid is provided, fall back to calculating the hash directly, in order to avoid dropping packets
Signed-off-by Felix Fietkau <[email protected]>
While I agree that this behaviour makes more sense, it's also a user-facing API change; I suppose there may be filters out there relying on the fact that invalid (or unset) class ID values lead to dropped packets?
-Toke
Re: [PATCH 2/2] sch_fq_codel: fix running with classifiers that don't set a classid
Quoted 10 lines · Toke Høiland-Jørgensen
Quoted 4 lines · Felix Fietkau
If no valid classid is provided, fall back to calculating the hash directly, in order to avoid dropping packets
Signed-off-by Felix Fietkau <[email protected]>While I agree that this behaviour makes more sense, it's also a user-facing API change; I suppose there may be filters out there relying on the fact that invalid (or unset) class ID values lead to dropped packets?
Indeed.
This part was copied from SFQ, so if we want to (optionally ?) change the behavior,
same change should be applied to SFQ.
Quoted 3 lines · Felix Fietkau
Allows the 'nonat' option to be specified
Signed-off-by Felix Fietkau <[email protected]>
Right, makes sense!