Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4716762iob; Sun, 8 May 2022 23:04:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWTsffhWbIptDWS1ej/ez66P1axrsSov5nbYUzlSTAHFF0mUjox+oKmaXWzW1w/i3+Sj0J X-Received: by 2002:a17:90b:1d10:b0:1dc:dea8:d2ad with SMTP id on16-20020a17090b1d1000b001dcdea8d2admr15075328pjb.174.1652076294102; Sun, 08 May 2022 23:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652076294; cv=none; d=google.com; s=arc-20160816; b=TiHpIvldEMb1PGi0l5Q+MANaJqvRLUJxEpR8VbgYGDtV8Plc0cLMud9wxk9YeRn99F k95w/hQqoGNFaQSZww1MQkqD5ICj65SYenECsu6mTtyZWxxeeta/QZFJzrnxEbGEMnw1 LfXN9DGEFS8Di+uHnXF9pL7gBk95bmzTtzSiPeyOADBb4WNiXzqjNy4ypTwLVjDL7QWK CGsW+JCcLiLRdR+lNr4Evr2S9s11pIETWXYeW3fp08KLCjYJJn5kpABgREXhE8kmO7f6 lWCCUSSXWZufhKzxGgpM16YT/cxuxDT+u+bN7fTVyBo8t9diEX0M/wcUGj3uGAOKMLHY j+3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=REYumsm6kh6dG5JfkpmEJOF6iBFTzLNrYeIRsQ91Yy4=; b=NwgHHRAIvFnfbTXCQfZ1ipeJV63h+2iqu/xf7r6kvUdh55yixuEAVJhe00JJuURxOz Ivv8PshYxQyZcb9Lma7bZXj8/HzCZLUuHOoBDD0/7wMcWj3TfpAmx0ZV+ZgzVwrD4AGM zpjaoMTc7aqmVOIlQE1Jsz8RmdDbxtjKca/3XGrZw+FBtE3HDirXnvnyXZRAstjWOU8D 4P4lpRL2zKA1SrKZhWeAkcJzt2KLc+xnHMSurpr5f3EXRdzne3z3l/nJneA07bk08NBr a8JdllAUZwHf4yVv70m5B/XnXsQFfB+5kP2d3BKCZ5gnbuGwZAHurBEm0wOkzJA8S+Kx CBQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VgAPfjB6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p18-20020a170902e75200b0015ecc946750si10724423plf.409.2022.05.08.23.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:04:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VgAPfjB6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5B1C8170653; Sun, 8 May 2022 23:04:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391572AbiEFTtr (ORCPT + 99 others); Fri, 6 May 2022 15:49:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391394AbiEFTtp (ORCPT ); Fri, 6 May 2022 15:49:45 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 553203668F; Fri, 6 May 2022 12:46:01 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id dv4so6111787qvb.13; Fri, 06 May 2022 12:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=REYumsm6kh6dG5JfkpmEJOF6iBFTzLNrYeIRsQ91Yy4=; b=VgAPfjB60nZTL9ZLu1vVz05PN2jFWEmo7BOcQM53pAaGA0tQ83p8FQCMyfMkWCUljO xrUUTVpW545iQaNOP3al4ieey6zhWj2eAeHuWQ2a7+Oe6FuuJbb4bJOvxMWgh3Qk4NmJ Wd7/6LkMCZy7RhIfUGloBVSwbRHaFkIfbkHxfCwJsHyzqaq35+SJZnVWO70KIwVhycPJ XIqvFfFfqOF8Ah2OHjTQ7nwjiYjyxgJ5OSZI+MrmKSFRl2iW4wich8ZSUpf00XWCkFxG S1F7rRgyv7T19H7c6HjBR66HLe1ZrTif7h6o1COmDeSFxKlM8AyLQSxwpijpAH+0W8hM vidQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=REYumsm6kh6dG5JfkpmEJOF6iBFTzLNrYeIRsQ91Yy4=; b=8AXbXr4j8WzxBdo/AWHMG3EPfBQITurOPqO5/M7h2dvnsSNXUMb7/buBy8MYer56ti icHa7fudZXQw4Pu1AEMZmCXH5NpT7FlHSSX7tKZD+P9PamK8+6va0fQtbR1aedMX4aBV e6eLUrLDaZdFSEygr4Q3N45KN0qFol7+0bkZCC/PoRjEpO+upXx9vsAD1wd0CsiXGH9V 211pD6NCLGlAn9eXmnqan7UaDe7EiEShaEyu0MrnYhxT1TVyupjOS7TRapJdjkFzSwDM RSpriHlXuGQ8X7yf5x4Uh4jFY0l3cdYK4c/z9onFXcrAmpX1fwnkrcybQ3EsrgH4e3ef P9Ow== X-Gm-Message-State: AOAM531je1EghQGNcld0eONcd7dTvmmQaffO3ec365c24HyMHhdmsXBh Tdzp3yjB133R5OgD00o1r/Lo5PYVHJVM X-Received: by 2002:ad4:5749:0:b0:459:1c08:f80a with SMTP id q9-20020ad45749000000b004591c08f80amr3892776qvx.56.1651866360484; Fri, 06 May 2022 12:46:00 -0700 (PDT) Received: from bytedance.attlocal.net (ec2-52-72-174-210.compute-1.amazonaws.com. [52.72.174.210]) by smtp.gmail.com with ESMTPSA id c14-20020ac8518e000000b002f39b99f694sm3028513qtn.46.2022.05.06.12.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 12:46:00 -0700 (PDT) From: Peilin Ye To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hideaki YOSHIFUJI , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko Cc: Peilin Ye , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang , Peilin Ye Subject: [PATCH RFC v1 net-next 4/4] net/sched: sch_cbq: Use Qdisc backpressure infrastructure Date: Fri, 6 May 2022 12:45:46 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye Recently we introduced a Qdisc backpressure infrastructure for TCP and UDP sockets. Use it in CBQ. Suggested-by: Cong Wang Signed-off-by: Peilin Ye --- net/sched/sch_cbq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.20.1