From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=j83Z1434; arc=none (Message is not ARC signed); dmarc=none Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by mail.toke.dk (Postfix) with ESMTPS id 2B3191815FA5 for ; Thu, 15 Oct 2026 12:32:51 +0200 (CEST) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-917bab38b14so15135286d6.3 for ; Thu, 15 Oct 2026 03:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu.com; s=google; t=1792060370; x=1792665170; darn=lists.bufferbloat.net; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=HbWQ31kC+1e1O6dmGLccpcVqgjxaFazqw0r7gj5HHA4=; b=j83Z1434uPLbi1hgRuyVynbMEKQoRaQk35cEu6N6F5feTX+cu/1PmmfbWSHkV2YRen P9vLVcDjO11dsLRU5ViGGGv3X6PJc3lF0WlYH9bj2IfwFIHNUx5dMO8PFOAVK4F0v0Nt apFn0mL0kpYol9BenxdP+CwCZzUFtKs5zI1SU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792060370; x=1792665170; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HbWQ31kC+1e1O6dmGLccpcVqgjxaFazqw0r7gj5HHA4=; b=TjUepyANb3T+apdiJYMkXsO75P7RQlAjqJoDhYhc070RfqYlGwWAO3SrlUm4hu7J7F iZrfuDDlhknhPF2yDekMZmkiIK7i7StVyQTWfksL6pn7NxudZoVxhHmzWUHaOrWBlvJS TeSN13Z7q5ncL9XjBdoY6PtNBqOkDa8O/fdoIfpYf/RWK9k96UBsVuQ6eYnhqB5b2vLL vOLGsouLBrgmmnISIXRF6azUu02LQcS17a93nA6fhu9GzIMqn295Q9FIIA1DRk28zmz4 i07T2oswCfjj0X/xX4eBw4cmOlK5+I5yQnSXPZ6FicWsX3AruO0hm7nM/D7bI8y2dwxm JIbw== X-Forwarded-Encrypted: i=1; AKwUvBxFptdml8bj6eSt88LodLx5puNmJ/e4QabHqZIIlLsHNF2JR3zPLIddBKbJFuqPyGr8dYRS@lists.bufferbloat.net X-Gm-Message-State: AFq9FYLK+o8y0f0Cu6XlfQwDpj/+XG9QcALUahxLjiyTKpi3JOKaKE3l asAs6bce2RPzBrNrS6WU9RwXlKRAfpEjZ+XUomhOZOXDbQOt2FIXHX9/jszgcYJSSQ== X-Gm-Gg: AYBFou3rl8td8M6obGvqtzu36zbT09c3SaTy/PkbS2HCyx7FrvbV7FsHkK/pdP/1NAd tnn++N02SbbIbVnMZwjKdAtw30laHjrTwmngzurXEs1es0MCogyjggO+313cBXMHl2juY1RuzYM BV0hN0NMtdYDmRzapC9FRBiy6FqKNGK3pKD6fELdD/mOliVNwvONXuqlgVYniutTX511eOMGvPQ vY65EezZptzM+Fz9kPHX52ltc7O8U5jcVxNz29z295Dtq0gqUchXeM3i4SrTyqN2LOnUQxnVr9t E8icy3YRYHV9jGAW5ALs7Y3NVUpPCUUA60C2vPc6l3uJWOKy66TE9xUJBBKnoyadYfR7HE21rQf aVz2qyBp+68Z9+WQHnOAfOm6O2T6ckNARZ5bDZM9A2lpHpRgN+BkNW/6ckyZAg9stFJD2fz8UBH pUSRFDVPG3+1FCcIjxnJ+YqM7IT7OiTyNgWBsTbSiZyyZaUb3fhl7h/41RvA+8ktNuwov9UAhe8 j556CbNS5oSMvC64UKCaTmtOYPEiirpG38aAGHN7Gsn X-Received: by 2002:a05:620a:170d:b0:936:e18d:763d with SMTP id af79cd13be357-93ebd0df184mr3132629085a.8.1792060370178; Thu, 15 Oct 2026 03:32:50 -0700 (PDT) Received: from mbili.waya ([64.203.83.2]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91ba684f404sm55261936d6.31.2026.10.15.03.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2026 03:32:49 -0700 (PDT) From: Jamal Hadi Salim To: netdev@vger.kernel.org Cc: Jamal Hadi Salim , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Jiri Pirko , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , cake@lists.bufferbloat.net, Victor Nogueira , Sashiko Date: Thu, 15 Oct 2026 06:32:41 -0400 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: ELAO44QFYHBNGPA4PDAINKJLGFUHAXWY X-Message-ID-Hash: ELAO44QFYHBNGPA4PDAINKJLGFUHAXWY X-MailFrom: jhs@mojatatu.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Subject: [Cake] [PATCH net-next v2 0/4] net/sched: sch_cake: fixes for accounting and reconfiguration List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Four independent fixes in the CAKE qdisc. Three are follow-ups to the autorate reconfiguration work around commit 7cbfb180945c ("net/sched: sch_cake: fix autorate reconfiguration throttling") and the 32-bit admission-counter wraps fixed in gred/bfifo/plug by commit 4c660ee8c809 ("net: sched: fix 32-bit backlog wrap in gred, bfifo and plug enqueue"); the fourth is a dead-code cleanup found while auditing the dump path. Patch 1 serializes a 'tc qdisc change' with the datapath's autorate update under the qdisc lock, so the netlink writer and the autorate writer can no longer lose the configured rate. rate_bps needs no atomic (it is only loaded and stored), so it stays a plain u64 with READ_ONCE()/WRITE_ONCE() annotations. Patch 2 propagates the backlog reduction of the reconfigure-time tin purge to classful parents, so a CAKE leaf under HTB no longer leaves the purged packets in the parent's qlen/backlog forever. Patch 3 widens buffer_used and buffer_max_used to u64. The u32 accumulator wraps once the resident truesize passes 2^32, bypassing the over-limit drop loop while the configured limit is a u32 attribute; the u32 MEMORY_USED export is clamped so widening the counter does not truncate the reported value. Patch 4 drops an unreachable 'nla_nest_end() < 0' error check: the helper never returns a negative value. All four are hardening for net-next (no Fixes:, no Cc: stable): the counter wrap, the missing parent-backlog propagation and the reconfiguration race all predate any contract we could anchor a regression on. Patches 1-2 were reported by Sashiko (gemini) and patch 3 comes from the gred 32-bit-wrap family; patch 4 is a static cleanup. v1 -> v2: - Patch 1/4: drop atomic64_t; rate_bps stays a plain u64 with READ_ONCE()/WRITE_ONCE() annotations (per Toke's review: the accesses are plain loads/stores, so no atomic is needed). - Patch 2/4: no change; carries Toke's v1 Acked-by. - Patch 3/4: clamp the MEMORY_USED export to U32_MAX, so widening the counter does not truncate the u32 stat (Sashiko nipa Medium). - Patch 4/4: no change; carries Toke's v1 Acked-by. Jamal Hadi Salim (4): net/sched: sch_cake: serialize reconfiguration with the datapath net/sched: sch_cake: reduce parent backlog when clearing a tin net/sched: sch_cake: widen buffer_used to u64 net/sched: sch_cake: drop dead nla_nest_end() error check net/sched/sch_cake.c | 52 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 17 deletions(-) -- 2.43.0