All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio
@ 2019-12-17 21:46 Kevin 'ldir' Darbyshire-Bryant
  2019-12-18  9:36 ` Toke Høiland-Jørgensen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kevin 'ldir' Darbyshire-Bryant @ 2019-12-17 21:46 UTC (permalink / raw)
  To: netdev; +Cc: Kevin 'ldir' Darbyshire-Bryant

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@darbyshire-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)


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio
  2019-12-17 21:46 [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio Kevin 'ldir' Darbyshire-Bryant
@ 2019-12-18  9:36 ` Toke Høiland-Jørgensen
  2019-12-18 14:27 ` Toke Høiland-Jørgensen
  2019-12-18 14:28 ` Toke Høiland-Jørgensen
  2 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-12-18  9:36 UTC (permalink / raw)
  To: Kevin 'ldir' Darbyshire-Bryant, netdev
  Cc: Kevin 'ldir' Darbyshire-Bryant

Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> writes:

> 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@darbyshire-bryant.me.uk>

Thanks!

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio
  2019-12-17 21:46 [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio Kevin 'ldir' Darbyshire-Bryant
  2019-12-18  9:36 ` Toke Høiland-Jørgensen
@ 2019-12-18 14:27 ` Toke Høiland-Jørgensen
  2019-12-18 14:28 ` Toke Høiland-Jørgensen
  2 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-12-18 14:27 UTC (permalink / raw)
  To: Kevin 'ldir' Darbyshire-Bryant, netdev
  Cc: Kevin 'ldir' Darbyshire-Bryant

Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> writes:

> 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@darbyshire-bryant.me.uk>

Just to make sure this shows up in patchwork: Dave, please drop this
version in favour of v2...

-Toke


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio
  2019-12-17 21:46 [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio Kevin 'ldir' Darbyshire-Bryant
  2019-12-18  9:36 ` Toke Høiland-Jørgensen
  2019-12-18 14:27 ` Toke Høiland-Jørgensen
@ 2019-12-18 14:28 ` Toke Høiland-Jørgensen
  2019-12-18 14:31   ` Toke Høiland-Jørgensen
  2 siblings, 1 reply; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-12-18 14:28 UTC (permalink / raw)
  To: Kevin 'ldir' Darbyshire-Bryant, netdev
  Cc: Kevin 'ldir' Darbyshire-Bryant

Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> writes:

> 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@darbyshire-bryant.me.uk>

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio
  2019-12-18 14:28 ` Toke Høiland-Jørgensen
@ 2019-12-18 14:31   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-12-18 14:31 UTC (permalink / raw)
  To: Kevin 'ldir' Darbyshire-Bryant, netdev
  Cc: Kevin 'ldir' Darbyshire-Bryant

Toke Høiland-Jørgensen <toke@redhat.com> writes:

> Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> writes:
>
>> 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@darbyshire-bryant.me.uk>
>
> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>

And that last ACK was supposed to be for the v2... sorry for the noise :/

-Toke


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-18 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 21:46 [PATCH net-next v1] sch_cake: drop unused variable tin_quantum_prio Kevin 'ldir' Darbyshire-Bryant
2019-12-18  9:36 ` Toke Høiland-Jørgensen
2019-12-18 14:27 ` Toke Høiland-Jørgensen
2019-12-18 14:28 ` Toke Høiland-Jørgensen
2019-12-18 14:31   ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.