Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4780274iob; Mon, 9 May 2022 01:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH3UWO4AAvo/0R1z3jUuuI37vjVAA2fxDXFv0jdFWee+Mm1ldtuLHQwAXisXxoD5L/U3Vk X-Received: by 2002:a63:5b49:0:b0:39d:261c:b416 with SMTP id l9-20020a635b49000000b0039d261cb416mr12326963pgm.61.1652083782721; Mon, 09 May 2022 01:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652083782; cv=none; d=google.com; s=arc-20160816; b=O4954w3YSRF0DZwplSLd7vWd8AtzYC2e1aqusetPCE7BfjcdQPEcVtS+eozJWzROZx 6eHo9vfHIODCCVE0org8HZY8rTxPRGpLQ80Fh+4dh91qWht+hIljDIkDFirDCJlZU+co AbqqWDNXS41dJPUsd4gw3hZ1VCSmBdr9rcw3JchltLhPyTqE8JVSAXB7y6MXPaLYWRFX qfms5oCCa730bEikwNxPLeZpL8Qv4fy4KMiwbKaxvWX6/EO3R2OhvGtQj3JnnKoUg8L7 zloXqInMAb6VVSTloNc+6X1eNh2IkQlbutMgILfXtz2cQn9gQ/l4bzL2jO49NDGTGdDh EbnA== 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=26UBhVESvjEt8vd9ljEpnrYxuM75PmMbuVfnsO+5kk8=; b=XavW2w5KvdYD72YWa1A2x8DAI58pIPwoSSnnHV3qvBrCLpK3N2rYeZ6EyuUBZoKjR/ KWXeVh7FWGk39MHUGXYl8OmiNx9qNpr/kFbj3/au1VP5Qp30Kmlo6pK2n3n2KHoAPopn ZeMp5X54iDE1F5e2atSzt111bXAGffHMlI43VACSPFCI0CYxcUpb7mjMnOLpJnmKiPSf yObFlPqyiHswfbxSZfUDxVUUP7PSHB5foDcOQkVcObNlcL24aegNY3trItqP1ksbTc1I tqmamVos6oBaYLsGOj9jfiVB2lKSefNST6dHAVyoOgZXHJ7aKFFsHWxbBZympwYReiOw vpmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OideI0Ka; 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 t12-20020a170902e84c00b00153b2d1657fsi11714036plg.391.2022.05.09.01.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:09:42 -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=OideI0Ka; 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 7BF2E14282F; Mon, 9 May 2022 01:00:17 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391369AbiEFTtZ (ORCPT + 99 others); Fri, 6 May 2022 15:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391394AbiEFTtW (ORCPT ); Fri, 6 May 2022 15:49:22 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06D971A061; Fri, 6 May 2022 12:45:38 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id eq14so6136177qvb.4; Fri, 06 May 2022 12:45:37 -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=26UBhVESvjEt8vd9ljEpnrYxuM75PmMbuVfnsO+5kk8=; b=OideI0KaQlA/EguUnJr9tHJ2iTCxXXeRQbsI0HYlcM5BWN3ICtro3OItNuTLO68gC5 /RNF9st81UpXgFXfKYZXUH+GcRs0TdlqUi2DjKVHPlkV25fFYKIYJEh4uRqBSE+LTxqT NhWFc6gAAlMuXDViZJcXxDuIwldYAZvia8CGYwj+CzoLweSwvmHhvbgfl1BViP7vcV3F l9AXA0fn02tY5AfKDo8mdqFGoAa+99t4TCRlLPzyEOiyJuuvznATLSYFAVQtMnA41a9J Ewfh2wnVnHKwtqAhnRb5Z5YYfITvogxZO4+EAw+Hk7PTci6nX3Z7zHo/rOMRYra00dZl OxfA== 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=26UBhVESvjEt8vd9ljEpnrYxuM75PmMbuVfnsO+5kk8=; b=u7M2lJbqpjJ7Pj04TyfTuqlQml1YQ6LATBknpmaKbGvR4FxENbOm+P7A+ddKWo3utj HHt2bFJrx5sgR2QBG0I5ihB2usecDtB5fWpYHmrRrSI2Fhgi5vBkH4PofX0rVK3/+puc P6dMriqWFsy2Lnh2v2PTSLveQYjLBrwDrFWVmTLljnNp22SCKVsjjJmGnLCDT137L3Zx 367ZhdUQ1Ix9R4jmqqmBQfr7I1LyCcjTSvoXZewK9xwqiEX0TE8Xt9J6uHNd3fub0yn9 jqDzO/qz0dMrQU+puflg0qw3b3nl5DCvVI+CV4EZ4utEbqo6piCw32dk/CCeKi6/OiD3 xTmQ== X-Gm-Message-State: AOAM532jDPjW0UlKaXrCDNTFLlIKXolE9LmB2KM6qGujsCTBTU3crUPo K3AgnBKAjar8SdpVdR/KcweGxKQttLtx X-Received: by 2002:ad4:5c6e:0:b0:45a:aefd:f551 with SMTP id i14-20020ad45c6e000000b0045aaefdf551mr3930759qvh.95.1651866337093; Fri, 06 May 2022 12:45:37 -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 x68-20020a376347000000b0069fc13ce1e2sm2914541qkb.19.2022.05.06.12.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 12:45:36 -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 3/4] net/sched: sch_htb: Use Qdisc backpressure infrastructure Date: Fri, 6 May 2022 12:45:24 -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 HTB. Suggested-by: Cong Wang Signed-off-by: Peilin Ye --- net/sched/sch_htb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 23a9d6242429..21d78dff08e7 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -623,6 +623,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch, __qdisc_enqueue_tail(skb, &q->direct_queue); q->direct_pkts++; } else { + qdisc_backpressure_overlimit(sch, skb); return qdisc_drop(skb, sch, to_free); } #ifdef CONFIG_NET_CLS_ACT @@ -634,6 +635,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch, #endif } else if ((ret = qdisc_enqueue(skb, cl->leaf.q, to_free)) != NET_XMIT_SUCCESS) { + qdisc_backpressure_overlimit(sch, skb); if (net_xmit_drop_count(ret)) { qdisc_qstats_drop(sch); cl->drops++; @@ -978,6 +980,9 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch) goto ok; } } + + qdisc_backpressure_throttle(sch); + if (likely(next_event > q->now)) qdisc_watchdog_schedule_ns(&q->watchdog, next_event); else -- 2.20.1