Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4732276iob; Sun, 8 May 2022 23:36:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx15d9Iqs+IMX4BtsgFoLasPVLWQdWuRMXN1O6H49CW7g5fPFKqueZkPe6uQ1Jn1mzV5E2v X-Received: by 2002:a05:6a00:234b:b0:510:4161:781a with SMTP id j11-20020a056a00234b00b005104161781amr14662398pfj.5.1652078173008; Sun, 08 May 2022 23:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652078173; cv=none; d=google.com; s=arc-20160816; b=InrFgjrzf/B/qRGH/IFb7NutZf2vEB3xgJXCshVXy09L+GJ8gdoxNdkFdO2w5o9/O0 s6DUKZTj3aRBZN9LB+HnF7qBTOY3UCoysN+Y/RwdV4fusEhQqCb7/pVESXLA2mo6Rwi8 JIxjKY0T1GAjajwPNfuqeqNct6+FT/qrqDEeACYviYBv6BgjXlq+bn390WcydFfyiJU7 49MoO/4HtO70IOeahMMk80IxHb5mYRfSsLNBYDRvRTC1+iMBBFOlPkKUGrTI/ueUzqsF /EW7LWk/WaiRXTNm50nt/Hk/Sw13J6c2AHXumGBxbiJotv3q6ZwsoS5Dg9dq+aBtxf7M Y3oA== 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=1YXdjAkPRz7R0GDRHx5qp1cZI2CVvENVv7OuXkzP9JQ=; b=xRvFD/u6cTjGy+NXjlFQdBQi0bcFopnODPwM1bYuxvGin910cJGIAipMPHQu8Xe6io cxFhEPU3Zs8lEF+JlOHfwq3gDQTmHIPNvfJVBOeVkSuY9YWTTKCqbey6V1zX5HyVfj50 HTkDHqCVrG6TxStx4KaturTGgQ1ew1fmP5EyaLowlyrcayNYWDLljWxKkkhGsB1FD751 7P4FItabOXOWg+jGE6l5hdMt6zMSWFnpYAGS7f7wIVnTyymZnHWYZMEpvehefLZXhxq4 g8tnYyfZWhKew1g5m/bJ30MBZ4dIPjr+YbpLBqZtnBrir3fI/JdJItqbF4ZPMw7q25vm r3Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JZw3DRAf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e10-20020a170903240a00b0015898563942si10364799plo.445.2022.05.08.23.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JZw3DRAf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 E5166110316; Sun, 8 May 2022 23:31:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391555AbiEFTs6 (ORCPT + 99 others); Fri, 6 May 2022 15:48:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1388813AbiEFTs4 (ORCPT ); Fri, 6 May 2022 15:48:56 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECC0C6A009; Fri, 6 May 2022 12:45:12 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id 126so6641549qkm.4; Fri, 06 May 2022 12:45:12 -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=1YXdjAkPRz7R0GDRHx5qp1cZI2CVvENVv7OuXkzP9JQ=; b=JZw3DRAfFlP/GScz37EOfnmFGWu5HnV1hE15YSpgW/LbCC7v0Ovq0hX05JUbA4Bja0 d38/4A8DaHqlecmfbOgfAqadmdQd18SldlKPQyOK6pjemx6H9puQCYZSlSYrAalDIY8i /4jbOjzEKgbneWdSWNyBxHbCqofQqRGNcEWni2zSmJcpt2PWIOYR0rqWRWbu0vsg+LNX uH+za1HU3H5iHViSzT5CR3sjxkcmriZnJ9phv0wtNiTwHNRnfvnhuWoHBNomJ89rYYmV ar5XB7gmgXuXgmIakq+VNv4NccUjSidxBRr/HHkRH8YVIL/NoihVmYqfwffYG0w9saTb tacQ== 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=1YXdjAkPRz7R0GDRHx5qp1cZI2CVvENVv7OuXkzP9JQ=; b=CBwzp5vaWVvQDitpYo5LIzZ3a67PMCfD+gWtOUWRorRIwqPZex80tLBnK3URHkFkeA A9O9OquVhM1qIR4XbryKeQjSfJDM5RMKtg6nbEKtyI9IyStMroSctcD4h/rNSea8QM8F njzdJNDj4OgrqICfleTk7RjVl5L/64sDNBqjK0koHFECjQ9LnNTc2gdkjmOzXcgXrHw4 5zSVbKZAQPNLD0noC4oaq5E8pvWXcW7cw0oDxaGAORplcMUdfrKZMFJdDdL9HdUdq5ke ss/dw6KofVgf86GKHunIgbWFL+ggiTQM4Ba/gGymoM0+yx+zczmfZN73J42x/FE16oF7 6J5A== X-Gm-Message-State: AOAM530CthOYsR0zLkb0mFruRcqJ7VZ2v1REUQBzdqkgJktrHQelEoLS NUXfdbvhhWhRClPKyCM11Q== X-Received: by 2002:a05:620a:44c6:b0:6a0:51fb:49cf with SMTP id y6-20020a05620a44c600b006a051fb49cfmr453864qkp.537.1651866312103; Fri, 06 May 2022 12:45:12 -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 t196-20020a37aacd000000b0069fc13ce1d7sm2889949qke.8.2022.05.06.12.45.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 12:45:11 -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 2/4] net/sched: sch_tbf: Use Qdisc backpressure infrastructure Date: Fri, 6 May 2022 12:44:59 -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 TBF. Suggested-by: Cong Wang Signed-off-by: Peilin Ye --- net/sched/sch_tbf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 72102277449e..06229765290b 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c @@ -250,6 +250,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc *sch, } ret = qdisc_enqueue(skb, q->qdisc, to_free); if (ret != NET_XMIT_SUCCESS) { + qdisc_backpressure_overlimit(sch, skb); if (net_xmit_drop_count(ret)) qdisc_qstats_drop(sch); return ret; @@ -306,6 +307,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc *sch) return skb; } + qdisc_backpressure_throttle(sch); qdisc_watchdog_schedule_ns(&q->watchdog, now + max_t(long, -toks, -ptoks)); -- 2.20.1