From: Jesper Dangaard Brouer <hawk@kernel.org>
To: netdev@vger.kernel.org, "Eric Dumazet" <eric.dumazet@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Paolo Abeni" <pabeni@redhat.com>,
"Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Jesper Dangaard Brouer <hawk@kernel.org>,
bpf@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
horms@kernel.org, jiri@resnulli.us, edumazet@google.com,
xiyou.wangcong@gmail.com, jhs@mojatatu.com, atenart@redhat.com,
carges@cloudflare.com, kernel-team@cloudflare.com
Subject: [PATCH net-next v2 6/6] net: sched: sch_dualpi2: use qdisc_dequeue_drop() for dequeue drops
Date: Thu, 05 Feb 2026 22:22:03 +0100 [thread overview]
Message-ID: <177032652354.1975497.2269771162710918590.stgit@firesoul> (raw)
In-Reply-To: <177032644012.1975497.16411100029657607833.stgit@firesoul>
DualPI2 drops packets during dequeue but was using kfree_skb_reason()
directly, bypassing trace_qdisc_drop. Convert to qdisc_dequeue_drop()
and move DUALPI2_STEP_DROP to the qdisc drop reason enum.
- Set TCQ_F_DEQUEUE_DROPS flag in dualpi2_init()
- Use enum qdisc_drop_reason in drop_and_retry()
- Replace kfree_skb_reason() with qdisc_dequeue_drop()
Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
---
include/net/dropreason-core.h | 6 ------
net/sched/sch_dualpi2.c | 9 +++++----
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/include/net/dropreason-core.h b/include/net/dropreason-core.h
index 3d8d284e05c8..5c8c2eb3d2c5 100644
--- a/include/net/dropreason-core.h
+++ b/include/net/dropreason-core.h
@@ -121,7 +121,6 @@
FN(CANFD_RX_INVALID_FRAME) \
FN(CANXL_RX_INVALID_FRAME) \
FN(PFMEMALLOC) \
- FN(DUALPI2_STEP_DROP) \
FN(PSP_INPUT) \
FN(PSP_OUTPUT) \
FNe(MAX)
@@ -579,11 +578,6 @@ enum skb_drop_reason {
* reached a path or socket not eligible for use of memory reserves
*/
SKB_DROP_REASON_PFMEMALLOC,
- /**
- * @SKB_DROP_REASON_DUALPI2_STEP_DROP: dropped by the step drop
- * threshold of DualPI2 qdisc.
- */
- SKB_DROP_REASON_DUALPI2_STEP_DROP,
/** @SKB_DROP_REASON_PSP_INPUT: PSP input checks failed */
SKB_DROP_REASON_PSP_INPUT,
/** @SKB_DROP_REASON_PSP_OUTPUT: PSP output checks failed */
diff --git a/net/sched/sch_dualpi2.c b/net/sched/sch_dualpi2.c
index 0b6a38704a3b..d7a59eefd070 100644
--- a/net/sched/sch_dualpi2.c
+++ b/net/sched/sch_dualpi2.c
@@ -571,11 +571,11 @@ static int do_step_aqm(struct dualpi2_sched_data *q, struct sk_buff *skb,
}
static void drop_and_retry(struct dualpi2_sched_data *q, struct sk_buff *skb,
- struct Qdisc *sch, enum skb_drop_reason reason)
+ struct Qdisc *sch, enum qdisc_drop_reason reason)
{
++q->deferred_drops_cnt;
q->deferred_drops_len += qdisc_pkt_len(skb);
- kfree_skb_reason(skb, reason);
+ qdisc_dequeue_drop(sch, skb, reason);
qdisc_qstats_drop(sch);
}
@@ -597,8 +597,7 @@ static struct sk_buff *dualpi2_qdisc_dequeue(struct Qdisc *sch)
if (skb_in_l_queue(skb) && do_step_aqm(q, skb, now)) {
qdisc_qstats_drop(q->l_queue);
- drop_and_retry(q, skb, sch,
- SKB_DROP_REASON_DUALPI2_STEP_DROP);
+ drop_and_retry(q, skb, sch, QDISC_DROP_STEP_DROP);
continue;
}
@@ -915,6 +914,8 @@ static int dualpi2_init(struct Qdisc *sch, struct nlattr *opt,
struct dualpi2_sched_data *q = qdisc_priv(sch);
int err;
+ sch->flags |= TCQ_F_DEQUEUE_DROPS;
+
q->l_queue = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
TC_H_MAKE(sch->handle, 1), extack);
if (!q->l_queue)
next prev parent reply other threads:[~2026-02-05 21:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-05 21:21 [PATCH net-next v2 0/6] net: sched: refactor qdisc drop reasons into dedicated tracepoint Jesper Dangaard Brouer
2026-02-05 21:21 ` [PATCH net-next v2 1/6] net: sched: introduce qdisc-specific drop reason tracing Jesper Dangaard Brouer
2026-02-06 9:31 ` Toke Høiland-Jørgensen
2026-02-06 14:14 ` Jesper Dangaard Brouer
2026-02-06 16:31 ` Toke Høiland-Jørgensen
2026-02-09 13:45 ` Jesper Dangaard Brouer
2026-02-05 21:21 ` [PATCH net-next v2 2/6] net: sched: sfq: convert to qdisc drop reasons Jesper Dangaard Brouer
2026-02-05 21:21 ` [PATCH net-next v2 3/6] net: sched: sch_cake: use enum qdisc_drop_reason for cobalt_should_drop Jesper Dangaard Brouer
2026-02-05 21:21 ` [PATCH net-next v2 4/6] net: sched: rename QDISC_DROP_CAKE_FLOOD to QDISC_DROP_FLOOD_PROTECTION Jesper Dangaard Brouer
2026-02-05 21:21 ` [PATCH net-next v2 5/6] net: sched: rename QDISC_DROP_FQ_* to generic names Jesper Dangaard Brouer
2026-02-05 21:22 ` Jesper Dangaard Brouer [this message]
2026-02-06 4:09 ` [PATCH net-next v2 6/6] net: sched: sch_dualpi2: use qdisc_dequeue_drop() for dequeue drops kernel test robot
2026-02-06 4:50 ` kernel test robot
2026-02-06 8:32 ` [syzbot ci] Re: net: sched: refactor qdisc drop reasons into dedicated tracepoint syzbot ci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=177032652354.1975497.2269771162710918590.stgit@firesoul \
--to=hawk@kernel.org \
--cc=atenart@redhat.com \
--cc=bpf@vger.kernel.org \
--cc=carges@cloudflare.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel-team@cloudflare.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=toke@toke.dk \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox