Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2145196rwa; Mon, 22 Aug 2022 03:00:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4L7kCq0eNCITPMFmtXp4T9P1Srm63ORfqjXH1aZ5TB/RVFDAeSBEOu8Cazt4F5J12EbXsy X-Received: by 2002:a17:907:8a22:b0:73d:8a12:2d1c with SMTP id sc34-20020a1709078a2200b0073d8a122d1cmr1124551ejc.154.1661162445711; Mon, 22 Aug 2022 03:00:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661162445; cv=none; d=google.com; s=arc-20160816; b=btAk6rRGINGuE1G0oDnLwrqmDiGFpuNchh/N5S9AGRP3mq8dG3hk+pdjN/6rV5kMPl 8xK2pMUhK0K2MP/QRjTSyHJ1pXT41niwkN1y7OmGcD9ksf7TwqcgFOBrSeUYGokDQOfB o/5x8E4UhmDfkaZBEaw5O0q/IDvyGlVYYeub2jnoOKhqQ67djG1KjZdFt+Y/0sHQGEBN G0Y4WxF0enVzq2vKHw1fwIMVm9oSxrwcNmuIX+HQt8ZFXICeY6nNBZ37NQujzrAtjxlk 4jSzI3nQ1uVPmFB/Apxp9csI7QgVx7nOqrHUxn6PDWvyA5A0Ir8Ob9BObhwJpVG1i7Nf m/7A== 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=oLhRD+x39eo4QrarK+tsqoJXBmbcLJZygmNFucd2Avo=; b=rNCV+X6HLqKicocjs1Bpnt/v/RNEV4PUljiwvbXN/Yomm2yyJ7/Lu6Z7nIGpSo28/h ZmyTmi0oJvPzmPrrZSiqAvKwggP4nZptnnyt5bIzjHPwzqlh2RkEKMS3m4vaaz9QSd1X 0UFRB1UF0UaOlIW7f0qbYhM0BC3699E63xB9ffI6DgNACMQdNK1feGYu3q8LaFWkkBmK BAT3m99xjaRJo0hqtXTyw5FBzuEz04PpS6Qc4R86VKPBTeoG3swo/p8BLOayL0X0ptd2 LdYulJHShd/nMJwc2Wm7i8TTaDs9VGQC8jEkkFoK7tPqCxVhYR6IqUOQGCfCFgAdJ3f/ 4x1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=msRFpykT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a056402520700b0043dcf90c94asi10295581edd.67.2022.08.22.03.00.19; Mon, 22 Aug 2022 03:00:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=msRFpykT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234379AbiHVJOJ (ORCPT + 99 others); Mon, 22 Aug 2022 05:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234288AbiHVJNG (ORCPT ); Mon, 22 Aug 2022 05:13:06 -0400 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE04F2F012; Mon, 22 Aug 2022 02:13:05 -0700 (PDT) Received: by mail-qt1-x831.google.com with SMTP id s11so7402083qtx.6; Mon, 22 Aug 2022 02:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=oLhRD+x39eo4QrarK+tsqoJXBmbcLJZygmNFucd2Avo=; b=msRFpykTXsCe/Pxd8Y6WfbL+jEIjV+02eeFydYh17S4cRtTLXt9VY9B2mKuhDkiFKv W0jleKLm4DXs6spyttKlvblcS1D/lTPPdAFidZ4y3jLFD+S4oKfEnX/HQ5Na9IBUey6U a0kXbS8Nk/UcIHPbs+4eI9g8yyYGujNUh2EKGozQQietcyyIMO0nIqymNnMtMqhaikyM 8gqy80bE+hulmDp3Wi6gnFSj8L0pBoBhoCWtUzCHzpNhGc0sAop+dm5dX/Gwcaf69lVs N9GuJ7+UyxVdF+lDTM8GlCV9zGJSofbi6SxTSt8P3dxdUcNqVz6Z/360KnDrsoM7ms1L Ge6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=oLhRD+x39eo4QrarK+tsqoJXBmbcLJZygmNFucd2Avo=; b=nwgtli7oh5Mr25w3g4u/4Qe8HlyZ5I0CAU0isjP21Dh4TP1VqQZmCbEI1IxprEOdgs i2JfWLXXXmttTieEg6ynlG7vgmexakE6iYo69ZXgpWEuc7yRAOa5aL2uSMuWhar3CsnG ImrVtuCSz2BHHRYjD73BVnA8rCzIkr6a7doApQBKlCT0wpUsa+eI9mLt+stN5SgiaqLH Yo5iIwV8yIIViKPPhmTZU69QD1E6IgyhB+BTtNxTxdCldd+ECz2tEx2i1OxUa7L7YV9E HeknFFG5SMcIs54LYfAlM6J6FhaW244kPZvpN4i6ydfkfatK9baql+sn4zdCH3/+OzUA p88A== X-Gm-Message-State: ACgBeo2zawxIUndr9WhpKst4Gj8V8sP2zvU/nnAoFpd8WVc9X09gOAK0 PNLwm7GXSO0WCxpreCqT5Q== X-Received: by 2002:a05:622a:1214:b0:344:5ec8:d620 with SMTP id y20-20020a05622a121400b003445ec8d620mr14654563qtx.228.1661159585026; Mon, 22 Aug 2022 02:13:05 -0700 (PDT) Received: from bytedance.attlocal.net (ec2-52-52-7-82.us-west-1.compute.amazonaws.com. [52.52.7.82]) by smtp.gmail.com with ESMTPSA id bw12-20020a05622a098c00b0031eddc83560sm8626117qtb.90.2022.08.22.02.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 02:13:04 -0700 (PDT) From: Peilin Ye To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Hideaki YOSHIFUJI , David Ahern , Jamal Hadi Salim , Cong Wang , Jiri Pirko Cc: Peilin Ye , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang , Stephen Hemminger , Dave Taht , Peilin Ye Subject: [PATCH RFC v2 net-next 5/5] net/sched: sch_cbq: Use Qdisc backpressure infrastructure Date: Mon, 22 Aug 2022 02:12:57 -0700 Message-Id: <614f8f31e3b62dfebb8cb4707c81918a6c7e381d.1661158173.git.peilin.ye@bytedance.com> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 (currently supports UDP sockets). Use it in CBQ Qdisc. Tested with 500 Mbits/sec rate limit using 16 iperf UDP 1 Gbit/sec clients. Before: [ 3] 0.0-15.0 sec 55.8 MBytes 31.2 Mbits/sec 1.185 ms 1073326/1113110 (96%) [ 3] 0.0-15.0 sec 55.9 MBytes 31.3 Mbits/sec 1.001 ms 1080330/1120201 (96%) [ 3] 0.0-15.0 sec 55.6 MBytes 31.1 Mbits/sec 1.750 ms 1078292/1117980 (96%) [ 3] 0.0-15.0 sec 55.3 MBytes 30.9 Mbits/sec 0.895 ms 1089200/1128640 (97%) <...> ^^^^^^^^^^^^^^^^^^^^^ Total throughput is 493.7 Mbits/sec and average drop rate is 96.13%. Now enable Qdisc backpressure for UDP sockets, with udp_backpressure_interval default to 100 milliseconds: [ 3] 0.0-15.0 sec 54.2 MBytes 30.3 Mbits/sec 2.302 ms 54/38692 (0.14%) [ 3] 0.0-15.0 sec 54.1 MBytes 30.2 Mbits/sec 2.227 ms 54/38671 (0.14%) [ 3] 0.0-15.0 sec 53.5 MBytes 29.9 Mbits/sec 2.043 ms 57/38203 (0.15%) [ 3] 0.0-15.0 sec 58.1 MBytes 32.5 Mbits/sec 1.843 ms 1/41480 (0.0024%) <...> ^^^^^^^^^^^^^^^^^ Total throughput is 497.1 Mbits/sec (0.69% higher), average drop rate is 0.08% (99.9% lower). Fairness between flows is slightly affected, with per-flow average throughput ranging from 29.9 to 32.6 Mbits/sec (compared with 30.3 to 31.3 Mbits/sec). Signed-off-by: Peilin Ye --- net/sched/sch_cbq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 91a0dc463c48..42e44f570988 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c @@ -381,6 +381,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch, return ret; } + qdisc_backpressure(skb); if (net_xmit_drop_count(ret)) { qdisc_qstats_drop(sch); cbq_mark_toplevel(q, cl); -- 2.20.1