netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] q_cake: allow changing to diffserv3
@ 2022-01-06 11:16 Kevin Bracey
  2022-01-06 20:38 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Bracey @ 2022-01-06 11:16 UTC (permalink / raw)
  To: netdev; +Cc: toke, Kevin Bracey

A diffserv3 option (enum value 0) was never sent to the kernel, so it
was not possible to use "tc qdisc change" to select it.

This also meant that were also relying on the kernel's default being
diffserv3 when adding. If the default were to change, we wouldn't have
been able to request diffserv3 explicitly.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
---
 tc/q_cake.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tc/q_cake.c b/tc/q_cake.c
index 4cfc1c00..c438b765 100644
--- a/tc/q_cake.c
+++ b/tc/q_cake.c
@@ -95,7 +95,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 	bool overhead_override = false;
 	bool overhead_set = false;
 	unsigned int interval = 0;
-	unsigned int diffserv = 0;
+	int diffserv = -1;
 	unsigned int memlimit = 0;
 	unsigned int fwmark = 0;
 	unsigned int target = 0;
@@ -356,7 +356,7 @@ static int cake_parse_opt(struct qdisc_util *qu, int argc, char **argv,
 	if (bandwidth || unlimited)
 		addattr_l(n, 1024, TCA_CAKE_BASE_RATE64, &bandwidth,
 			  sizeof(bandwidth));
-	if (diffserv)
+	if (diffserv != -1)
 		addattr_l(n, 1024, TCA_CAKE_DIFFSERV_MODE, &diffserv,
 			  sizeof(diffserv));
 	if (atm != -1)
-- 
2.25.1


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

* Re: [PATCH iproute2] q_cake: allow changing to diffserv3
  2022-01-06 11:16 [PATCH iproute2] q_cake: allow changing to diffserv3 Kevin Bracey
@ 2022-01-06 20:38 ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2022-01-06 20:38 UTC (permalink / raw)
  To: Kevin Bracey, netdev

Kevin Bracey <kevin@bracey.fi> writes:

> A diffserv3 option (enum value 0) was never sent to the kernel, so it
> was not possible to use "tc qdisc change" to select it.
>
> This also meant that were also relying on the kernel's default being
> diffserv3 when adding. If the default were to change, we wouldn't have
> been able to request diffserv3 explicitly.
>
> Signed-off-by: Kevin Bracey <kevin@bracey.fi>

Yeah, that should probably be fixed; thanks!

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

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

end of thread, other threads:[~2022-01-06 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-06 11:16 [PATCH iproute2] q_cake: allow changing to diffserv3 Kevin Bracey
2022-01-06 20:38 ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).