Thread (17 messages) flat view 17 messages, 3 authors, 2026-02-13

Re: [PATCH net-next v3 1/6] net: sched: introduce qdisc-specific drop reason tracing

From: Paolo Abeni <pabeni@redhat.com>
Date: 2026-02-11 08:36:15
Also in: bpf

On 2/6/26 5:24 PM, Jesper Dangaard Brouer wrote:
quoted hunk ↗ jump to hunk
diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index fd56b7d88301..a2d1b292600d 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -548,7 +548,7 @@ static enum skb_drop_reason cobalt_should_drop(struct cobalt_vars *vars,
 	if (next_due && vars->dropping) {
 		/* Use ECN mark if possible, otherwise drop */
 		if (!(vars->ecn_marked = INET_ECN_set_ce(skb)))
-			reason = SKB_DROP_REASON_QDISC_CONGESTED;
+			reason = QDISC_DROP_CONGESTED;
FTR I think an explicit cast here should be better than changing the
cobalt_should_drop() return type.
quoted hunk ↗ jump to hunk
@@ -593,7 +591,7 @@ static struct sk_buff *dualpi2_qdisc_dequeue(struct Qdisc *sch)
 	while ((skb = dequeue_packet(sch, q, &credit_change, now))) {
 		if (!q->drop_early && must_drop(sch, q, skb)) {
 			drop_and_retry(q, skb, sch,
-				       SKB_DROP_REASON_QDISC_CONGESTED);
+				       QDISC_DROP_CONGESTED);
An explicit cast is needed above to avoid compiler warning (or you can
change drop_and_retry() signature).

Also a few lines below there is another drop_and_retry() calls that is
not converted.
quoted hunk ↗ jump to hunk
@@ -37,6 +37,31 @@
 const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
 EXPORT_SYMBOL(default_qdisc_ops);
 
+void tcf_kfree_skb_list(struct sk_buff *skb, struct Qdisc *q,
+			struct netdev_queue *txq, struct net_device *dev)
+{
+	while (unlikely(skb)) {
AFAICS tcf_kfree_skb_list() is invoked in the fastpath even when skb is
likely NULL. I guess it would be better to split it an inline helper and
an exported symbol:

// in sch_generic.h
static inline void
tcf_kfree_skb_list(struct sk_buff *skb, struct Qdisc *q,
		   struct netdev_queue *txq, struct net_device *dev)
{
	if (unlikely(skb))
		__tcf_kfree_skb_list(skb, q, txq, dev);
}

// in sch_generic.c
void __tcf_kfree_skb_list(struct sk_buff *skb, struct Qdisc *q,
		   struct netdev_queue *txq, struct net_device *dev)
{
	while (skb) {
		//...

Hopefully the above should fit the recent compiler oriented optimization
done by Eric.

/P
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help