]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net/sched: Add precise drop reason for pfifo_fast queue overflows
authorFan Yu <fan.yu9@zte.com.cn>
Thu, 24 Jul 2025 13:28:37 +0000 (21:28 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Jul 2025 22:47:21 +0000 (15:47 -0700)
Currently, packets dropped by pfifo_fast due to queue overflow are
marked with a generic SKB_DROP_REASON_QDISC_DROP in __dev_xmit_skb().

This patch adds explicit drop reason SKB_DROP_REASON_QDISC_OVERLIMIT
for queue-full cases, providing better distinction from other qdisc drops.

Signed-off-by: Fan Yu <fan.yu9@zte.com.cn>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Link: https://patch.msgid.link/20250724212837119BP9HOs0ibXDRWgsXMMir7@zte.com.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_generic.c

index 16afb834fe4a95b20f4c48a65881302ec4a8a620..1e008a228ebdf846d4ef7f83d655ac1142ec3596 100644 (file)
@@ -740,6 +740,8 @@ static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
        err = skb_array_produce(q, skb);
 
        if (unlikely(err)) {
+               tcf_set_drop_reason(skb, SKB_DROP_REASON_QDISC_OVERLIMIT);
+
                if (qdisc_is_percpu_stats(qdisc))
                        return qdisc_drop_cpu(skb, qdisc, to_free);
                else