From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from binarylane1.sektorseven.net (binarylane1.sektorseven.net [103.230.156.226]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id EF0CE3B29D for ; Tue, 3 Nov 2020 03:07:35 -0500 (EST) Received: from mail.sektorseven.net (mail.sektorseven.net [110.173.226.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by binarylane1.sektorseven.net (Postfix) with ESMTPS id C9733E95D for ; Tue, 3 Nov 2020 19:07:32 +1100 (AEDT) Received: from mail.sektorseven.net (admin [110.173.226.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dos@scarff.id.au) by mail.sektorseven.net (Postfix) with ESMTPSA id A786B1BC01C for ; Tue, 3 Nov 2020 16:07:31 +0800 (AWST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 03 Nov 2020 19:07:31 +1100 From: Dean Scarff To: In-Reply-To: References: <202fa41a446859d714728d90e890d1d2@scarff.id.au> <87d00wkk9f.fsf@toke.dk> Message-ID: <976b473251201a6843f065c2e868e3da@scarff.id.au> X-Sender: dos@scarff.id.au User-Agent: Roundcube Webmail/0.5 Subject: Re: [Cake] =?utf-8?q?NLA=5FF=5FNESTED_is_missing?= X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 08:07:36 -0000 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 , 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}