diff mbox series

[RFC,v1,net-next,4/4] net/sched: sch_cbq: Use Qdisc backpressure infrastructure

Message ID e9c482dd77e7788f5ec97e1c8c3ef9571741167e.1651800598.git.peilin.ye@bytedance.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series net: Qdisc backpressure infrastructure | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: edumazet@google.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Peilin Ye May 6, 2022, 7:45 p.m. UTC
From: Peilin Ye <peilin.ye@bytedance.com>

Recently we introduced a Qdisc backpressure infrastructure for TCP and
UDP sockets.  Use it in CBQ.

Suggested-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
---
 net/sched/sch_cbq.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 02d9f0dfe356..4a5204da49d0 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -382,6 +382,7 @@  cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 		return ret;
 	}
 
+	qdisc_backpressure_overlimit(sch, skb);
 	if (net_xmit_drop_count(ret)) {
 		qdisc_qstats_drop(sch);
 		cbq_mark_toplevel(q, cl);
@@ -509,6 +510,7 @@  static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
 
 		time = 0;
 		time = ktime_add_ns(time, PSCHED_TICKS2NS(now + delay));
+		qdisc_backpressure_throttle(sch);
 		hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS_PINNED);
 	}
 
@@ -851,9 +853,11 @@  cbq_dequeue(struct Qdisc *sch)
 
 	if (sch->q.qlen) {
 		qdisc_qstats_overlimit(sch);
-		if (q->wd_expires)
+		if (q->wd_expires) {
+			qdisc_backpressure_throttle(sch);
 			qdisc_watchdog_schedule(&q->watchdog,
 						now + q->wd_expires);
+		}
 	}
 	return NULL;
 }