From: Dean Scarff <dos@scarff.id.au>
To: <cake@lists.bufferbloat.net>
Subject: Re: [Cake] NLA_F_NESTED is missing
Date: Tue, 03 Nov 2020 19:07:31 +1100 [thread overview]
Message-ID: <976b473251201a6843f065c2e868e3da@scarff.id.au> (raw)
In-Reply-To: <e68ac9a6a490fcefb10383342d9c981a@scarff.id.au>
On Tue, 03 Nov 2020 12:11:06 +1100, Dean Scarff wrote:
> I should be able to figure it out by poking around in tc with gdb.
I did this, and I confirmed that tc isn't trying to send any nested
attributes. So I think the problem is on the kernel side, since it
seems to be hallucinating attributes it expects to be nested but aren't.
Note that "tc" does send an empty options attribute:
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
https://salsa.debian.org/debian/iproute2/-/blob/v5.7.0/tc/q_cake.c#L356
It's the same in upstream iproute2 and iproute2-next:
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/tc/q_cake.c#n356
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/tree/tc/q_cake.c#n356
This looks valid to me. While I'm less sure about all the other
attributes being added in cake_parse_opt (i.e. whether they should be
nested under TCA_OPTIONS), that's moot in my repro case, because they're
not being set anyway.
---
Interesting parts of the gdb session:
(gdb) run qdisc add dev ppp0 root cake
Starting program: /home/dean/iproute2/tc/tc qdisc add dev ppp0 root
cake
Breakpoint 10, rtnl_talk (rtnl=0xc72d0 <rth>, n=0x7efefb78, answer=0x0)
at libnetlink.c:1048
1048 return __rtnl_talk(rtnl, n, answer, true, NULL);
(gdb) p *rtnl
$14 = {fd = 3, local = {nl_family = 16, nl_pad = 0, nl_pid = 18698,
nl_groups = 0}, peer = {nl_family = 0, nl_pad = 0, nl_pid = 0,
nl_groups = 0}, seq = 1604370876, dump = 1604370876, proto = 0,
dump_fp = 0x0, flags = 0}
(gdb) p *n
$15 = {nlmsg_len = 52, nlmsg_type = 36, nlmsg_flags = 1537, nlmsg_seq =
0,
nlmsg_pid = 0}
(gdb) p sizeof(struct nlmsghdr)
$16 = 16
(gdb) call print_qdisc(n, stdout)
added qdisc cake 0: dev ppp0 root refcnt 0 nonat nowash no-ack-filter
no-split-gso noatm overhead 0
$17 = 0
I've annotated the following to show the structure of the request.
There are only two attributes, TCA_KIND and TCA_OPTIONS, and neither of
those is nested.
(gdb) x/52xb n
nlmsghdr:
0x7efefb78: [0x34] 0x00 0x00 0x00 [0x24] 0x00 0x01 0x06
len=52 RTM_NEWQDISC
0x7efefb80: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
payload:
family header:
0x7efefb88: [0x00][0x00][0x00 0x00][0x05 0x00][0x00 0x00]
family=AF_UNSPEC ifindex=ppp0
pad1 pad2 alignment
0x7efefb90: [0x00 0x00 0x00 0x00][0xff 0xff 0xff 0xff]
handle=0 parent=TC_H_ROOT
attributes:
0x7efefb98: [0x00 0x00 0x00 0x00][0x09 0x00][0x01 0x00]
info=0 rta_len=9 rta_type=TCA_KIND
0x7efefba0: [0x63 0x61 0x6b 0x65 0x00][0x00 0x00 0x00]
rta_data=“cake” alignment
0x7efefba8: [0x04 0x00][0x02 0x00]
rta_len=4 rta_type=TCA_OPTIONS
(gdb) up
#1 0x000199a4 in tc_qdisc_modify (cmd=36, flags=1536, argc=0,
argv=0x7efffd70)
at tc_qdisc.c:208
208 if (rtnl_talk(&rth, &req.n, NULL) < 0)
(gdb) p req.t
$19 = {tcm_family = 0 '\000', tcm__pad1 = 0 '\000', tcm__pad2 = 0,
tcm_ifindex = 5, tcm_handle = 0, tcm_parent = 4294967295, tcm_info =
0}
next prev parent reply other threads:[~2020-11-03 8:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 10:15 Dean Scarff
2020-11-01 16:53 ` Y
2020-11-02 12:37 ` Toke Høiland-Jørgensen
2020-11-03 1:11 ` Dean Scarff
2020-11-03 8:07 ` Dean Scarff [this message]
2020-11-03 11:00 ` Toke Høiland-Jørgensen
2020-11-04 5:48 ` Dean Scarff
2020-11-04 11:27 ` Toke Høiland-Jørgensen
2020-11-03 1:14 ` Jonathan Morton
2020-11-03 1:51 ` Dean Scarff
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=976b473251201a6843f065c2e868e3da@scarff.id.au \
--to=dos@scarff.id.au \
--cc=cake@lists.bufferbloat.net \
/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