From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Jonathan Morton <chromatix99@gmail.com>
Cc: cake@lists.bufferbloat.net
Subject: Re: [Cake] Correct 'change' behaviour
Date: Tue, 03 Nov 2015 18:51:34 +0100 [thread overview]
Message-ID: <877flzas49.fsf@toke.dk> (raw)
In-Reply-To: <D80A799A-73D0-4BD5-8A75-8ACE287A3CC1@gmail.com> (Jonathan Morton's message of "Tue, 3 Nov 2015 19:32:10 +0200")
Jonathan Morton <chromatix99@gmail.com> writes:
>> On 3 Nov, 2015, at 19:29, Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>>
>> Well, there's some evidence to suggest that this is not in fact the case:
>
> I would consider that a tc bug.
Well, tc does seem to be doing the right thing:
if (matches(*argv, "change") == 0)
return tc_qdisc_modify(RTM_NEWQDISC, 0, argc-1, argv+1);
if (matches(*argv, "replace") == 0)
return tc_qdisc_modify(RTM_NEWQDISC, NLM_F_CREATE|NLM_F_REPLACE, argc-1, argv+1);
However, this comment in sch_api.c in the kernel seems to indicate that
they are considered equivalent by the kernel:
/* This magic test requires explanation.
*
* We know, that some child q is already
* attached to this parent and have choice:
* either to change it or to create/graft new one.
*
* 1. We are allowed to create/graft only
* if CREATE and REPLACE flags are set.
*
* 2. If EXCL is set, requestor wanted to say,
* that qdisc tcm_handle is not expected
* to exist, so that we choose create/graft too.
*
* 3. The last case is when no flags are set.
* Alas, it is sort of hole in API, we
* cannot decide what to do unambiguously.
* For now we select create/graft, if
* user gave KIND, which does not match existing.
*/
but the comment doesn't seem to match the subsequent test:
if ((n->nlmsg_flags & NLM_F_CREATE) &&
(n->nlmsg_flags & NLM_F_REPLACE) &&
((n->nlmsg_flags & NLM_F_EXCL) ||
(tca[TCA_KIND] &&
nla_strcmp(tca[TCA_KIND], q->ops->id))))
goto create_n_graft;
as best I can follow the logic in that function, it *should* actually
get recreated when those flags are set.
So why on earth are the values wrong? Memory initialisation problem?
-Toke
next prev parent reply other threads:[~2015-11-03 17:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 12:59 Toke Høiland-Jørgensen
2015-11-03 13:11 ` Kevin Darbyshire-Bryant
2015-11-03 13:14 ` Toke Høiland-Jørgensen
2015-11-03 17:24 ` Jonathan Morton
[not found] ` <87oafbat54.fsf@toke.dk>
2015-11-03 17:32 ` Jonathan Morton
2015-11-03 17:51 ` Toke Høiland-Jørgensen [this message]
2015-11-03 19:07 ` Toke Høiland-Jørgensen
2015-11-03 19:14 ` Dave Taht
2015-11-04 11:09 ` Toke Høiland-Jørgensen
2015-11-04 14:28 ` Sebastian Moeller
2015-11-04 18:04 ` Kevin Darbyshire-Bryant
2015-11-04 18:51 ` Toke Høiland-Jørgensen
2015-11-04 18:55 ` Sebastian Moeller
2015-11-03 17:54 ` Kevin Darbyshire-Bryant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877flzas49.fsf@toke.dk \
--to=toke@toke.dk \
--cc=cake@lists.bufferbloat.net \
--cc=chromatix99@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox