From nobody Tue Apr 7 19:50:35 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 055E6C04AA5 for ; Thu, 25 Aug 2022 03:27:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232738AbiHYD1O (ORCPT ); Wed, 24 Aug 2022 23:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbiHYD1I (ORCPT ); Wed, 24 Aug 2022 23:27:08 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEA0F5F993; Wed, 24 Aug 2022 20:27:06 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MCpGF31QrzlWR7; Thu, 25 Aug 2022 11:23:49 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 25 Aug 2022 11:27:04 +0800 From: Zhengchao Shao To: , , , , , , , , CC: , , Subject: [PATCH net-next 1/3] net: sched: sch_choke: add statistics when calling qdisc_drop() in sch_choke Date: Thu, 25 Aug 2022 11:29:41 +0800 Message-ID: <20220825032943.34778-2-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220825032943.34778-1-shaozhengchao@huawei.com> References: <20220825032943.34778-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now, the "other" member in the choke_sched_data structure is not used. According to the description, "other" should be added when calling qdisc_drop() to discard packets. Signed-off-by: Zhengchao Shao --- net/sched/sch_choke.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c index 2adbd945bf15..19c25ec36d0d 100644 --- a/net/sched/sch_choke.c +++ b/net/sched/sch_choke.c @@ -60,7 +60,7 @@ struct choke_sched_data { u32 forced_drop; /* Forced drops, qavg > max_thresh */ u32 forced_mark; /* Forced marks, qavg > max_thresh */ u32 pdrop; /* Drops due to queue limits */ - u32 other; /* Drops due to drop() calls */ + u32 other; /* Drops due to qdisc_drop() calls */ u32 matched; /* Drops to flow match */ } stats; =20 @@ -127,6 +127,7 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsign= ed int idx, qdisc_qstats_backlog_dec(sch, skb); qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb)); qdisc_drop(skb, sch, to_free); + q->stats.other++; --sch->q.qlen; } =20 @@ -274,9 +275,11 @@ static int choke_enqueue(struct sk_buff *skb, struct Q= disc *sch, } =20 q->stats.pdrop++; + q->stats.other++; return qdisc_drop(skb, sch, to_free); =20 congestion_drop: + q->stats.other++; qdisc_drop(skb, sch, to_free); return NET_XMIT_CN; } --=20 2.17.1 From nobody Tue Apr 7 19:50:35 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD37BC04AA5 for ; Thu, 25 Aug 2022 03:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232952AbiHYD1a (ORCPT ); Wed, 24 Aug 2022 23:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232525AbiHYD1I (ORCPT ); Wed, 24 Aug 2022 23:27:08 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEAD05F997; Wed, 24 Aug 2022 20:27:06 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MCpGG0ZvwzlWCq; Thu, 25 Aug 2022 11:23:50 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 25 Aug 2022 11:27:04 +0800 From: Zhengchao Shao To: , , , , , , , , CC: , , Subject: [PATCH net-next 2/3] net: sched: sch_gred: add statistics when calling qdisc_drop() in sch_gred Date: Thu, 25 Aug 2022 11:29:42 +0800 Message-ID: <20220825032943.34778-3-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220825032943.34778-1-shaozhengchao@huawei.com> References: <20220825032943.34778-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now, the "other" member in the gred_sched_data structure is not used. According to the description, "other" should be added when calling qdisc_drop() to discard packets. Signed-off-by: Zhengchao Shao --- include/net/red.h | 2 +- net/sched/sch_gred.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/red.h b/include/net/red.h index 30c6a23ab8cc..dad41eff8c62 100644 --- a/include/net/red.h +++ b/include/net/red.h @@ -122,7 +122,7 @@ struct red_stats { u32 forced_drop; /* Forced drops, qavg > max_thresh */ u32 forced_mark; /* Forced marks, qavg > max_thresh */ u32 pdrop; /* Drops due to queue limits */ - u32 other; /* Drops due to drop() calls */ + u32 other; /* Drops due to qdisc_drop() calls */ }; =20 struct red_parms { diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 1073c76d05c4..c50a0853dcb9 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -251,9 +251,11 @@ static int gred_enqueue(struct sk_buff *skb, struct Qd= isc *sch, =20 q->stats.pdrop++; drop: + q->stats.other++; return qdisc_drop(skb, sch, to_free); =20 congestion_drop: + q->stats.other++; qdisc_drop(skb, sch, to_free); return NET_XMIT_CN; } --=20 2.17.1 From nobody Tue Apr 7 19:50:35 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5930EC04AA5 for ; Thu, 25 Aug 2022 03:27:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232910AbiHYD1Z (ORCPT ); Wed, 24 Aug 2022 23:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbiHYD1J (ORCPT ); Wed, 24 Aug 2022 23:27:09 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44C875FAC3; Wed, 24 Aug 2022 20:27:07 -0700 (PDT) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MCpFy5RffzkWKT; Thu, 25 Aug 2022 11:23:34 +0800 (CST) Received: from huawei.com (10.175.101.6) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 25 Aug 2022 11:27:05 +0800 From: Zhengchao Shao To: , , , , , , , , CC: , , Subject: [PATCH net-next 3/3] net: sched: sch_red: add statistics when calling qdisc_drop() in sch_red Date: Thu, 25 Aug 2022 11:29:43 +0800 Message-ID: <20220825032943.34778-4-shaozhengchao@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220825032943.34778-1-shaozhengchao@huawei.com> References: <20220825032943.34778-1-shaozhengchao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500026.china.huawei.com (7.185.36.106) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now, the "other" member in the red_sched_data structure is not used. According to the description, "other" should be added when calling qdisc_drop() to discard packets. Signed-off-by: Zhengchao Shao --- net/sched/sch_red.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 40adf1f07a82..cdf9d8611e41 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c @@ -141,6 +141,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdis= c *sch, if (!skb) return NET_XMIT_CN | ret; =20 + q->stats.other++; qdisc_drop(skb, sch, to_free); return NET_XMIT_CN; } --=20 2.17.1