lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 25 Aug 2022 18:27:45 +0800
From:   Zhengchao Shao <shaozhengchao@...wei.com>
To:     <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
        <pabeni@...hat.com>, <jhs@...atatu.com>,
        <xiyou.wangcong@...il.com>, <jiri@...nulli.us>
CC:     <weiyongjun1@...wei.com>, <yuehaibing@...wei.com>,
        <shaozhengchao@...wei.com>
Subject: [PATCH -next] net: sched: sch_skbprio: add support for qlen statistics of each priority in sch_skbprio

The skbprio_dump_class_stats() gets the qlen of queues with the cl - 1
priority, but the qlen of each priority is not used in enqueue or dequeue
process.

Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
---
 net/sched/sch_skbprio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/sched/sch_skbprio.c b/net/sched/sch_skbprio.c
index 7a5e4c454715..fe2bb7bf9d2a 100644
--- a/net/sched/sch_skbprio.c
+++ b/net/sched/sch_skbprio.c
@@ -83,6 +83,7 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 		__skb_queue_tail(qdisc, skb);
 		qdisc_qstats_backlog_inc(sch, skb);
 		q->qstats[prio].backlog += qdisc_pkt_len(skb);
+		q->qstats[prio].qlen++;
 
 		/* Check to update highest and lowest priorities. */
 		if (prio > q->highest_prio)
@@ -106,6 +107,7 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 	__skb_queue_tail(qdisc, skb);
 	qdisc_qstats_backlog_inc(sch, skb);
 	q->qstats[prio].backlog += qdisc_pkt_len(skb);
+	q->qstats[prio].qlen++;
 
 	/* Drop the packet at the tail of the lowest priority qdisc. */
 	lp_qdisc = &q->qdiscs[lp];
@@ -115,6 +117,7 @@ static int skbprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
 	qdisc_drop(to_drop, sch, to_free);
 
 	q->qstats[lp].backlog -= qdisc_pkt_len(to_drop);
+	q->qstats[lp].qlen--;
 	q->qstats[lp].drops++;
 	q->qstats[lp].overlimits++;
 
@@ -150,6 +153,7 @@ static struct sk_buff *skbprio_dequeue(struct Qdisc *sch)
 	qdisc_bstats_update(sch, skb);
 
 	q->qstats[q->highest_prio].backlog -= qdisc_pkt_len(skb);
+	q->qstats[q->highest_prio].qlen--;
 
 	/* Update highest priority field. */
 	if (skb_queue_empty(hpq)) {
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ