From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CwARL8GJ; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=redhat.com policy.dmarc=quarantine Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mail.toke.dk (Postfix) with ESMTPS id EA3311A938B5 for ; Thu, 19 Nov 2026 10:50:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795081804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HR1S+pskGrBHsfPFNh8M/kF8t0FfixQAliVE2UfJl5k=; b=CwARL8GJ5RMdjcLpEFyxHJisMeEBXTHt78lj/9zs+nsVPM8jLFt8LroC2zwv/PqOJoqbDs 46iS7ZQsasumKq+hIPalw0jz/BsMXZvF8TLT3yscX3ZCcLdBE02KdxJyezch8MXIc78BF+ TyIv0y5Ykp5xAIpJFygnwS8R4dc6m4o= Received: from mail-yx1-f71.google.com (mail-yx1-f71.google.com [74.125.224.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-h-HbomieO3aiCdWxRsu0pw-1; Thu, 19 Nov 2026 04:50:01 -0500 X-MC-Unique: h-HbomieO3aiCdWxRsu0pw-1 X-Mimecast-MFC-AGG-ID: h-HbomieO3aiCdWxRsu0pw_1795081801 Received: by mail-yx1-f71.google.com with SMTP id 956f58d0204a3-67906c453b8so1108788d50.1 for ; Thu, 19 Nov 2026 01:50:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795081801; x=1795686601; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:mime-version:references:in-reply-to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HR1S+pskGrBHsfPFNh8M/kF8t0FfixQAliVE2UfJl5k=; b=aTkPAWCNyjOOI7s0PYyK2j2SAjm/P871n8RdP/yJRmE0eqigmQtqW7dOByrbHERe5v WjGJ1O4oSCogNLL2ELaiFbG8dE0tBkqq8zHbPrufH8JCa1XzVShjPc9kWSFL7p5R+syC f499C70+cm9fsXCTxpXtSs8DK8KH+KLEu6SlvalN/JZWZBDHBVrI2ZSJEHk+aTWqf03O ZamJx2oQ/xx+t1+lsk5qW7mX51BSUMqBRQZjrUn2uPomKLPEqzdjvy+dyzJvDLrDU0+P FYqeFBsylp2Tp9UY25xh6v0TT59pJWn8o/s+YD7TkWOoGGL40enZMNy/7xKkpIr5+evS XOyw== X-Gm-Message-State: APuU4Z8gXI8VGBkStIjtG2zMuHNwnPdYOfVvCKm4a2Xq3T2oJ+4tMv1h EW7i8mJeI2D+nAki6VdWAzGeYe7Ynci8HGe1Dqh9eQTX+PTPYb4rLduY48lb2C8KQG8ZIE08ZwW 8RyDz5EBhZESUrPdZ6guqnRbphJ2f96LF0ArHIIXpXdCFAVLIokcyd5Be3ZGXhIIjLnijNXqcYE GHtjkp5vd7b1J3y8f7qsgSNLSAhI3Znr9lGudXSQ== X-Gm-Gg: AZFdTZe+80nhdAsDsqF9Tiq70INWKzlkgLhzeCwEZ3060cpB1zmKxyA6xYIzMqCGfvq 1BavFJFTUi/KgdThGWwj9o5XG1v2/Mtjg1YsBs+VrxFW5ti8vfkUlJ68uWdzF2Yhb1GMDZ9hd1V fDhd6x5x4O/t78jaOHxHrXhj8Z74LBCeB86BOpuP5DvWJXYODj3z4bUjHn36FuueX9vZ2oj+Jz+ zDQ3Odgugji3y78 X-Received: by 2002:a05:690e:1209:b0:677:d375:13f3 with SMTP id 956f58d0204a3-67dec391b5bmr206040d50.35.1795081801037; Thu, 19 Nov 2026 01:50:01 -0800 (PST) X-Received: by 2002:a05:690e:1209:b0:677:d375:13f3 with SMTP id 956f58d0204a3-67dec391b5bmr206029d50.35.1795081800552; Thu, 19 Nov 2026 01:50:00 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 19 Nov 2026 03:49:58 -0600 From: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= In-Reply-To: <20261119-cake_mq_fix_incorrect_tin_override-v1-1-3238122d09ca@tu-berlin.de> References: <20261119-cake_mq_fix_incorrect_tin_override-v1-1-3238122d09ca@tu-berlin.de> X-Clacks-Overhead: GNU Terry Pratchett MIME-Version: 1.0 Date: Thu, 19 Nov 2026 03:49:58 -0600 X-Gm-Features: AclHuK_N9nYxCFMP6w8kx9onG0fKDrrh5jvaU2YZIh88M_fMRcLfBkWhV58g10w Message-ID: To: =?UTF-8?Q?Jonas_K=C3=B6ppeler?= , Jamal Hadi Salim , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Willem de Bruijn Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 52zVD8yUog1zQK20xjxceu3X7SJZRaQ6krPYPOu23ig_1795081801 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-MailFrom: thoiland@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: 5XRAFRNNMWCQZ6PJHII633UUQBSFQ3Y2 X-Message-ID-Hash: 5XRAFRNNMWCQZ6PJHII633UUQBSFQ3Y2 X-Mailman-Approved-At: Thu, 19 Nov 2026 11:56:31 +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: Jonas K=C3=B6ppeler writes: > 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 ca= ke on mq devices") > Signed-off-by: Jonas K=C3=B6ppeler Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen