From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CR23Knin; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=kernel.org policy.dmarc=quarantine Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by mail.toke.dk (Postfix) with ESMTPS id E7E8C1AF74BD for ; Tue, 24 Nov 2026 19:35:40 +0100 (CET) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id A7A4760CFA; Tue, 24 Nov 2026 18:35:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F1EA1F000D2; Tue, 24 Nov 2026 18:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795545338; bh=fDl32fENKK5L6QSxy3ZJfcdRLbINbZoonP8NJB2nHWY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=CR23KninORhyGf7S+TNP7Ki98gQ5VSiZ4ENMQRYU1BnXrq2lUPjr3B0HZXB1CrBiN kD8tFKvZPAsTnzzrpOIrqqA2OeT1Ca/YBtTkBR+7xiFKkX/4tpXkhZ8uiYae8Olbvu J4LElesDsmkOPXQ/8y29hs45/m8DDTXH5p1azOMKVExkMIDa6DqvtBhHy/zoHx0S1n zfFf8g0dewhdyj/TEc1uqTlTiT6F0rkD39IBT+/egdSBJsQPFEdNLaRGixUOGIlHkh eHvrZ6AfQNfDI/lh66zUzfXvnyWLr+mktkyCULrY1od2SAD/KY/tEf+L+cDIB9jNYx RcUB8LXJRSm0g== Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id A0DC0B741C3; Tue, 24 Nov 2026 19:35:35 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Paolo Abeni , Jonas =?utf-8?Q?K=C3=B6ppeler?= , Jamal Hadi Salim , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Simon Horman , Willem de Bruijn Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <34de8380-f2ea-42e2-87ff-97a52ec3200d@redhat.com> References: <20261119-cake_mq_fix_incorrect_tin_override-v1-1-3238122d09ca@tu-berlin.de> <34de8380-f2ea-42e2-87ff-97a52ec3200d@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 24 Nov 2026 19:35:35 +0100 Message-ID: <8733sqdqmg.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MailFrom: toke@kernel.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: 46ZLUIQC4OPH3Z6VJMDDKOL6INDEGHZI X-Message-ID-Hash: 46ZLUIQC4OPH3Z6VJMDDKOL6INDEGHZI X-Mailman-Approved-At: Tue, 24 Nov 2026 19:51:52 +0100 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Cake] Re: [PATCH net] net/sched: sch_cake: fix unintended tin override with cake_mq List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Paolo Abeni writes: > On 11/19/26 10:49, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> Jonas K=C3=B6ppeler writes: >>=20 >>> CAKE allows overriding the tin selection through skb->priority: if the >>> major number of skb->priority matches the qdisc handle, the minor number >>> selects the tin. With cake_mq, the per-queue CAKE instances are created >>> through qdisc_create_dflt() and never get a handle assigned, so >>> sch->handle is 0 for all of them. >>> >>> For forwarded IPv4 traffic, ip_forward() sets skb->priority from the TOS >>> byte via rt_tos2priority() when net.ipv4.ip_forward_update_priority is >>> enabled, which is the default. rt_tos2priority() returns 0, 2, 4 or 6, >>> all with a major number of 0, which matches the handle of the cake_mq >>> children. The minor number is then taken as a tin override and the DSCP >>> mapping is skipped. >>> >>> With diffserv4 and diffserv8 this puts packets into the wrong tins. For >>> example, AF13 (TOS byte 0x38) under diffserv4: >>> >>> ip_forward(): >>> skb->priority =3D ip_tos2prio[(0x38 & 0x1E) >> 1] >>> =3D ip_tos2prio[12] =3D TC_PRIO_INTERACTIVE_BULK =3D= 4 >>> cake_select_tin(): >>> TC_H_MAJ(4) =3D=3D 0 =3D=3D sch->handle >>> tin =3D bulk_order[4 - 1] =3D 3 -> Voice >>> >>> whereas the DSCP table gives diffserv4[0x38 >> 2] =3D diffserv4[14] =3D= 0, >>> i.e. Best Effort. Likewise, AF21, AF31 and AF41 are demoted from Video >>> to Best Effort. diffserv3 happens to be unaffected, because the only >>> reachable override (priority 2) agrees with its DSCP table. >>> >>> Fix this by matching skb->priority against the major number of the >>> parent cake_mq qdisc when the instance is part of cake_mq. >>> >>> Fixes: ebc65a873eff ("net/sched: sch_cake: Add cake_mq qdisc for using = cake on mq devices") >>> Signed-off-by: Jonas K=C3=B6ppeler >>=20 >> Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen > > FYI, since this was broken since the beginning and does not look > ultra-critical, I'm moving the patch to net-next. Fine with me :) -Toke