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 v5 3/5] net: sched: rename QDISC_DROP_FQ_* to generic names
Date: Thu, 26 Feb 2026 14:44:29 +0100 [thread overview]
Message-ID: <177211346902.3011628.12523261489552097455.stgit@firesoul> (raw)
In-Reply-To: <177211325634.3011628.9343837509740374154.stgit@firesoul>
Rename FQ-specific drop reasons to generic names:
- QDISC_DROP_FQ_BAND_LIMIT -> QDISC_DROP_BAND_LIMIT
- QDISC_DROP_FQ_HORIZON_LIMIT -> QDISC_DROP_HORIZON_LIMIT
This follows the principle that drop reasons should describe the drop
mechanism rather than being tied to a specific qdisc implementation.
These concepts (priority band limits, timestamp horizon) could apply
to other qdiscs as well.
Remove the local macro define FQDR() and instead use the
full QDISC_DROP_* name to make it easier to navigate code.
Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
---
include/net/dropreason-qdisc.h | 19 ++++++++++---------
net/sched/sch_fq.c | 7 ++-----
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/include/net/dropreason-qdisc.h b/include/net/dropreason-qdisc.h
index 02a9f580411b..a167302e79e5 100644
--- a/include/net/dropreason-qdisc.h
+++ b/include/net/dropreason-qdisc.h
@@ -11,8 +11,8 @@
FN(CONGESTED) \
FN(MAXFLOWS) \
FN(CAKE_FLOOD) \
- FN(FQ_BAND_LIMIT) \
- FN(FQ_HORIZON_LIMIT) \
+ FN(BAND_LIMIT) \
+ FN(HORIZON_LIMIT) \
FN(FLOW_LIMIT) \
FNe(MAX)
@@ -74,16 +74,17 @@ enum qdisc_drop_reason {
*/
QDISC_DROP_CAKE_FLOOD,
/**
- * @QDISC_DROP_FQ_BAND_LIMIT: FQ (Fair Queue) dropped packet because
- * the priority band's packet limit was reached. Each priority band
- * in FQ has its own limit.
+ * @QDISC_DROP_BAND_LIMIT: packet dropped because the priority band's
+ * limit was reached. Used by qdiscs with priority bands that have
+ * per-band packet limits (e.g., FQ).
*/
- QDISC_DROP_FQ_BAND_LIMIT,
+ QDISC_DROP_BAND_LIMIT,
/**
- * @QDISC_DROP_FQ_HORIZON_LIMIT: FQ dropped packet because its
- * timestamp is too far in the future (beyond the configured horizon).
+ * @QDISC_DROP_HORIZON_LIMIT: packet dropped because its timestamp
+ * is too far in the future (beyond the configured horizon).
+ * Used by qdiscs with time-based scheduling (e.g., FQ).
*/
- QDISC_DROP_FQ_HORIZON_LIMIT,
+ QDISC_DROP_HORIZON_LIMIT,
/**
* @QDISC_DROP_FLOW_LIMIT: packet dropped because an individual flow
* exceeded its per-flow packet/depth limit. Used by FQ and SFQ qdiscs
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index eb5ae2b15cc0..9a550f832d78 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -539,8 +539,6 @@ static bool fq_packet_beyond_horizon(const struct sk_buff *skb,
return unlikely((s64)skb->tstamp > (s64)(now + q->horizon));
}
-#define FQDR(reason) QDISC_DROP_FQ_##reason
-
static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff **to_free)
{
@@ -552,7 +550,7 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
band = fq_prio2band(q->prio2band, skb->priority & TC_PRIO_MAX);
if (unlikely(q->band_pkt_count[band] >= sch->limit)) {
q->stat_band_drops[band]++;
- return qdisc_drop_reason(skb, sch, to_free, FQDR(BAND_LIMIT));
+ return qdisc_drop_reason(skb, sch, to_free, QDISC_DROP_BAND_LIMIT);
}
now = ktime_get_ns();
@@ -564,7 +562,7 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
if (q->horizon_drop) {
q->stat_horizon_drops++;
return qdisc_drop_reason(skb, sch, to_free,
- FQDR(HORIZON_LIMIT));
+ QDISC_DROP_HORIZON_LIMIT);
}
q->stat_horizon_caps++;
skb->tstamp = now + q->horizon;
@@ -603,7 +601,6 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
return NET_XMIT_SUCCESS;
}
-#undef FQDR
static void fq_check_throttled(struct fq_sched_data *q, u64 now)
{
next prev parent reply other threads:[~2026-02-26 13:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 13:44 [PATCH net-next v5 0/5] net: sched: refactor qdisc drop reasons into dedicated tracepoint Jesper Dangaard Brouer
2026-02-26 13:44 ` [PATCH net-next v5 1/5] net: sched: introduce qdisc-specific drop reason tracing Jesper Dangaard Brouer
2026-02-26 13:44 ` [PATCH net-next v5 2/5] net: sched: sfq: convert to qdisc drop reasons Jesper Dangaard Brouer
2026-02-26 13:44 ` Jesper Dangaard Brouer [this message]
2026-02-26 13:44 ` [PATCH net-next v5 4/5] net: sched: rename QDISC_DROP_CAKE_FLOOD to QDISC_DROP_FLOOD_PROTECTION Jesper Dangaard Brouer
2026-02-26 13:45 ` [PATCH net-next v5 5/5] net: sched: sch_dualpi2: use qdisc_dequeue_drop() for dequeue drops Jesper Dangaard Brouer
2026-03-01 0:00 ` [PATCH net-next v5 0/5] net: sched: refactor qdisc drop reasons into dedicated tracepoint patchwork-bot+netdevbpf
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=177211346902.3011628.12523261489552097455.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