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]
Message-ID: <20191217214554.27435-1-ldir@darbyshire-bryant.me.uk>
Date:   Tue, 17 Dec 2019 21:46:21 +0000
From:   Kevin 'ldir' Darbyshire-Bryant <ldir@...byshire-bryant.me.uk>
To:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     Kevin 'ldir' Darbyshire-Bryant <ldir@...byshire-bryant.me.uk>
Subject: [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio

Turns out tin_quantum_prio isn't used anymore and is a leftover from a
previous implementation of diffserv tins.  Since the variable isn't used
in any calculations it can be eliminated.

Drop variable and places where it was set.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@...byshire-bryant.me.uk>
---
 net/sched/sch_cake.c | 35 ++++++-----------------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
index 53a80bc6b13a..170320932d10 100644
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -173,7 +173,6 @@ struct cake_tin_data {
 	u64	tin_rate_bps;
 	u16	tin_rate_shft;
 
-	u16	tin_quantum_prio;
 	u16	tin_quantum_band;
 	s32	tin_deficit;
 	u32	tin_backlog;
@@ -2241,7 +2240,6 @@ static int cake_config_besteffort(struct Qdisc *sch)
 	cake_set_rate(b, rate, mtu,
 		      us_to_ns(q->target), us_to_ns(q->interval));
 	b->tin_quantum_band = 65535;
-	b->tin_quantum_prio = 65535;
 
 	return 0;
 }
@@ -2253,7 +2251,6 @@ static int cake_config_precedence(struct Qdisc *sch)
 	u32 mtu = psched_mtu(qdisc_dev(sch));
 	u64 rate = q->rate_bps;
 	u32 quantum1 = 256;
-	u32 quantum2 = 256;
 	u32 i;
 
 	q->tin_cnt = 8;
@@ -2266,18 +2263,14 @@ static int cake_config_precedence(struct Qdisc *sch)
 		cake_set_rate(b, rate, mtu, us_to_ns(q->target),
 			      us_to_ns(q->interval));
 
-		b->tin_quantum_prio = max_t(u16, 1U, quantum1);
-		b->tin_quantum_band = max_t(u16, 1U, quantum2);
+		b->tin_quantum_band = max_t(u16, 1U, quantum1);
 
 		/* calculate next class's parameters */
 		rate  *= 7;
 		rate >>= 3;
 
-		quantum1  *= 3;
-		quantum1 >>= 1;
-
-		quantum2  *= 7;
-		quantum2 >>= 3;
+		quantum1  *= 7;
+		quantum1 >>= 3;
 	}
 
 	return 0;
@@ -2347,7 +2340,6 @@ static int cake_config_diffserv8(struct Qdisc *sch)
 	u32 mtu = psched_mtu(qdisc_dev(sch));
 	u64 rate = q->rate_bps;
 	u32 quantum1 = 256;
-	u32 quantum2 = 256;
 	u32 i;
 
 	q->tin_cnt = 8;
@@ -2363,18 +2355,14 @@ static int cake_config_diffserv8(struct Qdisc *sch)
 		cake_set_rate(b, rate, mtu, us_to_ns(q->target),
 			      us_to_ns(q->interval));
 
-		b->tin_quantum_prio = max_t(u16, 1U, quantum1);
-		b->tin_quantum_band = max_t(u16, 1U, quantum2);
+		b->tin_quantum_band = max_t(u16, 1U, quantum1);
 
 		/* calculate next class's parameters */
 		rate  *= 7;
 		rate >>= 3;
 
-		quantum1  *= 3;
-		quantum1 >>= 1;
-
-		quantum2  *= 7;
-		quantum2 >>= 3;
+		quantum1  *= 7;
+		quantum1 >>= 3;
 	}
 
 	return 0;
@@ -2413,12 +2401,6 @@ static int cake_config_diffserv4(struct Qdisc *sch)
 	cake_set_rate(&q->tins[3], rate >> 2, mtu,
 		      us_to_ns(q->target), us_to_ns(q->interval));
 
-	/* priority weights */
-	q->tins[0].tin_quantum_prio = quantum;
-	q->tins[1].tin_quantum_prio = quantum >> 4;
-	q->tins[2].tin_quantum_prio = quantum << 2;
-	q->tins[3].tin_quantum_prio = quantum << 4;
-
 	/* bandwidth-sharing weights */
 	q->tins[0].tin_quantum_band = quantum;
 	q->tins[1].tin_quantum_band = quantum >> 4;
@@ -2454,11 +2436,6 @@ static int cake_config_diffserv3(struct Qdisc *sch)
 	cake_set_rate(&q->tins[2], rate >> 2, mtu,
 		      us_to_ns(q->target), us_to_ns(q->interval));
 
-	/* priority weights */
-	q->tins[0].tin_quantum_prio = quantum;
-	q->tins[1].tin_quantum_prio = quantum >> 4;
-	q->tins[2].tin_quantum_prio = quantum << 4;
-
 	/* bandwidth-sharing weights */
 	q->tins[0].tin_quantum_band = quantum;
 	q->tins[1].tin_quantum_band = quantum >> 4;
-- 
2.21.0 (Apple Git-122.2)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ