[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220307182602.16978-2-nbd@nbd.name>
Date: Mon, 7 Mar 2022 19:26:02 +0100
From: Felix Fietkau <nbd@....name>
To: netdev@...r.kernel.org
Subject: [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
Signed-off-by: Felix Fietkau <nbd@....name>
---
net/sched/sch_fq_codel.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 839e1235db05..b2a13185bb63 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -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 */
--
2.32.0 (Apple Git-132)
Powered by blists - more mailing lists